diff --git a/.hgtags b/.hgtags index 9ac115a08b5..2a44f210b76 100644 --- a/.hgtags +++ b/.hgtags @@ -346,3 +346,4 @@ f9bcdce2df26678c3fe468130b535c0342c69b89 jdk-9+99 80f67512daa15cf37b4825c1c62a675d524d7c49 jdk-9+101 2dc4c11fe48831854916d53c3913bdb7d49023ea jdk-9+102 4a652e4ca9523422149958673033e0ac740d5e1e jdk-9+103 +086c682bd8c5f195c324f61e2c61fbcd0226d63b jdk-9+104 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 9de50aa4824..e595785d9d3 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -346,3 +346,4 @@ c1f30ac14db0eaff398429c04cd9fab92e1b4b2a jdk-9+100 c4d72a1620835b5d657b7b6792c2879367d0154f jdk-9+101 6406ecf5d39482623225bb1b3098c2cac6f7d450 jdk-9+102 47d6462e514b2097663305a57d9c844c15d5b609 jdk-9+103 +9a38f8b4ba220708db198d08d82fd2144a64777d jdk-9+104 diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index be85de751eb..3ffc8499c5c 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -573,6 +573,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/common/autoconf + + # Setup username (for use in adhoc version strings etc) + # Outer [ ] to quote m4. + [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] + AC_SUBST(USERNAME) ]) # Evaluates platform specific overrides for devkit variables. diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index e6b8417241f..fcc2322793d 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -80,8 +80,9 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS], if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Solaris Studio does not have a concept of sysroot. Instead we must # make sure the default include and lib dirs are appended to each - # compile and link command line. - $1SYSROOT_CFLAGS="-I[$]$1SYSROOT/usr/include" + # compile and link command line. Must also add -I-xbuiltin to enable + # inlining of system functions and intrinsics. + $1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include" $1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ -L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L[$]$1SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" @@ -425,7 +426,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], # Add runtime stack smashing and undefined behavior checks. # Not all versions of gcc support -fstack-protector STACK_PROTECTOR_CFLAG="-fstack-protector-all" - FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG], IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) + FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" @@ -601,22 +602,22 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], esac elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + if test "x$OPENJDK_TARGET_CPU" = xx86; then + # Force compatibility with i586 on 32 bit intel platforms. + COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" + fi + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + ppc ) + # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + * ) + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 0fdc4605014..e4823f8e1ed 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -917,6 +917,7 @@ JVM_VARIANTS JVM_INTERPRETER JDK_VARIANT SET_OPENJDK +USERNAME CANONICAL_TOPDIR ORIGINAL_TOPDIR TOPDIR @@ -3834,7 +3835,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -4835,7 +4836,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1454146111 +DATE_WHEN_GENERATED=1454926898 ############################################################################### # @@ -15652,6 +15653,11 @@ $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/common/autoconf + # Setup username (for use in adhoc version strings etc) + # Outer [ ] to quote m4. + USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` + + # Check if it's a pure open build or if custom sources are to be used. @@ -23429,9 +23435,8 @@ $as_echo "$as_me: WARNING: --with-version-opt value has been sanitized from '$wi # Default is to calculate a string like this .. timestamp=`$DATE '+%Y-%m-%d-%H%M%S'` # Outer [ ] to quote m4. - username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` - VERSION_OPT="$timestamp.$username.$basedirname" + VERSION_OPT="$timestamp.$USERNAME.$basedirname" fi fi @@ -29968,8 +29973,9 @@ fi if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Solaris Studio does not have a concept of sysroot. Instead we must # make sure the default include and lib dirs are appended to each - # compile and link command line. - SYSROOT_CFLAGS="-I$SYSROOT/usr/include" + # compile and link command line. Must also add -I-xbuiltin to enable + # inlining of system functions and intrinsics. + SYSROOT_CFLAGS="-I-xbuiltin -I$SYSROOT/usr/include" SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" @@ -42361,8 +42367,9 @@ $as_echo "$BUILD_DEVKIT_ROOT" >&6; } if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Solaris Studio does not have a concept of sysroot. Instead we must # make sure the default include and lib dirs are appended to each - # compile and link command line. - BUILD_SYSROOT_CFLAGS="-I$BUILD_SYSROOT/usr/include" + # compile and link command line. Must also add -I-xbuiltin to enable + # inlining of system functions and intrinsics. + BUILD_SYSROOT_CFLAGS="-I-xbuiltin -I$BUILD_SYSROOT/usr/include" BUILD_SYSROOT_LDFLAGS="-L$BUILD_SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$BUILD_SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \ -L$BUILD_SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR" @@ -46191,12 +46198,12 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # Execute function body - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"" >&5 -$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"" >&5 +$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG -Werror\"... " >&6; } supports=yes saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG" + CFLAGS="$CFLAGS $STACK_PROTECTOR_CFLAG -Werror" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -46222,7 +46229,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CFLAGS="$saved_cflags" saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG" + CXXFLAGS="$CXXFLAG $STACK_PROTECTOR_CFLAG -Werror" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -46441,22 +46448,22 @@ $as_echo "$supports" >&6; } esac elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + if test "x$OPENJDK_TARGET_CPU" = xx86; then + # Force compatibility with i586 on 32 bit intel platforms. + COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" + fi + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + ppc ) + # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + * ) + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" diff --git a/common/autoconf/jdk-version.m4 b/common/autoconf/jdk-version.m4 index 32bf2e42bb2..2dc63865c49 100644 --- a/common/autoconf/jdk-version.m4 +++ b/common/autoconf/jdk-version.m4 @@ -162,9 +162,8 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], # Default is to calculate a string like this .. timestamp=`$DATE '+%Y-%m-%d-%H%M%S'` # Outer [ ] to quote m4. - [ username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] [ basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` ] - VERSION_OPT="$timestamp.$username.$basedirname" + VERSION_OPT="$timestamp.$USERNAME.$basedirname" fi fi diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index a78b30ba5ad..2bb4bdbbcd7 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -184,6 +184,7 @@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@ COMPANY_NAME:=@COMPANY_NAME@ MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@ +USERNAME:=@USERNAME@ # Different naming strings generated from the above information. RUNTIME_NAME=$(PRODUCT_NAME) $(PRODUCT_SUFFIX) diff --git a/corba/.hgtags b/corba/.hgtags index ba693c7dd28..a2e1db4ac4a 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -346,3 +346,4 @@ ea285530245cf4e0edf0479121a41347d3030eba jdk-9+98 30dfb3bd3d06b4bb80a087babc0d1841edba187b jdk-9+101 9c4662334d933d299928d1f599d02ff50777cbf8 jdk-9+102 0680fb7dae4da1ee6cf783c4b74184e3e08d3179 jdk-9+103 +e385e95e6101711d5c63e7b1a827e99b6ec7a1cc jdk-9+104 diff --git a/hotspot/.hgtags b/hotspot/.hgtags index fbc7ac926fb..dd9a2e88193 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -506,3 +506,4 @@ bdb0acafc63c42e84d9d8195bf2e2b25ee9c3306 jdk-9+100 9f45d3d57d6948cf526fbc2e2891a9a74ac6941a jdk-9+101 d5239fc1b69749ae50793c61b899fcdacf3df857 jdk-9+102 c5f55130b1b69510d9a6f4a3105b58e21cd7ffe1 jdk-9+103 +534c50395957c6025fb6627e93b35756f8d48a08 jdk-9+104 diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make index fc7b25fceaa..05a07052963 100644 --- a/hotspot/make/bsd/makefiles/gcc.make +++ b/hotspot/make/bsd/makefiles/gcc.make @@ -256,7 +256,7 @@ endif # Compiler warnings are treated as errors ifneq ($(COMPILER_WARNINGS_FATAL),false) - WARNINGS_ARE_ERRORS = -Werror + WARNINGS_ARE_ERRORS ?= -Werror endif ifeq ($(USE_CLANG), true) diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make index 835ad2fda3a..c8ee95d932b 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -203,7 +203,7 @@ else endif # Compiler warnings are treated as errors -WARNINGS_ARE_ERRORS = -Werror +WARNINGS_ARE_ERRORS ?= -Werror ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index 77d6692b903..730a5a36eca 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -66,17 +66,21 @@ CXXFLAGS = $(SYSDEFS) $(INCLUDES) CXXFLAGS += -DASSERT ifndef USE_GCC - # We need libCstd.so for adlc + # We need libCstd.so for adlc CFLAGS += -library=Cstd -g LFLAGS += -library=Cstd -g endif # CFLAGS_WARN holds compiler options to suppress/enable warnings. +CFLAGS_WARN = +w # Compiler warnings are treated as errors ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) - CFLAGS_WARN = +w -errwarn + WARNINGS_ARE_ERRORS ?= -xwe endif -# When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly + +CFLAGS_WARN += $(WARNINGS_ARE_ERRORS) + +# When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly # instantiated template functions trigger this warning when +w is active. ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 513), 1) CFLAGS_WARN += -erroff=notemsource diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make index dc78122ae84..d31237acbf1 100644 --- a/hotspot/make/solaris/makefiles/gcc.make +++ b/hotspot/make/solaris/makefiles/gcc.make @@ -117,7 +117,7 @@ endif # Compiler warnings are treated as errors -WARNINGS_ARE_ERRORS = -Werror +WARNINGS_ARE_ERRORS ?= -Werror # Enable these warnings. See 'info gcc' about details on these options WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2 diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index 9bdab00ba66..cbd902ef0fe 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -145,7 +145,8 @@ endif CFLAGS += -DDONT_USE_PRECOMPILED_HEADER # Compiler warnings are treated as errors -CFLAGS_WARN = -xwe +WARNINGS_ARE_ERRORS ?= -xwe +CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) ################################################ # Begin current (>=5.9) Forte compiler options # diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index 97c2c14583a..8c7f9465622 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -901,23 +901,18 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, "caller must use same register for non-constant itable index as for method"); // Compute start of first itableOffsetEntry (which is at the end of the vtable) - int vtable_base = InstanceKlass::vtable_start_offset() * wordSize; + int vtable_base = in_bytes(Klass::vtable_start_offset()); int itentry_off = itableMethodEntry::method_offset_in_bytes(); int scan_step = itableOffsetEntry::size() * wordSize; - int vte_size = vtableEntry::size() * wordSize; + int vte_size = vtableEntry::size_in_bytes(); assert(vte_size == wordSize, "else adjust times_vte_scale"); - ldrw(scan_temp, Address(recv_klass, InstanceKlass::vtable_length_offset() * wordSize)); + ldrw(scan_temp, Address(recv_klass, Klass::vtable_length_offset())); // %%% Could store the aligned, prescaled offset in the klassoop. // lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base)); lea(scan_temp, Address(recv_klass, scan_temp, Address::lsl(3))); add(scan_temp, scan_temp, vtable_base); - if (HeapWordsPerLong > 1) { - // Round up to align_object_offset boundary - // see code for instanceKlass::start_of_itable! - round_to(scan_temp, BytesPerLong); - } // Adjust recv_klass by scaled itable_index, so we can free itable_index. assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); @@ -966,7 +961,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, void MacroAssembler::lookup_virtual_method(Register recv_klass, RegisterOrConstant vtable_index, Register method_result) { - const int base = InstanceKlass::vtable_start_offset() * wordSize; + const int base = in_bytes(Klass::vtable_start_offset()); assert(vtableEntry::size() * wordSize == 8, "adjust the scaling in the code below"); int vtable_offset_in_bytes = base + vtableEntry::method_offset_in_bytes(); diff --git a/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp index 34b6c5caa03..223f1810a6f 100644 --- a/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -73,7 +73,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { if (DebugVtables) { Label L; // check offset vs vtable length - __ ldrw(rscratch1, Address(r19, InstanceKlass::vtable_length_offset() * wordSize)); + __ ldrw(rscratch1, Address(r19, Klass::vtable_length_offset())); __ cmpw(rscratch1, vtable_index * vtableEntry::size()); __ br(Assembler::GT, L); __ enter(); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index c51555e0b23..e9da9714579 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -1583,13 +1583,13 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, "caller must use same register for non-constant itable index as for method"); // Compute start of first itableOffsetEntry (which is at the end of the vtable). - int vtable_base = InstanceKlass::vtable_start_offset() * wordSize; + int vtable_base = in_bytes(Klass::vtable_start_offset()); int itentry_off = itableMethodEntry::method_offset_in_bytes(); int logMEsize = exact_log2(itableMethodEntry::size() * wordSize); int scan_step = itableOffsetEntry::size() * wordSize; - int log_vte_size= exact_log2(vtableEntry::size() * wordSize); + int log_vte_size= exact_log2(vtableEntry::size_in_bytes()); - lwz(scan_temp, InstanceKlass::vtable_length_offset() * wordSize, recv_klass); + lwz(scan_temp, in_bytes(Klass::vtable_length_offset()), recv_klass); // %%% We should store the aligned, prescaled offset in the klassoop. // Then the next several instructions would fold away. @@ -1657,7 +1657,7 @@ void MacroAssembler::lookup_virtual_method(Register recv_klass, assert_different_registers(recv_klass, method_result, vtable_index.register_or_noreg()); - const int base = InstanceKlass::vtable_start_offset() * wordSize; + const int base = in_bytes(Klass::vtable_start_offset()); assert(vtableEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); if (vtable_index.is_register()) { diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 50c96d03bb4..e9dfa9c5bf1 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -3568,8 +3568,8 @@ encode %{ __ load_klass(R11_scratch1, R3); - int entry_offset = InstanceKlass::vtable_start_offset() + _vtable_index * vtableEntry::size(); - int v_off = entry_offset * wordSize + vtableEntry::method_offset_in_bytes(); + int entry_offset = in_bytes(Klass::vtable_start_offset()) + _vtable_index * vtableEntry::size_in_bytes(); + int v_off = entry_offset + vtableEntry::method_offset_in_bytes(); __ li(R19_method, v_off); __ ldx(R19_method/*method oop*/, R19_method/*method offset*/, R11_scratch1/*class*/); // NOTE: for vtable dispatches, the vtable entry will never be diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index d537f73dac4..c59e7b4b38b 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -3282,9 +3282,9 @@ void TemplateTable::generate_vtable_call(Register Rrecv_klass, Register Rindex, const Register Rtarget_method = Rindex; // Get target method & entry point. - const int base = InstanceKlass::vtable_start_offset() * wordSize; + const int base = in_bytes(Klass::vtable_start_offset()); // Calc vtable addr scale the vtable index by 8. - __ sldi(Rindex, Rindex, exact_log2(vtableEntry::size() * wordSize)); + __ sldi(Rindex, Rindex, exact_log2(vtableEntry::size_in_bytes())); // Load target. __ addi(Rrecv_klass, Rrecv_klass, base + vtableEntry::method_offset_in_bytes()); __ ldx(Rtarget_method, Rindex, Rrecv_klass); diff --git a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp index 0c30519a518..9345db639e4 100644 --- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -80,14 +80,14 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { __ load_klass(rcvr_klass, R3); // Set method (in case of interpreted method), and destination address. - int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size(); + int entry_offset = in_bytes(Klass::vtable_start_offset()) + vtable_index*vtableEntry::size_in_bytes(); #ifndef PRODUCT if (DebugVtables) { Label L; // Check offset vs vtable length. const Register vtable_len = R12_scratch2; - __ lwz(vtable_len, InstanceKlass::vtable_length_offset()*wordSize, rcvr_klass); + __ lwz(vtable_len, in_bytes(Klass::vtable_length_offset()), rcvr_klass); __ cmpwi(CCR0, vtable_len, vtable_index*vtableEntry::size()); __ bge(CCR0, L); __ li(R12_scratch2, vtable_index); @@ -96,7 +96,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { } #endif - int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes(); + int v_off = entry_offset + vtableEntry::method_offset_in_bytes(); __ ld(R19_method, v_off, rcvr_klass); @@ -163,13 +163,13 @@ VtableStub* VtableStubs::create_itable_stub(int vtable_index) { __ load_klass(rcvr_klass, R3_ARG1); BLOCK_COMMENT("Load start of itable entries into itable_entry."); - __ lwz(vtable_len, InstanceKlass::vtable_length_offset() * wordSize, rcvr_klass); - __ slwi(vtable_len, vtable_len, exact_log2(vtableEntry::size() * wordSize)); + __ lwz(vtable_len, in_bytes(Klass::vtable_length_offset()), rcvr_klass); + __ slwi(vtable_len, vtable_len, exact_log2(vtableEntry::size_in_bytes())); __ add(itable_entry_addr, vtable_len, rcvr_klass); // Loop over all itable entries until desired interfaceOop(Rinterface) found. BLOCK_COMMENT("Increment itable_entry_addr in loop."); - const int vtable_base_offset = InstanceKlass::vtable_start_offset() * wordSize; + const int vtable_base_offset = in_bytes(Klass::vtable_start_offset()); __ addi(itable_entry_addr, itable_entry_addr, vtable_base_offset + itableOffsetEntry::interface_offset_in_bytes()); const int itable_offset_search_inc = itableOffsetEntry::size() * wordSize; diff --git a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp index 3d8fb0e5d5a..a9107d8dfdd 100644 --- a/hotspot/src/cpu/sparc/vm/copy_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/copy_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,6 +180,9 @@ static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { typedef void (*_zero_Fn)(HeapWord* to, size_t count); +// Only used for heap objects, so align_object_offset. +// All other platforms pd_fill_to_aligned_words simply calls pd_fill_to_words, don't +// know why this one is different. static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) { assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation"); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 51bc6afa8fe..9524e707ff4 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -2188,30 +2188,18 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, } // Compute start of first itableOffsetEntry (which is at the end of the vtable) - int vtable_base = InstanceKlass::vtable_start_offset() * wordSize; + int vtable_base = in_bytes(Klass::vtable_start_offset()); int scan_step = itableOffsetEntry::size() * wordSize; - int vte_size = vtableEntry::size() * wordSize; + int vte_size = vtableEntry::size_in_bytes(); - lduw(recv_klass, InstanceKlass::vtable_length_offset() * wordSize, scan_temp); + lduw(recv_klass, in_bytes(Klass::vtable_length_offset()), scan_temp); // %%% We should store the aligned, prescaled offset in the klassoop. // Then the next several instructions would fold away. - int round_to_unit = ((HeapWordsPerLong > 1) ? BytesPerLong : 0); int itb_offset = vtable_base; - if (round_to_unit != 0) { - // hoist first instruction of round_to(scan_temp, BytesPerLong): - itb_offset += round_to_unit - wordSize; - } - int itb_scale = exact_log2(vtableEntry::size() * wordSize); + int itb_scale = exact_log2(vtableEntry::size_in_bytes()); sll(scan_temp, itb_scale, scan_temp); add(scan_temp, itb_offset, scan_temp); - if (round_to_unit != 0) { - // Round up to align_object_offset boundary - // see code for InstanceKlass::start_of_itable! - // Was: round_to(scan_temp, BytesPerLong); - // Hoisted: add(scan_temp, BytesPerLong-1, scan_temp); - and3(scan_temp, -round_to_unit, scan_temp); - } add(recv_klass, scan_temp, scan_temp); // Adjust recv_klass by scaled itable_index, so we can free itable_index. @@ -2280,16 +2268,16 @@ void MacroAssembler::lookup_virtual_method(Register recv_klass, Register method_result) { assert_different_registers(recv_klass, method_result, vtable_index.register_or_noreg()); Register sethi_temp = method_result; - const int base = (InstanceKlass::vtable_start_offset() * wordSize + - // method pointer offset within the vtable entry: - vtableEntry::method_offset_in_bytes()); + const int base = in_bytes(Klass::vtable_start_offset()) + + // method pointer offset within the vtable entry: + vtableEntry::method_offset_in_bytes(); RegisterOrConstant vtable_offset = vtable_index; // Each of the following three lines potentially generates an instruction. // But the total number of address formation instructions will always be // at most two, and will often be zero. In any case, it will be optimal. // If vtable_index is a register, we will have (sll_ptr N,x; inc_ptr B,x; ld_ptr k,x). // If vtable_index is a constant, we will have at most (set B+X< 1) { - __ round_to(Rtemp, align_object_offset(1)); - } + __ ld(O2_Klass, in_bytes(Klass::vtable_length_offset()), Rtemp); __ sll(Rtemp, LogBytesPerWord, Rtemp); // Rscratch *= 4; if (Assembler::is_simm13(base)) { __ add(Rtemp, base, Rtemp); diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp index e266634a0d0..4e717eebe9b 100644 --- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { if (DebugVtables) { Label L; // check offset vs vtable length - __ ld(G3_scratch, InstanceKlass::vtable_length_offset()*wordSize, G5); + __ ld(G3_scratch, in_bytes(Klass::vtable_length_offset()), G5); __ cmp_and_br_short(G5, vtable_index*vtableEntry::size(), Assembler::greaterUnsigned, Assembler::pt, L); __ set(vtable_index, O2); __ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 171955f8065..e1c73024118 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -5867,22 +5867,17 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, "caller must use same register for non-constant itable index as for method"); // Compute start of first itableOffsetEntry (which is at the end of the vtable) - int vtable_base = InstanceKlass::vtable_start_offset() * wordSize; + int vtable_base = in_bytes(Klass::vtable_start_offset()); int itentry_off = itableMethodEntry::method_offset_in_bytes(); int scan_step = itableOffsetEntry::size() * wordSize; - int vte_size = vtableEntry::size() * wordSize; + int vte_size = vtableEntry::size_in_bytes(); Address::ScaleFactor times_vte_scale = Address::times_ptr; assert(vte_size == wordSize, "else adjust times_vte_scale"); - movl(scan_temp, Address(recv_klass, InstanceKlass::vtable_length_offset() * wordSize)); + movl(scan_temp, Address(recv_klass, Klass::vtable_length_offset())); // %%% Could store the aligned, prescaled offset in the klassoop. lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base)); - if (HeapWordsPerLong > 1) { - // Round up to align_object_offset boundary - // see code for InstanceKlass::start_of_itable! - round_to(scan_temp, BytesPerLong); - } // Adjust recv_klass by scaled itable_index, so we can free itable_index. assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); @@ -5930,7 +5925,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass, void MacroAssembler::lookup_virtual_method(Register recv_klass, RegisterOrConstant vtable_index, Register method_result) { - const int base = InstanceKlass::vtable_start_offset() * wordSize; + const int base = in_bytes(Klass::vtable_start_offset()); assert(vtableEntry::size() * wordSize == wordSize, "else adjust the scaling in the code below"); Address vtable_entry_addr(recv_klass, vtable_index, Address::times_ptr, diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp index ca1463fc066..3a5c7d0f38b 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,7 +85,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { if (DebugVtables) { Label L; // check offset vs vtable length - __ cmpl(Address(rax, InstanceKlass::vtable_length_offset()*wordSize), vtable_index*vtableEntry::size()); + __ cmpl(Address(rax, Klass::vtable_length_offset()), vtable_index*vtableEntry::size()); __ jcc(Assembler::greater, L); __ movl(rbx, vtable_index); __ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), rcx, rbx); diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp index 13f595884eb..6c0a2fcb6af 100644 --- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { if (DebugVtables) { Label L; // check offset vs vtable length - __ cmpl(Address(rax, InstanceKlass::vtable_length_offset() * wordSize), + __ cmpl(Address(rax, Klass::vtable_length_offset()), vtable_index * vtableEntry::size()); __ jcc(Assembler::greater, L); __ movl(rbx, vtable_index); diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java index 901ac689e4c..6b3455bdd2f 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java @@ -141,16 +141,20 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { return; } - agent = new HotSpotAgent(); - workerThread = new WorkerThread(); - attachMenuItems = new java.util.ArrayList(); - detachMenuItems = new java.util.ArrayList(); + // Create frame first, to catch any GUI creation issues + // before we initialize agent frame = new JFrame("HSDB - HotSpot Debugger"); frame.setSize(800, 600); frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); frame.addWindowListener(new CloseUI()); + agent = new HotSpotAgent(); + workerThread = new WorkerThread(); + attachMenuItems = new java.util.ArrayList(); + detachMenuItems = new java.util.ArrayList(); + + JMenuBar menuBar = new JMenuBar(); // diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java index a411534ea3a..ddddbd8693e 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,6 @@ public class ArrayKlass extends Klass { dimension = new CIntField(type.getCIntegerField("_dimension"), 0); higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0); lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0); - vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0); javaLangCloneableName = null; javaLangObjectName = null; javaIoSerializableName = null; @@ -61,7 +60,6 @@ public class ArrayKlass extends Klass { private static CIntField dimension; private static MetadataField higherDimension; private static MetadataField lowerDimension; - private static CIntField vtableLen; public Klass getJavaSuper() { SystemDictionary sysDict = VM.getVM().getSystemDictionary(); @@ -71,7 +69,6 @@ public class ArrayKlass extends Klass { public long getDimension() { return dimension.getValue(this); } public Klass getHigherDimension() { return (Klass) higherDimension.getValue(this); } public Klass getLowerDimension() { return (Klass) lowerDimension.getValue(this); } - public long getVtableLen() { return vtableLen.getValue(this); } // constant class names - javaLangCloneable, javaIoSerializable, javaLangObject // Initialized lazily to avoid initialization ordering dependencies between ArrayKlass and SymbolTable @@ -140,6 +137,5 @@ public class ArrayKlass extends Klass { visitor.doCInt(dimension, true); visitor.doMetadata(higherDimension, true); visitor.doMetadata(lowerDimension, true); - visitor.doCInt(vtableLen, true); } } diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java index 5cbc25e8ef4..8a443833f8c 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -696,7 +696,7 @@ public class ConstantPool extends Metadata implements ClassConstants { } public long getSize() { - return Oop.alignObjectSize(headerSize + getLength()); + return alignSize(headerSize + getLength()); } //---------------------------------------------------------------------- diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java index b238cd30992..3ac3ced3615 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,7 +70,7 @@ public class ConstantPoolCache extends Metadata { public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); } public long getSize() { - return Oop.alignObjectSize(baseOffset + getLength() * elementSize); + return alignSize(baseOffset + getLength() * elementSize); } public ConstantPoolCacheEntry getEntryAt(int i) { @@ -79,8 +79,7 @@ public class ConstantPoolCache extends Metadata { } public int getIntAt(int entry, int fld) { - //alignObjectSize ? - long offset = baseOffset + /*alignObjectSize*/entry * elementSize + fld * intSize; + long offset = baseOffset + entry * elementSize + fld * intSize; return (int) getAddress().getCIntegerAt(offset, intSize, true ); } diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java index 75aa05c3954..d2f15f0c606 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,13 +84,12 @@ public class InstanceKlass extends Klass { nonstaticOopMapSize = new CIntField(type.getCIntegerField("_nonstatic_oop_map_size"), 0); isMarkedDependent = new CIntField(type.getCIntegerField("_is_marked_dependent"), 0); initState = new CIntField(type.getCIntegerField("_init_state"), 0); - vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0); itableLen = new CIntField(type.getCIntegerField("_itable_len"), 0); breakpoints = type.getAddressField("_breakpoints"); genericSignatureIndex = new CIntField(type.getCIntegerField("_generic_signature_index"), 0); majorVersion = new CIntField(type.getCIntegerField("_major_version"), 0); minorVersion = new CIntField(type.getCIntegerField("_minor_version"), 0); - headerSize = Oop.alignObjectOffset(type.getSize()); + headerSize = type.getSize(); // read field offset constants ACCESS_FLAGS_OFFSET = db.lookupIntConstant("FieldInfo::access_flags_offset").intValue(); @@ -143,7 +142,6 @@ public class InstanceKlass extends Klass { private static CIntField nonstaticOopMapSize; private static CIntField isMarkedDependent; private static CIntField initState; - private static CIntField vtableLen; private static CIntField itableLen; private static AddressField breakpoints; private static CIntField genericSignatureIndex; @@ -242,8 +240,7 @@ public class InstanceKlass extends Klass { } public long getSize() { - return Oop.alignObjectSize(getHeaderSize() + Oop.alignObjectOffset(getVtableLen()) + - Oop.alignObjectOffset(getItableLen()) + Oop.alignObjectOffset(getNonstaticOopMapSize())); + return alignSize(getHeaderSize() + getVtableLen() + getItableLen() + getNonstaticOopMapSize()); } public static long getHeaderSize() { return headerSize; } @@ -352,7 +349,6 @@ public class InstanceKlass extends Klass { public long getStaticOopFieldCount() { return staticOopFieldCount.getValue(this); } public long getNonstaticOopMapSize() { return nonstaticOopMapSize.getValue(this); } public boolean getIsMarkedDependent() { return isMarkedDependent.getValue(this) != 0; } - public long getVtableLen() { return vtableLen.getValue(this); } public long getItableLen() { return itableLen.getValue(this); } public long majorVersion() { return majorVersion.getValue(this); } public long minorVersion() { return minorVersion.getValue(this); } @@ -548,7 +544,6 @@ public class InstanceKlass extends Klass { visitor.doCInt(nonstaticOopMapSize, true); visitor.doCInt(isMarkedDependent, true); visitor.doCInt(initState, true); - visitor.doCInt(vtableLen, true); visitor.doCInt(itableLen, true); } diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java index 3fe93b7fc6b..b5d93a852a7 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +61,7 @@ public class Klass extends Metadata implements ClassConstants { } subklass = new MetadataField(type.getAddressField("_subklass"), 0); nextSibling = new MetadataField(type.getAddressField("_next_sibling"), 0); + vtableLen = new CIntField(type.getCIntegerField("_vtable_len"), 0); LH_INSTANCE_SLOW_PATH_BIT = db.lookupIntConstant("Klass::_lh_instance_slow_path_bit").intValue(); LH_LOG2_ELEMENT_SIZE_SHIFT = db.lookupIntConstant("Klass::_lh_log2_element_size_shift").intValue(); @@ -71,6 +72,7 @@ public class Klass extends Metadata implements ClassConstants { LH_ARRAY_TAG_OBJ_VALUE = db.lookupIntConstant("Klass::_lh_array_tag_obj_value").intValue(); } + public Klass(Address addr) { super(addr); } @@ -91,6 +93,7 @@ public class Klass extends Metadata implements ClassConstants { private static MetadataField subklass; private static MetadataField nextSibling; private static sun.jvm.hotspot.types.Field traceIDField; + private static CIntField vtableLen; private Address getValue(AddressField field) { return addr.getAddressAt(field.getOffset()); @@ -111,6 +114,7 @@ public class Klass extends Metadata implements ClassConstants { public AccessFlags getAccessFlagsObj(){ return new AccessFlags(getAccessFlags()); } public Klass getSubklassKlass() { return (Klass) subklass.getValue(this); } public Klass getNextSiblingKlass() { return (Klass) nextSibling.getValue(this); } + public long getVtableLen() { return vtableLen.getValue(this); } public long traceID() { if (traceIDField == null) return 0; @@ -179,6 +183,7 @@ public class Klass extends Metadata implements ClassConstants { visitor.doCInt(accessFlags, true); visitor.doMetadata(subklass, true); visitor.doMetadata(nextSibling, true); + visitor.doCInt(vtableLen, true); } public long getObjectSize() { diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java index 4fc2ed8c6a8..244312b97c7 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +44,11 @@ abstract public class Metadata extends VMObject { super(addr); } + public static long alignSize(long size) { + // natural word size. + return VM.getVM().alignUp(size, VM.getVM().getBytesPerWord()); + } + private static VirtualBaseConstructor metadataConstructor; private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java index f07b8268873..1549538a10e 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -252,7 +252,7 @@ public class MethodData extends Metadata implements MethodDataInterface parametersTypeData() { diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java index 3d6fb46a2e1..298b098c0ff 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java @@ -35,7 +35,11 @@ public class WorkerThread { public WorkerThread() { mqb = new MessageQueueBackend(); mq = mqb.getFirstQueue(); - new Thread(new MainLoop()).start(); + + // Enable to terminate this worker during runnning by daemonize. + Thread mqthread = new Thread(new MainLoop()); + mqthread.setDaemon(true); + mqthread.start(); } /** Runs the given Runnable in the thread represented by this diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 9017ffde58d..65b58610165 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -597,7 +597,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp } HotSpotVMConfig config = config(); final int vtableIndex = getVtableIndex((HotSpotResolvedObjectTypeImpl) resolved); - return config.instanceKlassVtableStartOffset() + vtableIndex * config.vtableEntrySize + config.vtableEntryMethodOffset; + return config.klassVtableStartOffset + vtableIndex * config.vtableEntrySize + config.vtableEntryMethodOffset; } @Override diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index 69f9714a517..6d192ef8a86 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -470,8 +470,8 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem /* Everything has the core vtable of java.lang.Object */ return config.baseVtableLength(); } - int result = UNSAFE.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize); - assert result >= config.baseVtableLength() : UNSAFE.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) + " " + config.vtableEntrySize; + int result = UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize); + assert result >= config.baseVtableLength() : UNSAFE.getInt(getMetaspaceKlass() + config.klassVtableLengthOffset) + " " + config.vtableEntrySize; return result; } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 5f9c68c1685..3a4030c696b 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1031,19 +1031,12 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "InstanceKlass::_init_state", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassInitStateOffset; @HotSpotVMField(name = "InstanceKlass::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassConstantsOffset; @HotSpotVMField(name = "InstanceKlass::_fields", type = "Array*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassFieldsOffset; - @HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_start_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableStartOffset; - @HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_length_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableLengthOffset; + @HotSpotVMField(name = "CompilerToVM::Data::Klass_vtable_start_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassVtableStartOffset; + @HotSpotVMField(name = "CompilerToVM::Data::Klass_vtable_length_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassVtableLengthOffset; @HotSpotVMConstant(name = "InstanceKlass::linked") @Stable public int instanceKlassStateLinked; @HotSpotVMConstant(name = "InstanceKlass::fully_initialized") @Stable public int instanceKlassStateFullyInitialized; - /** - * See {@code InstanceKlass::vtable_start_offset()}. - */ - public final int instanceKlassVtableStartOffset() { - return instanceKlassVtableStartOffset * heapWordSize; - } - @HotSpotVMType(name = "arrayOopDesc", get = HotSpotVMType.Type.SIZE) @Stable public int arrayOopDescSize; /** diff --git a/hotspot/src/os/linux/vm/globals_linux.hpp b/hotspot/src/os/linux/vm/globals_linux.hpp index 29e450f8dbe..05f4c181336 100644 --- a/hotspot/src/os/linux/vm/globals_linux.hpp +++ b/hotspot/src/os/linux/vm/globals_linux.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,7 +48,10 @@ "Load DLLs with executable-stack attribute in the VM Thread") \ \ product(bool, UseSHM, false, \ - "Use SYSV shared memory for large pages") + "Use SYSV shared memory for large pages") \ + \ + diagnostic(bool, UseCpuAllocPath, false, \ + "Use CPU_ALLOC code path in os::active_processor_count ") // // Defines Linux-specific default values. The flags are available on all diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 7e01a577d5b..61406a11ddf 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +32,7 @@ #include "compiler/disassembler.hpp" #include "interpreter/interpreter.hpp" #include "jvm_linux.h" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" #include "mutex_linux.inline.hpp" @@ -106,6 +107,14 @@ # include # include +#ifndef _GNU_SOURCE + #define _GNU_SOURCE + #include + #undef _GNU_SOURCE +#else + #include +#endif + // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling // getrusage() is prepared to handle the associated failure. #ifndef RUSAGE_THREAD @@ -4762,12 +4771,72 @@ void os::make_polling_page_readable(void) { } } +// Get the current number of available processors for this process. +// This value can change at any time during a process's lifetime. +// sched_getaffinity gives an accurate answer as it accounts for cpusets. +// If it appears there may be more than 1024 processors then we do a +// dynamic check - see 6515172 for details. +// If anything goes wrong we fallback to returning the number of online +// processors - which can be greater than the number available to the process. int os::active_processor_count() { - // Linux doesn't yet have a (official) notion of processor sets, - // so just return the number of online processors. - int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); - assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check"); - return online_cpus; + cpu_set_t cpus; // can represent at most 1024 (CPU_SETSIZE) processors + cpu_set_t* cpus_p = &cpus; + int cpus_size = sizeof(cpu_set_t); + + int configured_cpus = processor_count(); // upper bound on available cpus + int cpu_count = 0; + + // To enable easy testing of the dynamic path on different platforms we + // introduce a diagnostic flag: UseCpuAllocPath + if (configured_cpus >= CPU_SETSIZE || UseCpuAllocPath) { + // kernel may use a mask bigger than cpu_set_t + log_trace(os)("active_processor_count: using dynamic path %s" + "- configured processors: %d", + UseCpuAllocPath ? "(forced) " : "", + configured_cpus); + cpus_p = CPU_ALLOC(configured_cpus); + if (cpus_p != NULL) { + cpus_size = CPU_ALLOC_SIZE(configured_cpus); + // zero it just to be safe + CPU_ZERO_S(cpus_size, cpus_p); + } + else { + // failed to allocate so fallback to online cpus + int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN); + log_trace(os)("active_processor_count: " + "CPU_ALLOC failed (%s) - using " + "online processor count: %d", + strerror(errno), online_cpus); + return online_cpus; + } + } + else { + log_trace(os)("active_processor_count: using static path - configured processors: %d", + configured_cpus); + } + + // pid 0 means the current thread - which we have to assume represents the process + if (sched_getaffinity(0, cpus_size, cpus_p) == 0) { + if (cpus_p != &cpus) { + cpu_count = CPU_COUNT_S(cpus_size, cpus_p); + } + else { + cpu_count = CPU_COUNT(cpus_p); + } + log_trace(os)("active_processor_count: sched_getaffinity processor count: %d", cpu_count); + } + else { + cpu_count = ::sysconf(_SC_NPROCESSORS_ONLN); + warning("sched_getaffinity failed (%s)- using online processor count (%d) " + "which may exceed available processors", strerror(errno), cpu_count); + } + + if (cpus_p != &cpus) { + CPU_FREE(cpus_p); + } + + assert(cpu_count > 0 && cpu_count <= processor_count(), "sanity check"); + return cpu_count; } void os::set_native_thread_name(const char *name) { diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index f0ab29c3486..1df102a7607 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -5267,8 +5267,29 @@ bool os::check_heap(bool force) { bool os::find(address addr, outputStream* st) { - // Nothing yet - return false; + int offset = -1; + bool result = false; + char buf[256]; + if (os::dll_address_to_library_name(addr, buf, sizeof(buf), &offset)) { + st->print(PTR_FORMAT " ", addr); + if (strlen(buf) < sizeof(buf) - 1) { + char* p = strrchr(buf, '\\'); + if (p) { + st->print("%s", p + 1); + } else { + st->print("%s", buf); + } + } else { + // The library name is probably truncated. Let's omit the library name. + // See also JDK-8147512. + } + if (os::dll_address_to_function_name(addr, buf, sizeof(buf), &offset)) { + st->print("::%s + 0x%x", buf, offset); + } + st->cr(); + result = true; + } + return result; } LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) { diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp index ab6ba5c9037..284091dc09c 100644 --- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp +++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp @@ -599,6 +599,7 @@ void os::print_register_info(outputStream *st, const void *context) { // this is only for the "general purpose" registers #ifdef AMD64 + st->print("RIP="); print_location(st, uc->Rip); st->print("RAX="); print_location(st, uc->Rax); st->print("RBX="); print_location(st, uc->Rbx); st->print("RCX="); print_location(st, uc->Rcx); @@ -616,6 +617,7 @@ void os::print_register_info(outputStream *st, const void *context) { st->print("R14="); print_location(st, uc->R14); st->print("R15="); print_location(st, uc->R15); #else + st->print("EIP="); print_location(st, uc->Eip); st->print("EAX="); print_location(st, uc->Eax); st->print("EBX="); print_location(st, uc->Ebx); st->print("ECX="); print_location(st, uc->Ecx); diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 8fa61f1e975..30ae8f86e9f 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2972,8 +2972,8 @@ void LIRGenerator::do_Invoke(Invoke* x) { SharedRuntime::get_resolve_virtual_call_stub(), arg_list, info); } else { - int entry_offset = InstanceKlass::vtable_start_offset() + x->vtable_index() * vtableEntry::size(); - int vtable_offset = entry_offset * wordSize + vtableEntry::method_offset_in_bytes(); + int entry_offset = in_bytes(Klass::vtable_start_offset()) + x->vtable_index() * vtableEntry::size_in_bytes(); + int vtable_offset = entry_offset + vtableEntry::method_offset_in_bytes(); __ call_virtual(target, receiver, result_register, vtable_offset, arg_list, info); } break; diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 0891794a931..a75504d2025 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -34,6 +34,7 @@ #include "classfile/verifier.hpp" #include "classfile/vmSymbols.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/metadataFactory.hpp" #include "memory/oopFactory.hpp" @@ -79,7 +80,7 @@ #define JAVA_CLASSFILE_MAGIC 0xCAFEBABE #define JAVA_MIN_SUPPORTED_VERSION 45 -#define JAVA_MAX_SUPPORTED_VERSION 52 +#define JAVA_MAX_SUPPORTED_VERSION 53 #define JAVA_MAX_SUPPORTED_MINOR_VERSION 0 // Used for two backward compatibility reasons: @@ -100,6 +101,8 @@ // Extension method support. #define JAVA_8_VERSION 52 +#define JAVA_9_VERSION 53 + enum { LegalClass, LegalField, LegalMethod }; // used to verify unqualified names void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const stream, @@ -2705,7 +2708,7 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs, ConstMethod::NORMAL, CHECK_NULL); - ClassLoadingService::add_class_method_size(m->size()*HeapWordSize); + ClassLoadingService::add_class_method_size(m->size()*wordSize); // Fill in information from fixed part (access_flags already set) m->set_constants(_cp); @@ -4602,8 +4605,8 @@ void ClassFileParser::verify_legal_method_modifiers(jint flags, } } else if (major_gte_15) { // Class file version in the interval [JAVA_1_5_VERSION, JAVA_8_VERSION) - if (!is_public || is_static || is_final || is_synchronized || - is_native || !is_abstract || is_strict) { + if (!is_public || is_private || is_protected || is_static || is_final || + is_synchronized || is_native || !is_abstract || is_strict) { is_illegal = true; } } else { @@ -5347,30 +5350,12 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, TRAPS) { ClassLoadingService::notify_class_loaded(ik, false /* not shared class */); if (!is_internal()) { - if (TraceClassLoading) { - ResourceMark rm; - // print in a single call to reduce interleaving of output - if (_stream->source() != NULL) { - tty->print("[Loaded %s from %s]\n", - ik->external_name(), - _stream->source()); - } else if (_loader_data->class_loader() == NULL) { - const Klass* const caller = - THREAD->is_Java_thread() - ? ((JavaThread*)THREAD)->security_get_caller_class(1) - : NULL; - // caller can be NULL, for example, during a JVMTI VM_Init hook - if (caller != NULL) { - tty->print("[Loaded %s by instance of %s]\n", - ik->external_name(), - caller->external_name()); - } else { - tty->print("[Loaded %s]\n", ik->external_name()); - } - } else { - tty->print("[Loaded %s from %s]\n", ik->external_name(), - _loader_data->class_loader()->klass()->external_name()); - } + if (log_is_enabled(Info, classload)) { + ik->print_loading_log(LogLevel::Info, _loader_data, _stream); + } + // No 'else' here as logging levels are not mutually exclusive + if (log_is_enabled(Debug, classload)) { + ik->print_loading_log(LogLevel::Debug, _loader_data, _stream); } if (log_is_enabled(Info, classresolve)) { diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 3881be599a7..14feb9876cf 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -578,15 +578,14 @@ ClassPathEntry* ClassLoader::create_class_path_entry(const char *path, const str } } } - if (TraceClassLoading || TraceClassPaths) { + if (TraceClassPaths) { tty->print_cr("[Opened %s]", path); } + log_info(classload)("opened: %s", path); } else { // Directory new_entry = new ClassPathDirEntry(path); - if (TraceClassLoading) { - tty->print_cr("[Path %s]", path); - } + log_info(classload)("path: %s", path); } return new_entry; } diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 31de9b4836f..9543a1fac7b 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,12 +54,14 @@ #include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" #include "memory/oopFactory.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" +#include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/mutex.hpp" #include "runtime/safepoint.hpp" @@ -286,9 +288,9 @@ void ClassLoaderData::add_class(Klass* k, bool publicize /* true */) { _klasses = k; } - if (publicize && TraceClassLoaderData && Verbose && k->class_loader_data() != NULL) { + if (publicize && k->class_loader_data() != NULL) { ResourceMark rm; - tty->print_cr("[TraceClassLoaderData] Adding k: " PTR_FORMAT " %s to CLD: " + log_trace(classloaderdata)("Adding k: " PTR_FORMAT " %s to CLD: " PTR_FORMAT " loader: " PTR_FORMAT " %s", p2i(k), k->external_name(), @@ -326,15 +328,16 @@ void ClassLoaderData::unload() { // Tell serviceability tools these classes are unloading classes_do(InstanceKlass::notify_unload_class); - if (TraceClassLoaderData) { + if (log_is_enabled(Debug, classloaderdata)) { ResourceMark rm; - tty->print("[ClassLoaderData: unload loader data " INTPTR_FORMAT, p2i(this)); - tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()), + outputStream* log = LogHandle(classloaderdata)::debug_stream(); + log->print(": unload loader data " INTPTR_FORMAT, p2i(this)); + log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()), loader_name()); if (is_anonymous()) { - tty->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses)); + log->print(" for anonymous class " INTPTR_FORMAT " ", p2i(_klasses)); } - tty->print_cr("]"); + log->cr(); } } @@ -408,13 +411,13 @@ Metaspace* ClassLoaderData::metaspace_non_null() { assert (class_loader() == NULL, "Must be"); set_metaspace(new Metaspace(_metaspace_lock, Metaspace::BootMetaspaceType)); } else if (is_anonymous()) { - if (TraceClassLoaderData && Verbose && class_loader() != NULL) { - tty->print_cr("is_anonymous: %s", class_loader()->klass()->internal_name()); + if (class_loader() != NULL) { + log_trace(classloaderdata)("is_anonymous: %s", class_loader()->klass()->internal_name()); } set_metaspace(new Metaspace(_metaspace_lock, Metaspace::AnonymousMetaspaceType)); } else if (class_loader()->is_a(SystemDictionary::reflect_DelegatingClassLoader_klass())) { - if (TraceClassLoaderData && Verbose && class_loader() != NULL) { - tty->print_cr("is_reflection: %s", class_loader()->klass()->internal_name()); + if (class_loader() != NULL) { + log_trace(classloaderdata)("is_reflection: %s", class_loader()->klass()->internal_name()); } set_metaspace(new Metaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType)); } else { @@ -601,21 +604,47 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA cld->set_next(next); ClassLoaderData* exchanged = (ClassLoaderData*)Atomic::cmpxchg_ptr(cld, list_head, next); if (exchanged == next) { - if (TraceClassLoaderData) { - ResourceMark rm; - tty->print("[ClassLoaderData: "); - tty->print("create class loader data " INTPTR_FORMAT, p2i(cld)); - tty->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()), - cld->loader_name()); - tty->print_cr("]"); + if (log_is_enabled(Debug, classloaderdata)) { + PauseNoSafepointVerifier pnsv(&no_safepoints); // Need safe points for JavaCalls::call_virtual + log_creation(loader, cld, CHECK_NULL); } return cld; } next = exchanged; } while (true); - } +void ClassLoaderDataGraph::log_creation(Handle loader, ClassLoaderData* cld, TRAPS) { + Handle string; + if (loader.not_null()) { + // Include the result of loader.toString() in the output. This allows + // the user of the log to identify the class loader instance. + JavaValue result(T_OBJECT); + KlassHandle spec_klass(THREAD, SystemDictionary::ClassLoader_klass()); + JavaCalls::call_virtual(&result, + loader, + spec_klass, + vmSymbols::toString_name(), + vmSymbols::void_string_signature(), + CHECK); + assert(result.get_type() == T_OBJECT, "just checking"); + string = (oop)result.get_jobject(); + } + + ResourceMark rm; + outputStream* log = LogHandle(classloaderdata)::debug_stream(); + log->print("create class loader data " INTPTR_FORMAT, p2i(cld)); + log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()), + cld->loader_name()); + + if (string.not_null()) { + log->print(": "); + java_lang_String::print(string(), log); + } + log->cr(); +} + + void ClassLoaderDataGraph::oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim) { for (ClassLoaderData* cld = _head; cld != NULL; cld = cld->next()) { cld->oops_do(f, klass_closure, must_claim); @@ -709,10 +738,11 @@ GrowableArray* ClassLoaderDataGraph::new_clds() { if (!curr->claimed()) { array->push(curr); - if (TraceClassLoaderData) { - tty->print("[ClassLoaderData] found new CLD: "); - curr->print_value_on(tty); - tty->cr(); + if (log_is_enabled(Debug, classloaderdata)) { + outputStream* log = LogHandle(classloaderdata)::debug_stream(); + log->print("found new CLD: "); + curr->print_value_on(log); + log->cr(); } } diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp index d208fde85fb..f6e82fa12bc 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp @@ -116,6 +116,7 @@ class ClassLoaderDataGraph : public AllStatic { static void dump_on(outputStream * const out) PRODUCT_RETURN; static void dump() { dump_on(tty); } static void verify(); + static void log_creation(Handle loader, ClassLoaderData* cld, TRAPS); static bool unload_list_contains(const void* x); #ifndef PRODUCT diff --git a/hotspot/src/share/vm/classfile/compactHashtable.cpp b/hotspot/src/share/vm/classfile/compactHashtable.cpp index 68781c1e14d..a2c507d3078 100644 --- a/hotspot/src/share/vm/classfile/compactHashtable.cpp +++ b/hotspot/src/share/vm/classfile/compactHashtable.cpp @@ -365,14 +365,14 @@ bool HashtableTextDump::skip_newline() { } int HashtableTextDump::skip(char must_be_char) { - corrupted_if(remain() < 1); - corrupted_if(*_p++ != must_be_char); + corrupted_if(remain() < 1, "Truncated"); + corrupted_if(*_p++ != must_be_char, "Unexpected character"); return 0; } void HashtableTextDump::skip_past(char c) { for (;;) { - corrupted_if(remain() < 1); + corrupted_if(remain() < 1, "Truncated"); if (*_p++ == c) { return; } @@ -381,7 +381,7 @@ void HashtableTextDump::skip_past(char c) { void HashtableTextDump::check_version(const char* ver) { int len = (int)strlen(ver); - corrupted_if(remain() < len); + corrupted_if(remain() < len, "Truncated"); if (strncmp(_p, ver, len) != 0) { quit("wrong version of hashtable dump file", _filename); } @@ -451,7 +451,7 @@ int HashtableTextDump::scan_symbol_prefix() { jchar HashtableTextDump::unescape(const char* from, const char* end, int count) { jchar value = 0; - corrupted_if(from + count > end); + corrupted_if(from + count > end, "Truncated"); for (int i=0; i end); + corrupted_if(from + 2 > end, "Truncated"); char c = from[1]; from += 2; switch (c) { @@ -507,7 +507,7 @@ void HashtableTextDump::get_utf8(char* utf8_buffer, int utf8_length) { } } } - corrupted_if(n > 0); // expected more chars but file has ended + corrupted_if(n > 0, "Truncated"); // expected more chars but file has ended _p = from; skip_newline(); } diff --git a/hotspot/src/share/vm/classfile/compactHashtable.hpp b/hotspot/src/share/vm/classfile/compactHashtable.hpp index 1c9e336729a..ea602229d94 100644 --- a/hotspot/src/share/vm/classfile/compactHashtable.hpp +++ b/hotspot/src/share/vm/classfile/compactHashtable.hpp @@ -276,9 +276,9 @@ public: void corrupted(const char *p, const char *msg); - inline void corrupted_if(bool cond) { + inline void corrupted_if(bool cond, const char *msg) { if (cond) { - corrupted(_p, NULL); + corrupted(_p, msg); } } @@ -287,27 +287,30 @@ public: void skip_past(char c); void check_version(const char* ver); - inline bool get_num(char delim, int *utf8_length) { + inline void get_num(char delim, int *num) { const char* p = _p; const char* end = _end; - int num = 0; + u8 n = 0; while (p < end) { char c = *p ++; if ('0' <= c && c <= '9') { - num = num * 10 + (c - '0'); + n = n * 10 + (c - '0'); + if (n > (u8)INT_MAX) { + corrupted(_p, "Num overflow"); + } } else if (c == delim) { _p = p; - *utf8_length = num; - return true; + *num = (int)n; + return; } else { // Not [0-9], not 'delim' - return false; + corrupted(_p, "Unrecognized format");; } } + corrupted(_end, "Incorrect format"); ShouldNotReachHere(); - return false; } void scan_prefix_type(); diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index acd365cc025..2df6a47088c 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,7 +129,7 @@ compute_offset(int &dest_offset, tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int()); } #endif //PRODUCT - vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class"); + vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class"); } dest_offset = fd.offset(); } @@ -3972,7 +3972,7 @@ int InjectedField::compute_offset() { tty->print_cr(" name: %s, sig: %s, flags: %08x", fs.name()->as_C_string(), fs.signature()->as_C_string(), fs.access_flags().as_int()); } #endif //PRODUCT - vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class"); + vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class"); return -1; } diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp index 391e21eedab..ee303426f3c 100644 --- a/hotspot/src/share/vm/classfile/stringTable.cpp +++ b/hotspot/src/share/vm/classfile/stringTable.cpp @@ -737,7 +737,7 @@ bool StringTable::copy_compact_table(char** top, char *end, GrowableArray::_string_table, (char*)p); - const char* aligned_end = (const char*)align_pointer_up(end, sizeof(void*)); + const char* aligned_end = (const char*)align_ptr_up(end, sizeof(void*)); if (_ignore_shared_strings) { _shared_table.reset(); diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index 93ed78520cb..7574e85c8f2 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -544,7 +544,7 @@ bool SymbolTable::copy_compact_table(char** top, char*end) { ch_table.dump(top, end); - *top = (char*)align_pointer_up(*top, sizeof(void*)); + *top = (char*)align_ptr_up(*top, sizeof(void*)); #endif return true; } @@ -552,7 +552,7 @@ bool SymbolTable::copy_compact_table(char** top, char*end) { const char* SymbolTable::init_shared_table(const char* buffer) { const char* end = _shared_table.init( CompactHashtable::_symbol_table, buffer); - return (const char*)align_pointer_up(end, sizeof(void*)); + return (const char*)align_ptr_up(end, sizeof(void*)); } //--------------------------------------------------------------------------- @@ -600,7 +600,7 @@ void SymbolTable::print_histogram() { tty->print_cr("Symbol Table Histogram:"); tty->print_cr(" Total number of symbols %7d", total_count); tty->print_cr(" Total size in memory %7dK", - (total_size*HeapWordSize)/1024); + (total_size*wordSize)/1024); tty->print_cr(" Total counted %7d", _symbols_counted); tty->print_cr(" Total removed %7d", _symbols_removed); if (_symbols_counted > 0) { @@ -617,11 +617,11 @@ void SymbolTable::print_histogram() { tty->print_cr(" %6s %10s %10s", "Length", "#Symbols", "Size"); for (i = 0; i < results_length; i++) { if (counts[i] > 0) { - tty->print_cr(" %6d %10d %10dK", i, counts[i], (sizes[i]*HeapWordSize)/1024); + tty->print_cr(" %6d %10d %10dK", i, counts[i], (sizes[i]*wordSize)/1024); } } tty->print_cr(" >=%6d %10d %10dK\n", results_length, - out_of_range_count, (out_of_range_size*HeapWordSize)/1024); + out_of_range_count, (out_of_range_size*wordSize)/1024); } void SymbolTable::print() { diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index ecb451ab481..2a61613e910 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1302,14 +1302,13 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik, ik->restore_unshareable_info(loader_data, protection_domain, CHECK_(nh)); } - if (TraceClassLoading) { - ResourceMark rm; - tty->print("[Loaded %s", ik->external_name()); - tty->print(" from shared objects file"); - if (class_loader.not_null()) { - tty->print(" by %s", loader_data->loader_name()); - } - tty->print_cr("]"); + if (log_is_enabled(Info, classload)) { + ik()->print_loading_log(LogLevel::Info, loader_data, NULL); + } + // No 'else' here as logging levels are not mutually exclusive + + if (log_is_enabled(Debug, classload)) { + ik()->print_loading_log(LogLevel::Debug, loader_data, NULL); } if (DumpLoadedClassList != NULL && classlist_file->is_open()) { diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index c2759287c3f..b5a827b7c10 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -651,6 +651,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) { int ex_max = -1; // Look through each item on the exception table. Each of the fields must refer // to a legal instruction. + if (was_recursively_verified()) return; verify_exception_handler_table( code_length, code_data, ex_min, ex_max, CHECK_VERIFY(this)); @@ -737,11 +738,14 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) { // should be used for this check. So, do the check here before a possible // local is added to the type state. if (Bytecodes::is_store_into_local(opcode) && bci >= ex_min && bci < ex_max) { + if (was_recursively_verified()) return; verify_exception_handler_targets( bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this)); verified_exc_handlers = true; } + if (was_recursively_verified()) return; + switch (opcode) { case Bytecodes::_nop : no_control_flow = false; break; @@ -1730,6 +1734,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) { assert(!(verified_exc_handlers && this_uninit), "Exception handler targets got verified before this_uninit got set"); if (!verified_exc_handlers && bci >= ex_min && bci < ex_max) { + if (was_recursively_verified()) return; verify_exception_handler_targets( bci, this_uninit, ¤t_frame, &stackmap_table, CHECK_VERIFY(this)); } @@ -1767,6 +1772,9 @@ char* ClassVerifier::generate_code_data(const methodHandle& m, u4 code_length, T return code_data; } +// Since this method references the constant pool, call was_recursively_verified() +// before calling this method to make sure a prior class load did not cause the +// current class to get verified. void ClassVerifier::verify_exception_handler_table(u4 code_length, char* code_data, int& min, int& max, TRAPS) { ExceptionTable exhandlers(_method()); int exlength = exhandlers.length(); @@ -1874,7 +1882,11 @@ u2 ClassVerifier::verify_stackmap_table(u2 stackmap_index, u2 bci, return stackmap_index; } -void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, StackMapFrame* current_frame, +// Since this method references the constant pool, call was_recursively_verified() +// before calling this method to make sure a prior class load did not cause the +// current class to get verified. +void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, + StackMapFrame* current_frame, StackMapTable* stackmap_table, TRAPS) { constantPoolHandle cp (THREAD, _method->constants()); ExceptionTable exhandlers(_method()); @@ -1889,6 +1901,7 @@ void ClassVerifier::verify_exception_handler_targets(u2 bci, bool this_uninit, S if (this_uninit) { flags |= FLAG_THIS_UNINIT; } StackMapFrame* new_frame = current_frame->frame_in_exception_handler(flags); if (catch_type_index != 0) { + if (was_recursively_verified()) return; // We know that this index refers to a subclass of Throwable VerificationType catch_type = cp_index_to_type( catch_type_index, cp, CHECK_VERIFY(this)); @@ -2269,6 +2282,7 @@ void ClassVerifier::verify_field_instructions(RawBytecodeStream* bcs, check_protected: { if (_this_type == stack_object_type) break; // stack_object_type must be assignable to _current_class_type + if (was_recursively_verified()) return; Symbol* ref_class_name = cp->klass_name_at(cp->klass_ref_index_at(index)); if (!name_in_supers(ref_class_name, current_class())) @@ -2531,6 +2545,7 @@ void ClassVerifier::verify_invoke_init( // Check the exception handler target stackmaps with the locals from the // incoming stackmap (before initialize_object() changes them to outgoing // state). + if (was_recursively_verified()) return; verify_exception_handler_targets(bci, true, current_frame, stackmap_table, CHECK_VERIFY(this)); } // in_try_block @@ -2548,6 +2563,7 @@ void ClassVerifier::verify_invoke_init( return; } u2 new_class_index = Bytes::get_Java_u2(new_bcp + 1); + if (was_recursively_verified()) return; verify_cp_class_type(bci, new_class_index, cp, CHECK_VERIFY(this)); // The method must be an method of the indicated class @@ -2567,6 +2583,7 @@ void ClassVerifier::verify_invoke_init( VerificationType objectref_type = new_class_type; if (name_in_supers(ref_class_type.name(), current_class())) { Klass* ref_klass = load_class(ref_class_type.name(), CHECK); + if (was_recursively_verified()) return; Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method( vmSymbols::object_initializer_name(), cp->signature_ref_at(bcs->get_index_u2()), @@ -2591,6 +2608,7 @@ void ClassVerifier::verify_invoke_init( // incoming stackmap (before initialize_object() changes them to outgoing // state). if (in_try_block) { + if (was_recursively_verified()) return; verify_exception_handler_targets(bci, *this_uninit, current_frame, stackmap_table, CHECK_VERIFY(this)); } @@ -2791,6 +2809,7 @@ void ClassVerifier::verify_invoke_instructions( verify_invoke_init(bcs, index, ref_class_type, current_frame, code_length, in_try_block, this_uninit, cp, stackmap_table, CHECK_VERIFY(this)); + if (was_recursively_verified()) return; } else { // other methods // Ensures that target class is assignable to method class. if (opcode == Bytecodes::_invokespecial) { @@ -2816,6 +2835,7 @@ void ClassVerifier::verify_invoke_instructions( VerificationType stack_object_type = current_frame->pop_stack(ref_class_type, CHECK_VERIFY(this)); if (current_type() != stack_object_type) { + if (was_recursively_verified()) return; assert(cp->cache() == NULL, "not rewritten yet"); Symbol* ref_class_name = cp->klass_name_at(cp->klass_ref_index_at(index)); @@ -2894,6 +2914,7 @@ void ClassVerifier::verify_anewarray( current_frame->pop_stack( VerificationType::integer_type(), CHECK_VERIFY(this)); + if (was_recursively_verified()) return; VerificationType component_type = cp_index_to_type(index, cp, CHECK_VERIFY(this)); int length; diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 600dfde31e4..54f12faabb1 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +48,7 @@ #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/xmlstream.hpp" +#include "logging/log.hpp" #ifdef TARGET_ARCH_x86 # include "nativeInst_x86.hpp" #endif @@ -1313,13 +1314,14 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { flush_dependencies(is_alive); // Break cycle between nmethod & method - if (TraceClassUnloading && WizardMode) { - tty->print_cr("[Class unloading: Making nmethod " INTPTR_FORMAT - " unloadable], Method*(" INTPTR_FORMAT + if (log_is_enabled(Trace, classunload)) { + outputStream* log = LogHandle(classunload)::trace_stream(); + log->print_cr("making nmethod " INTPTR_FORMAT + " unloadable, Method*(" INTPTR_FORMAT "), cause(" INTPTR_FORMAT ")", p2i(this), p2i(_method), p2i(cause)); if (!Universe::heap()->is_gc_active()) - cause->klass()->print(); + cause->klass()->print_on(log); } // Unlink the osr method, so we do not look this up again if (is_osr_method()) { diff --git a/hotspot/src/share/vm/gc/cms/cmsCollectorPolicy.cpp b/hotspot/src/share/vm/gc/cms/cmsCollectorPolicy.cpp index 6e49af09f71..0333b4f433e 100644 --- a/hotspot/src/share/vm/gc/cms/cmsCollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/cms/cmsCollectorPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ #include "gc/shared/space.hpp" #include "gc/shared/vmGCOperations.hpp" #include "memory/universe.hpp" +#include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" #include "runtime/globals_extension.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp b/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp index e85dc681e3b..165ab17e682 100644 --- a/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp +++ b/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,15 +40,9 @@ class MarkFromRootsClosure; class ParMarkFromRootsClosure; // Decode the oop and call do_oop on it. -#define DO_OOP_WORK_DEFN \ - void do_oop(oop obj); \ - template inline void do_oop_work(T* p) { \ - T heap_oop = oopDesc::load_heap_oop(p); \ - if (!oopDesc::is_null(heap_oop)) { \ - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); \ - do_oop(obj); \ - } \ - } +#define DO_OOP_WORK_DEFN \ + void do_oop(oop obj); \ + template inline void do_oop_work(T* p); // TODO: This duplication of the MetadataAwareOopClosure class is only needed // because some CMS OopClosures derive from OopsInGenClosure. It would be @@ -131,8 +125,8 @@ class PushAndMarkClosure: public MetadataAwareOopClosure { bool concurrent_precleaning); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { PushAndMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { PushAndMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); }; // In the parallel case, the bit map and the @@ -157,8 +151,8 @@ class ParPushAndMarkClosure: public MetadataAwareOopClosure { OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { ParPushAndMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); }; // The non-parallel version (the parallel version appears further below). @@ -186,8 +180,8 @@ class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { bool concurrent_precleaning); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); void set_freelistLock(Mutex* m) { _freelistLock = m; @@ -220,8 +214,8 @@ class ParMarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); void trim_queue(uint size); }; @@ -249,8 +243,8 @@ class PushOrMarkClosure: public MetadataAwareOopClosure { MarkFromRootsClosure* parent); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { PushOrMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { PushOrMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); // Deal with a stack overflow condition void handle_stack_overflow(HeapWord* lost); @@ -287,8 +281,8 @@ class ParPushOrMarkClosure: public MetadataAwareOopClosure { ParMarkFromRootsClosure* parent); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { ParPushOrMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); // Deal with a stack overflow condition void handle_stack_overflow(HeapWord* lost); @@ -318,8 +312,8 @@ class CMSKeepAliveClosure: public MetadataAwareOopClosure { bool concurrent_precleaning() const { return _concurrent_precleaning; } virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { CMSKeepAliveClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { CMSKeepAliveClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); }; class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure { @@ -336,8 +330,8 @@ class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure { OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); }; // A parallel (MT) version of the above, used when diff --git a/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp b/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp index 363097543c8..500989691e5 100644 --- a/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * 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,21 +30,6 @@ #include "gc/shared/taskqueue.inline.hpp" #include "oops/oop.inline.hpp" -// Trim our work_queue so its length is below max at return -inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) { - while (_work_queue->size() > max) { - oop newOop; - if (_work_queue->pop_local(newOop)) { - assert(newOop->is_oop(), "Expected an oop"); - assert(_bit_map->isMarked((HeapWord*)newOop), - "only grey objects on this stack"); - // iterate over the oops in this oop, marking and pushing - // the ones in CMS heap (i.e. in _span). - newOop->oop_iterate(&_parPushAndMarkClosure); - } - } -} - // MetadataAwareOopClosure and MetadataAwareOopsInGenClosure are duplicated, // until we get rid of OopsInGenClosure. @@ -61,4 +46,48 @@ inline void MetadataAwareOopsInGenClosure::do_cld_nv(ClassLoaderData* cld) { cld->oops_do(_klass_closure._oop_closure, &_klass_closure, claim); } +// Decode the oop and call do_oop on it. +#define DO_OOP_WORK_IMPL(cls) \ + template void cls::do_oop_work(T* p) { \ + T heap_oop = oopDesc::load_heap_oop(p); \ + if (!oopDesc::is_null(heap_oop)) { \ + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); \ + do_oop(obj); \ + } \ + } + +#define DO_OOP_WORK_NV_IMPL(cls) \ + DO_OOP_WORK_IMPL(cls) \ + void cls::do_oop_nv(oop* p) { cls::do_oop_work(p); } \ + void cls::do_oop_nv(narrowOop* p) { cls::do_oop_work(p); } + +DO_OOP_WORK_IMPL(MarkRefsIntoClosure) +DO_OOP_WORK_IMPL(ParMarkRefsIntoClosure) +DO_OOP_WORK_IMPL(MarkRefsIntoVerifyClosure) +DO_OOP_WORK_NV_IMPL(PushAndMarkClosure) +DO_OOP_WORK_NV_IMPL(ParPushAndMarkClosure) +DO_OOP_WORK_NV_IMPL(MarkRefsIntoAndScanClosure) +DO_OOP_WORK_NV_IMPL(ParMarkRefsIntoAndScanClosure) + +// Trim our work_queue so its length is below max at return +inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) { + while (_work_queue->size() > max) { + oop newOop; + if (_work_queue->pop_local(newOop)) { + assert(newOop->is_oop(), "Expected an oop"); + assert(_bit_map->isMarked((HeapWord*)newOop), + "only grey objects on this stack"); + // iterate over the oops in this oop, marking and pushing + // the ones in CMS heap (i.e. in _span). + newOop->oop_iterate(&_parPushAndMarkClosure); + } + } +} + +DO_OOP_WORK_NV_IMPL(PushOrMarkClosure) +DO_OOP_WORK_NV_IMPL(ParPushOrMarkClosure) +DO_OOP_WORK_NV_IMPL(CMSKeepAliveClosure) +DO_OOP_WORK_NV_IMPL(CMSInnerParMarkAndPushClosure) +DO_OOP_WORK_IMPL(CMSParKeepAliveClosure) + #endif // SHARE_VM_GC_CMS_CMSOOPCLOSURES_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 6c9a4ea4fae..ca352451e9e 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,6 +219,10 @@ void CompactibleFreeListSpace::initializeIndexedFreeListArray() { } } +size_t CompactibleFreeListSpace::obj_size(const HeapWord* addr) const { + return adjustObjectSize(oop(addr)->size()); +} + void CompactibleFreeListSpace::resetIndexedFreeListArray() { for (size_t i = 1; i < IndexSetSize; i++) { assert(_indexedFreeList[i].size() == (size_t) i, diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp index c9f9af242be..eeaa07ce280 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -313,9 +313,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { return adjustObjectSize(size); } - inline size_t obj_size(const HeapWord* addr) const { - return adjustObjectSize(oop(addr)->size()); - } + inline size_t obj_size(const HeapWord* addr) const; protected: // Reset the indexed free list to its initial empty condition. diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index f852e9d0017..d7748d47e71 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1517,6 +1517,8 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer(); gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start()); + gch->pre_full_gc_dump(gc_timer); + GCTraceTime(Trace, gc) t("CMS:MSC"); // Temporarily widen the span of the weak reference processing to @@ -1593,6 +1595,8 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { _inter_sweep_timer.reset(); _inter_sweep_timer.start(); + gch->post_full_gc_dump(gc_timer); + gc_timer->register_gc_end(); gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions()); @@ -3324,6 +3328,8 @@ class ParConcMarkingClosure: public MetadataAwareOopClosure { } }; +DO_OOP_WORK_IMPL(ParConcMarkingClosure) + // Grey object scanning during work stealing phase -- // the salient assumption here is that any references // that are in these stolen objects being scanned must diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp index 9918dd00edc..0f2f019e9d8 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 +29,7 @@ #include "gc/cms/parOopClosures.inline.hpp" #include "gc/serial/defNewGeneration.inline.hpp" #include "gc/shared/adaptiveSizePolicy.hpp" -#include "gc/shared/ageTable.hpp" +#include "gc/shared/ageTable.inline.hpp" #include "gc/shared/copyFailedInfo.hpp" #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTimer.hpp" @@ -414,7 +414,7 @@ void ParScanThreadStateSet::print_taskqueue_stats_hdr(outputStream* const st) { } void ParScanThreadStateSet::print_taskqueue_stats() { - if (!develop_log_is_enabled(Trace, gc, task, stats)) { + if (!log_develop_is_enabled(Trace, gc, task, stats)) { return; } LogHandle(gc, task, stats) log; diff --git a/hotspot/src/share/vm/gc/cms/promotionInfo.cpp b/hotspot/src/share/vm/gc/cms/promotionInfo.cpp index a7a5a3b1fd3..92c5725361f 100644 --- a/hotspot/src/share/vm/gc/cms/promotionInfo.cpp +++ b/hotspot/src/share/vm/gc/cms/promotionInfo.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +34,31 @@ ///////////////////////////////////////////////////////////////////////// +PromotedObject* PromotedObject::next() const { + assert(!((FreeChunk*)this)->is_free(), "Error"); + PromotedObject* res; + if (UseCompressedOops) { + // The next pointer is a compressed oop stored in the top 32 bits + res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next); + } else { + res = (PromotedObject*)(_next & next_mask); + } + assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res))); + return res; +} + +inline void PromotedObject::setNext(PromotedObject* x) { + assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, " + "or insufficient alignment of objects"); + if (UseCompressedOops) { + assert(_data._narrow_next == 0, "Overwrite?"); + _data._narrow_next = oopDesc::encode_heap_oop(oop(x)); + } else { + _next |= (intptr_t)x; + } + assert(!((FreeChunk*)this)->is_free(), "Error"); +} + ////////////////////////////////////////////////////////////////////////////// // We go over the list of promoted objects, removing each from the list, // and applying the closure (this may, in turn, add more elements to diff --git a/hotspot/src/share/vm/gc/cms/promotionInfo.hpp b/hotspot/src/share/vm/gc/cms/promotionInfo.hpp index d42a8dbd119..387da17ed95 100644 --- a/hotspot/src/share/vm/gc/cms/promotionInfo.hpp +++ b/hotspot/src/share/vm/gc/cms/promotionInfo.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * 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,29 +64,8 @@ class PromotedObject VALUE_OBJ_CLASS_SPEC { Data _data; }; public: - inline PromotedObject* next() const { - assert(!((FreeChunk*)this)->is_free(), "Error"); - PromotedObject* res; - if (UseCompressedOops) { - // The next pointer is a compressed oop stored in the top 32 bits - res = (PromotedObject*)oopDesc::decode_heap_oop(_data._narrow_next); - } else { - res = (PromotedObject*)(_next & next_mask); - } - assert(oop(res)->is_oop_or_null(true /* ignore mark word */), "Expected an oop or NULL at " PTR_FORMAT, p2i(oop(res))); - return res; - } - inline void setNext(PromotedObject* x) { - assert(((intptr_t)x & ~next_mask) == 0, "Conflict in bit usage, " - "or insufficient alignment of objects"); - if (UseCompressedOops) { - assert(_data._narrow_next == 0, "Overwrite?"); - _data._narrow_next = oopDesc::encode_heap_oop(oop(x)); - } else { - _next |= (intptr_t)x; - } - assert(!((FreeChunk*)this)->is_free(), "Error"); - } + PromotedObject* next() const; + void setNext(PromotedObject* x); inline void setPromotedMark() { _next |= promoted_mask; assert(!((FreeChunk*)this)->is_free(), "Error"); diff --git a/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp index aabf6790d80..dc1b5ea1352 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,10 +59,10 @@ ConcurrentG1RefineThread(ConcurrentG1Refine* cg1r, ConcurrentG1RefineThread *nex _monitor = DirtyCardQ_CBL_mon; } initialize(); - create_and_start(); // set name set_name("G1 Refine#%d", worker_id); + create_and_start(); } void ConcurrentG1RefineThread::initialize() { diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp index 56753b35673..c41e5befda3 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ SurrogateLockerThread* ConcurrentMarkThread::_slt = NULL; -ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) : +ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) : ConcurrentGCThread(), _cm(cm), _state(Idle), @@ -56,10 +56,10 @@ ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) : class CMCheckpointRootsFinalClosure: public VoidClosure { - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; public: - CMCheckpointRootsFinalClosure(ConcurrentMark* cm) : + CMCheckpointRootsFinalClosure(G1ConcurrentMark* cm) : _cm(cm) {} void do_void(){ @@ -68,10 +68,10 @@ public: }; class CMCleanUp: public VoidClosure { - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; public: - CMCleanUp(ConcurrentMark* cm) : + CMCleanUp(G1ConcurrentMark* cm) : _cm(cm) {} void do_void(){ @@ -92,10 +92,10 @@ void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool } class GCConcPhaseTimer : StackObj { - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; public: - GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) { + GCConcPhaseTimer(G1ConcurrentMark* cm, const char* title) : _cm(cm) { _cm->register_concurrent_phase_start(title); } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp index 2dd170916da..c75280b8eb3 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,10 @@ #include "gc/shared/concurrentGCThread.hpp" -// The Concurrent Mark GC Thread triggers the parallel CMConcurrentMarkingTasks +// The Concurrent Mark GC Thread triggers the parallel G1CMConcurrentMarkingTasks // as well as handling various marking cleanup. -class ConcurrentMark; +class G1ConcurrentMark; class G1CollectorPolicy; class ConcurrentMarkThread: public ConcurrentGCThread { @@ -45,7 +45,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread { virtual void run(); private: - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; enum State { Idle, @@ -65,7 +65,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread { public: // Constructor - ConcurrentMarkThread(ConcurrentMark* cm); + ConcurrentMarkThread(G1ConcurrentMark* cm); static void makeSurrogateLockerThread(TRAPS); static SurrogateLockerThread* slt() { return _slt; } @@ -75,7 +75,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread { // Marking virtual time so far this thread and concurrent marking tasks. double vtime_mark_accum(); - ConcurrentMark* cm() { return _cm; } + G1ConcurrentMark* cm() { return _cm; } void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; } bool idle() { return _state == Idle; } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp index e31475fedd6..bee071b819f 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.inline.hpp @@ -25,8 +25,8 @@ #ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP #define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP -#include "gc/g1/concurrentMark.hpp" #include "gc/g1/concurrentMarkThread.hpp" +#include "gc/g1/g1ConcurrentMark.hpp" // Total virtual time so far. inline double ConcurrentMarkThread::vtime_accum() { diff --git a/hotspot/src/share/vm/gc/g1/g1Allocator.cpp b/hotspot/src/share/vm/gc/g1/g1Allocator.cpp index d0a92be5ff7..ad5aa0c556c 100644 --- a/hotspot/src/share/vm/gc/g1/g1Allocator.cpp +++ b/hotspot/src/share/vm/gc/g1/g1Allocator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -438,7 +438,7 @@ void G1ArchiveAllocator::complete_archive(GrowableArray* ranges, // If an end alignment was requested, insert filler objects. if (end_alignment_in_bytes != 0) { HeapWord* currtop = _allocation_region->top(); - HeapWord* newtop = (HeapWord*)align_pointer_up(currtop, end_alignment_in_bytes); + HeapWord* newtop = (HeapWord*)align_ptr_up(currtop, end_alignment_in_bytes); size_t fill_size = pointer_delta(newtop, currtop); if (fill_size != 0) { if (fill_size < CollectedHeap::min_fill_size()) { @@ -447,8 +447,8 @@ void G1ArchiveAllocator::complete_archive(GrowableArray* ranges, // region boundary because the max supported alignment is smaller than the min // region size, and because the allocation code never leaves space smaller than // the min_fill_size at the top of the current allocation region. - newtop = (HeapWord*)align_pointer_up(currtop + CollectedHeap::min_fill_size(), - end_alignment_in_bytes); + newtop = (HeapWord*)align_ptr_up(currtop + CollectedHeap::min_fill_size(), + end_alignment_in_bytes); fill_size = pointer_delta(newtop, currtop); } HeapWord* fill = archive_mem_allocate(fill_size); diff --git a/hotspot/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp b/hotspot/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp index 4180191ea0d..afbe72c8c6a 100644 --- a/hotspot/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CodeCacheRemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,10 +74,16 @@ class CodeRootSetTable : public Hashtable { static size_t static_mem_size() { return sizeof(_purge_list); } + + size_t mem_size(); }; CodeRootSetTable* volatile CodeRootSetTable::_purge_list = NULL; +size_t CodeRootSetTable::mem_size() { + return sizeof(CodeRootSetTable) + (entry_size() * number_of_entries()) + (sizeof(HashtableBucket) * table_size()); +} + CodeRootSetTable::Entry* CodeRootSetTable::new_entry(nmethod* nm) { unsigned int hash = compute_hash(nm); Entry* entry = (Entry*) new_entry_free_list(); @@ -232,7 +238,6 @@ void G1CodeRootSet::move_to_large() { OrderAccess::release_store_ptr(&_table, temp); } - void G1CodeRootSet::purge() { CodeRootSetTable::purge(); } @@ -247,12 +252,13 @@ void G1CodeRootSet::add(nmethod* method) { allocate_small_table(); } added = _table->add(method); - if (_length == Threshold) { - move_to_large(); - } if (added) { + if (_length == Threshold) { + move_to_large(); + } ++_length; } + assert(_length == (size_t)_table->number_of_entries(), "sizes should match"); } bool G1CodeRootSet::remove(nmethod* method) { @@ -266,11 +272,13 @@ bool G1CodeRootSet::remove(nmethod* method) { clear(); } } + assert((_length == 0 && _table == NULL) || + (_length == (size_t)_table->number_of_entries()), "sizes should match"); return removed; } bool G1CodeRootSet::contains(nmethod* method) { - CodeRootSetTable* table = load_acquire_table(); + CodeRootSetTable* table = load_acquire_table(); // contains() may be called outside of lock, so ensure mem sync. if (table != NULL) { return table->contains(method); } @@ -284,8 +292,7 @@ void G1CodeRootSet::clear() { } size_t G1CodeRootSet::mem_size() { - return sizeof(*this) + - (_table != NULL ? sizeof(CodeRootSetTable) + _table->entry_size() * _length : 0); + return sizeof(*this) + (_table != NULL ? _table->mem_size() : 0); } void G1CodeRootSet::nmethods_do(CodeBlobClosure* blk) const { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index e2ecfaa24f5..d447e3e2c53 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +38,8 @@ #include "gc/g1/g1CollectorState.hpp" #include "gc/g1/g1EvacStats.inline.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" +#include "gc/g1/g1HeapTransition.hpp" +#include "gc/g1/g1HeapVerifier.hpp" #include "gc/g1/g1MarkSweep.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1ParScanThreadState.inline.hpp" @@ -60,7 +62,7 @@ #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/generationSpec.hpp" #include "gc/shared/isGCActiveMark.hpp" -#include "gc/shared/referenceProcessor.hpp" +#include "gc/shared/referenceProcessor.inline.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" @@ -399,7 +401,7 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first, assert(hr->bottom() < obj_top && obj_top <= hr->end(), "obj_top should be in last region"); - check_bitmaps("Humongous Region Allocation", first_hr); + _verifier->check_bitmaps("Humongous Region Allocation", first_hr); assert(words_not_fillable == 0 || first_hr->bottom() + word_size_sum - words_not_fillable == hr->top(), @@ -427,7 +429,7 @@ size_t G1CollectedHeap::humongous_obj_size_in_regions(size_t word_size) { HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size, AllocationContext_t context) { assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); uint first = G1_NO_HRM_INDEX; uint obj_regions = (uint) humongous_obj_size_in_regions(word_size); @@ -501,7 +503,7 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size, AllocationCo g1mm()->update_sizes(); } - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); return result; } @@ -1230,7 +1232,7 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, size_t metadata_prev_used = MetaspaceAux::used_bytes(); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); const bool do_clear_all_soft_refs = clear_all_soft_refs || collector_policy()->should_clear_all_soft_refs(); @@ -1249,6 +1251,7 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, TraceCollectorStats tcs(g1mm()->full_collection_counters()); TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); + G1HeapTransition heap_transition(this); g1_policy()->record_full_collection_start(); // Note: When we have a more flexible GC logging framework that @@ -1271,9 +1274,9 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, assert(used() == recalculate_used(), "Should be equal"); - verify_before_gc(); + _verifier->verify_before_gc(); - check_bitmaps("Full GC Start"); + _verifier->check_bitmaps("Full GC Start"); pre_full_gc_dump(gc_timer); #if defined(COMPILER2) || INCLUDE_JVMCI @@ -1408,21 +1411,21 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, increment_old_marking_cycles_completed(false /* concurrent */); _hrm.verify_optional(); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); - verify_after_gc(); + _verifier->verify_after_gc(); // Clear the previous marking bitmap, if needed for bitmap verification. // Note we cannot do this when we clear the next marking bitmap in - // ConcurrentMark::abort() above since VerifyDuringGC verifies the + // G1ConcurrentMark::abort() above since VerifyDuringGC verifies the // objects marked during a full GC against the previous bitmap. // But we need to clear it before calling check_bitmaps below since // the full GC has compacted objects and updated TAMS but not updated // the prev bitmap. if (G1VerifyBitmaps) { - ((CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll(); + ((G1CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll(); } - check_bitmaps("Full GC End"); + _verifier->check_bitmaps("Full GC End"); // Start a new incremental collection set for the next pause assert(g1_policy()->collection_set() == NULL, "must be"); @@ -1441,15 +1444,15 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, g1mm()->update_sizes(); gc_epilogue(true); + + heap_transition.print(); + + print_heap_after_gc(); + trace_heap_after_gc(gc_tracer); + + post_full_gc_dump(gc_timer); } - g1_policy()->print_detailed_heap_transition(); - - print_heap_after_gc(); - trace_heap_after_gc(gc_tracer); - - post_full_gc_dump(gc_timer); - gc_timer->register_gc_end(); gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions()); } @@ -1639,7 +1642,7 @@ HeapWord* G1CollectedHeap::satisfy_failed_allocation(size_t word_size, HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size, AllocationContext_t context) { assert_at_safepoint(true /* should_be_vm_thread */); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); log_debug(gc, ergo, heap)("Attempt heap expansion (allocation request failed). Allocation request: " SIZE_FORMAT "B", @@ -1648,7 +1651,7 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size, AllocationConte if (expand(expand_bytes)) { _hrm.verify_optional(); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); return attempt_allocation_at_safepoint(word_size, context, false /* expect_null_mutator_alloc_region */); @@ -1717,7 +1720,7 @@ void G1CollectedHeap::shrink_helper(size_t shrink_bytes) { } void G1CollectedHeap::shrink(size_t shrink_bytes) { - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); // We should only reach here at the end of a Full GC which means we // should not not be holding to any GC alloc regions. The method @@ -1732,7 +1735,7 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) { rebuild_region_sets(true /* free_list_only */); _hrm.verify_optional(); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); } // Public methods. @@ -1778,6 +1781,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : /* are_GC_task_threads */true, /* are_ConcurrentGC_threads */false); _workers->initialize_workers(); + _verifier = new G1HeapVerifier(this); _allocator = G1Allocator::create_allocator(this); _humongous_object_threshold_in_words = humongous_threshold_for(HeapRegion::GrainWords); @@ -1920,11 +1924,11 @@ jint G1CollectedHeap::initialize() { G1CardCounts::compute_size(g1_rs.size() / HeapWordSize), G1CardCounts::heap_map_factor()); - size_t bitmap_size = CMBitMap::compute_size(g1_rs.size()); + size_t bitmap_size = G1CMBitMap::compute_size(g1_rs.size()); G1RegionToSpaceMapper* prev_bitmap_storage = - create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::heap_map_factor()); + create_aux_memory_mapper("Prev Bitmap", bitmap_size, G1CMBitMap::heap_map_factor()); G1RegionToSpaceMapper* next_bitmap_storage = - create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::heap_map_factor()); + create_aux_memory_mapper("Next Bitmap", bitmap_size, G1CMBitMap::heap_map_factor()); _hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage); g1_barrier_set()->initialize(cardtable_storage); @@ -1956,11 +1960,11 @@ jint G1CollectedHeap::initialize() { _humongous_reclaim_candidates.initialize(start, end, granularity); } - // Create the ConcurrentMark data structure and thread. + // Create the G1ConcurrentMark data structure and thread. // (Must do this late, so that "max_regions" is defined.) - _cm = new ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage); + _cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage); if (_cm == NULL || !_cm->completed_initialization()) { - vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark"); + vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark"); return JNI_ENOMEM; } _cmThread = _cm->cmThread(); @@ -2667,452 +2671,11 @@ jlong G1CollectedHeap::millis_since_last_gc() { } void G1CollectedHeap::prepare_for_verify() { - if (SafepointSynchronize::is_at_safepoint() || ! UseTLAB) { - ensure_parsability(false); - } - g1_rem_set()->prepare_for_verify(); + _verifier->prepare_for_verify(); } -bool G1CollectedHeap::allocated_since_marking(oop obj, HeapRegion* hr, - VerifyOption vo) { - switch (vo) { - case VerifyOption_G1UsePrevMarking: - return hr->obj_allocated_since_prev_marking(obj); - case VerifyOption_G1UseNextMarking: - return hr->obj_allocated_since_next_marking(obj); - case VerifyOption_G1UseMarkWord: - return false; - default: - ShouldNotReachHere(); - } - return false; // keep some compilers happy -} - -HeapWord* G1CollectedHeap::top_at_mark_start(HeapRegion* hr, VerifyOption vo) { - switch (vo) { - case VerifyOption_G1UsePrevMarking: return hr->prev_top_at_mark_start(); - case VerifyOption_G1UseNextMarking: return hr->next_top_at_mark_start(); - case VerifyOption_G1UseMarkWord: return NULL; - default: ShouldNotReachHere(); - } - return NULL; // keep some compilers happy -} - -bool G1CollectedHeap::is_marked(oop obj, VerifyOption vo) { - switch (vo) { - case VerifyOption_G1UsePrevMarking: return isMarkedPrev(obj); - case VerifyOption_G1UseNextMarking: return isMarkedNext(obj); - case VerifyOption_G1UseMarkWord: return obj->is_gc_marked(); - default: ShouldNotReachHere(); - } - return false; // keep some compilers happy -} - -const char* G1CollectedHeap::top_at_mark_start_str(VerifyOption vo) { - switch (vo) { - case VerifyOption_G1UsePrevMarking: return "PTAMS"; - case VerifyOption_G1UseNextMarking: return "NTAMS"; - case VerifyOption_G1UseMarkWord: return "NONE"; - default: ShouldNotReachHere(); - } - return NULL; // keep some compilers happy -} - -class VerifyRootsClosure: public OopClosure { -private: - G1CollectedHeap* _g1h; - VerifyOption _vo; - bool _failures; -public: - // _vo == UsePrevMarking -> use "prev" marking information, - // _vo == UseNextMarking -> use "next" marking information, - // _vo == UseMarkWord -> use mark word from object header. - VerifyRootsClosure(VerifyOption vo) : - _g1h(G1CollectedHeap::heap()), - _vo(vo), - _failures(false) { } - - bool failures() { return _failures; } - - template void do_oop_nv(T* p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - if (_g1h->is_obj_dead_cond(obj, _vo)) { - LogHandle(gc, verify) log; - log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); - if (_vo == VerifyOption_G1UseMarkWord) { - log.info(" Mark word: " PTR_FORMAT, p2i(obj->mark())); - } - ResourceMark rm; - obj->print_on(log.info_stream()); - _failures = true; - } - } - } - - void do_oop(oop* p) { do_oop_nv(p); } - void do_oop(narrowOop* p) { do_oop_nv(p); } -}; - -class G1VerifyCodeRootOopClosure: public OopClosure { - G1CollectedHeap* _g1h; - OopClosure* _root_cl; - nmethod* _nm; - VerifyOption _vo; - bool _failures; - - template void do_oop_work(T* p) { - // First verify that this root is live - _root_cl->do_oop(p); - - if (!G1VerifyHeapRegionCodeRoots) { - // We're not verifying the code roots attached to heap region. - return; - } - - // Don't check the code roots during marking verification in a full GC - if (_vo == VerifyOption_G1UseMarkWord) { - return; - } - - // Now verify that the current nmethod (which contains p) is - // in the code root list of the heap region containing the - // object referenced by p. - - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - - // Now fetch the region containing the object - HeapRegion* hr = _g1h->heap_region_containing(obj); - HeapRegionRemSet* hrrs = hr->rem_set(); - // Verify that the strong code root list for this region - // contains the nmethod - if (!hrrs->strong_code_roots_list_contains(_nm)) { - log_info(gc, verify)("Code root location " PTR_FORMAT " " - "from nmethod " PTR_FORMAT " not in strong " - "code roots for region [" PTR_FORMAT "," PTR_FORMAT ")", - p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); - _failures = true; - } - } - } - -public: - G1VerifyCodeRootOopClosure(G1CollectedHeap* g1h, OopClosure* root_cl, VerifyOption vo): - _g1h(g1h), _root_cl(root_cl), _vo(vo), _nm(NULL), _failures(false) {} - - void do_oop(oop* p) { do_oop_work(p); } - void do_oop(narrowOop* p) { do_oop_work(p); } - - void set_nmethod(nmethod* nm) { _nm = nm; } - bool failures() { return _failures; } -}; - -class G1VerifyCodeRootBlobClosure: public CodeBlobClosure { - G1VerifyCodeRootOopClosure* _oop_cl; - -public: - G1VerifyCodeRootBlobClosure(G1VerifyCodeRootOopClosure* oop_cl): - _oop_cl(oop_cl) {} - - void do_code_blob(CodeBlob* cb) { - nmethod* nm = cb->as_nmethod_or_null(); - if (nm != NULL) { - _oop_cl->set_nmethod(nm); - nm->oops_do(_oop_cl); - } - } -}; - -class YoungRefCounterClosure : public OopClosure { - G1CollectedHeap* _g1h; - int _count; - public: - YoungRefCounterClosure(G1CollectedHeap* g1h) : _g1h(g1h), _count(0) {} - void do_oop(oop* p) { if (_g1h->is_in_young(*p)) { _count++; } } - void do_oop(narrowOop* p) { ShouldNotReachHere(); } - - int count() { return _count; } - void reset_count() { _count = 0; }; -}; - -class VerifyKlassClosure: public KlassClosure { - YoungRefCounterClosure _young_ref_counter_closure; - OopClosure *_oop_closure; - public: - VerifyKlassClosure(G1CollectedHeap* g1h, OopClosure* cl) : _young_ref_counter_closure(g1h), _oop_closure(cl) {} - void do_klass(Klass* k) { - k->oops_do(_oop_closure); - - _young_ref_counter_closure.reset_count(); - k->oops_do(&_young_ref_counter_closure); - if (_young_ref_counter_closure.count() > 0) { - guarantee(k->has_modified_oops(), "Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k)); - } - } -}; - -class VerifyLivenessOopClosure: public OopClosure { - G1CollectedHeap* _g1h; - VerifyOption _vo; -public: - VerifyLivenessOopClosure(G1CollectedHeap* g1h, VerifyOption vo): - _g1h(g1h), _vo(vo) - { } - void do_oop(narrowOop *p) { do_oop_work(p); } - void do_oop( oop *p) { do_oop_work(p); } - - template void do_oop_work(T *p) { - oop obj = oopDesc::load_decode_heap_oop(p); - guarantee(obj == NULL || !_g1h->is_obj_dead_cond(obj, _vo), - "Dead object referenced by a not dead object"); - } -}; - -class VerifyObjsInRegionClosure: public ObjectClosure { -private: - G1CollectedHeap* _g1h; - size_t _live_bytes; - HeapRegion *_hr; - VerifyOption _vo; -public: - // _vo == UsePrevMarking -> use "prev" marking information, - // _vo == UseNextMarking -> use "next" marking information, - // _vo == UseMarkWord -> use mark word from object header. - VerifyObjsInRegionClosure(HeapRegion *hr, VerifyOption vo) - : _live_bytes(0), _hr(hr), _vo(vo) { - _g1h = G1CollectedHeap::heap(); - } - void do_object(oop o) { - VerifyLivenessOopClosure isLive(_g1h, _vo); - assert(o != NULL, "Huh?"); - if (!_g1h->is_obj_dead_cond(o, _vo)) { - // If the object is alive according to the mark word, - // then verify that the marking information agrees. - // Note we can't verify the contra-positive of the - // above: if the object is dead (according to the mark - // word), it may not be marked, or may have been marked - // but has since became dead, or may have been allocated - // since the last marking. - if (_vo == VerifyOption_G1UseMarkWord) { - guarantee(!_g1h->is_obj_dead(o), "mark word and concurrent mark mismatch"); - } - - o->oop_iterate_no_header(&isLive); - if (!_hr->obj_allocated_since_prev_marking(o)) { - size_t obj_size = o->size(); // Make sure we don't overflow - _live_bytes += (obj_size * HeapWordSize); - } - } - } - size_t live_bytes() { return _live_bytes; } -}; - -class VerifyArchiveOopClosure: public OopClosure { -public: - VerifyArchiveOopClosure(HeapRegion *hr) { } - void do_oop(narrowOop *p) { do_oop_work(p); } - void do_oop( oop *p) { do_oop_work(p); } - - template void do_oop_work(T *p) { - oop obj = oopDesc::load_decode_heap_oop(p); - guarantee(obj == NULL || G1MarkSweep::in_archive_range(obj), - "Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT, - p2i(p), p2i(obj)); - } -}; - -class VerifyArchiveRegionClosure: public ObjectClosure { -public: - VerifyArchiveRegionClosure(HeapRegion *hr) { } - // Verify that all object pointers are to archive regions. - void do_object(oop o) { - VerifyArchiveOopClosure checkOop(NULL); - assert(o != NULL, "Should not be here for NULL oops"); - o->oop_iterate_no_header(&checkOop); - } -}; - -class VerifyRegionClosure: public HeapRegionClosure { -private: - bool _par; - VerifyOption _vo; - bool _failures; -public: - // _vo == UsePrevMarking -> use "prev" marking information, - // _vo == UseNextMarking -> use "next" marking information, - // _vo == UseMarkWord -> use mark word from object header. - VerifyRegionClosure(bool par, VerifyOption vo) - : _par(par), - _vo(vo), - _failures(false) {} - - bool failures() { - return _failures; - } - - bool doHeapRegion(HeapRegion* r) { - // For archive regions, verify there are no heap pointers to - // non-pinned regions. For all others, verify liveness info. - if (r->is_archive()) { - VerifyArchiveRegionClosure verify_oop_pointers(r); - r->object_iterate(&verify_oop_pointers); - return true; - } - if (!r->is_continues_humongous()) { - bool failures = false; - r->verify(_vo, &failures); - if (failures) { - _failures = true; - } else if (!r->is_starts_humongous()) { - VerifyObjsInRegionClosure not_dead_yet_cl(r, _vo); - r->object_iterate(¬_dead_yet_cl); - if (_vo != VerifyOption_G1UseNextMarking) { - if (r->max_live_bytes() < not_dead_yet_cl.live_bytes()) { - log_info(gc, verify)("[" PTR_FORMAT "," PTR_FORMAT "] max_live_bytes " SIZE_FORMAT " < calculated " SIZE_FORMAT, - p2i(r->bottom()), p2i(r->end()), r->max_live_bytes(), not_dead_yet_cl.live_bytes()); - _failures = true; - } - } else { - // When vo == UseNextMarking we cannot currently do a sanity - // check on the live bytes as the calculation has not been - // finalized yet. - } - } - } - return false; // stop the region iteration if we hit a failure - } -}; - -// This is the task used for parallel verification of the heap regions - -class G1ParVerifyTask: public AbstractGangTask { -private: - G1CollectedHeap* _g1h; - VerifyOption _vo; - bool _failures; - HeapRegionClaimer _hrclaimer; - -public: - // _vo == UsePrevMarking -> use "prev" marking information, - // _vo == UseNextMarking -> use "next" marking information, - // _vo == UseMarkWord -> use mark word from object header. - G1ParVerifyTask(G1CollectedHeap* g1h, VerifyOption vo) : - AbstractGangTask("Parallel verify task"), - _g1h(g1h), - _vo(vo), - _failures(false), - _hrclaimer(g1h->workers()->active_workers()) {} - - bool failures() { - return _failures; - } - - void work(uint worker_id) { - HandleMark hm; - VerifyRegionClosure blk(true, _vo); - _g1h->heap_region_par_iterate(&blk, worker_id, &_hrclaimer); - if (blk.failures()) { - _failures = true; - } - } -}; - void G1CollectedHeap::verify(VerifyOption vo) { - if (!SafepointSynchronize::is_at_safepoint()) { - log_info(gc, verify)("Skipping verification. Not at safepoint."); - } - - assert(Thread::current()->is_VM_thread(), - "Expected to be executed serially by the VM thread at this point"); - - log_debug(gc, verify)("Roots"); - VerifyRootsClosure rootsCl(vo); - VerifyKlassClosure klassCl(this, &rootsCl); - CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false); - - // We apply the relevant closures to all the oops in the - // system dictionary, class loader data graph, the string table - // and the nmethods in the code cache. - G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); - G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); - - { - G1RootProcessor root_processor(this, 1); - root_processor.process_all_roots(&rootsCl, - &cldCl, - &blobsCl); - } - - bool failures = rootsCl.failures() || codeRootsCl.failures(); - - if (vo != VerifyOption_G1UseMarkWord) { - // If we're verifying during a full GC then the region sets - // will have been torn down at the start of the GC. Therefore - // verifying the region sets will fail. So we only verify - // the region sets when not in a full GC. - log_debug(gc, verify)("HeapRegionSets"); - verify_region_sets(); - } - - log_debug(gc, verify)("HeapRegions"); - if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { - - G1ParVerifyTask task(this, vo); - workers()->run_task(&task); - if (task.failures()) { - failures = true; - } - - } else { - VerifyRegionClosure blk(false, vo); - heap_region_iterate(&blk); - if (blk.failures()) { - failures = true; - } - } - - if (G1StringDedup::is_enabled()) { - log_debug(gc, verify)("StrDedup"); - G1StringDedup::verify(); - } - - if (failures) { - log_info(gc, verify)("Heap after failed verification:"); - // It helps to have the per-region information in the output to - // help us track down what went wrong. This is why we call - // print_extended_on() instead of print_on(). - LogHandle(gc, verify) log; - ResourceMark rm; - print_extended_on(log.info_stream()); - } - guarantee(!failures, "there should not have been any failures"); -} - -double G1CollectedHeap::verify(bool guard, const char* msg) { - double verify_time_ms = 0.0; - - if (guard && total_collections() >= VerifyGCStartAt) { - double verify_start = os::elapsedTime(); - HandleMark hm; // Discard invalid handles created during verification - prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, msg); - verify_time_ms = (os::elapsedTime() - verify_start) * 1000; - } - - return verify_time_ms; -} - -void G1CollectedHeap::verify_before_gc() { - double verify_time_ms = verify(VerifyBeforeGC, "Before GC"); - g1_policy()->phase_times()->record_verify_before_time_ms(verify_time_ms); -} - -void G1CollectedHeap::verify_after_gc() { - double verify_time_ms = verify(VerifyAfterGC, "After GC"); - g1_policy()->phase_times()->record_verify_after_time_ms(verify_time_ms); + _verifier->verify(vo); } class PrintRegionClosure: public HeapRegionClosure { @@ -3580,7 +3143,7 @@ void G1CollectedHeap::print_taskqueue_stats_hdr(outputStream* const st) { } void G1CollectedHeap::print_taskqueue_stats() const { - if (!develop_log_is_enabled(Trace, gc, task, stats)) { + if (!log_develop_is_enabled(Trace, gc, task, stats)) { return; } LogHandle(gc, task, stats) log; @@ -3608,18 +3171,6 @@ void G1CollectedHeap::reset_taskqueue_stats() { } #endif // TASKQUEUE_STATS -void G1CollectedHeap::log_gc_footer(jlong pause_time_counter) { - if (evacuation_failed()) { - log_info(gc)("To-space exhausted"); - } - - double pause_time_ms = TimeHelper::counter_to_millis(pause_time_counter); - g1_policy()->print_phases(pause_time_ms); - - g1_policy()->print_detailed_heap_transition(); -} - - void G1CollectedHeap::wait_for_root_region_scanning() { double scan_wait_start = os::elapsedTime(); // We have to wait until the CM threads finish scanning the @@ -3657,8 +3208,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { print_heap_before_gc(); trace_heap_before_gc(_gc_tracer_stw); - verify_region_sets_optional(); - verify_dirty_young_regions(); + _verifier->verify_region_sets_optional(); + _verifier->verify_dirty_young_regions(); // This call will decide whether this pause is an initial-mark // pause. If it is, during_initial_mark_pause() will return true @@ -3706,7 +3257,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { } GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true); - jlong pause_start_counter = os::elapsed_counter(); g1_policy()->note_gc_start(active_workers); TraceCollectorStats tcs(g1mm()->incremental_collection_counters()); @@ -3722,6 +3272,9 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { append_secondary_free_list_if_not_empty_with_lock(); } + G1HeapTransition heap_transition(this); + size_t heap_used_bytes_before_gc = used(); + assert(check_young_list_well_formed(), "young list should be well formed"); // Don't dynamically change the number of GC threads this early. A value of @@ -3741,9 +3294,9 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { heap_region_iterate(&v_cl); } - verify_before_gc(); + _verifier->verify_before_gc(); - check_bitmaps("GC Start"); + _verifier->check_bitmaps("GC Start"); #if defined(COMPILER2) || INCLUDE_JVMCI DerivedPointerTable::clear(); @@ -3801,7 +3354,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { register_humongous_regions_with_cset(); - assert(check_cset_fast_test(), "Inconsistency in the InCSetState table."); + assert(_verifier->check_cset_fast_test(), "Inconsistency in the InCSetState table."); _cm->note_start_of_gc(); // We call this after finalize_cset() to @@ -3915,7 +3468,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { double sample_end_time_sec = os::elapsedTime(); double pause_time_ms = (sample_end_time_sec - sample_start_time_sec) * MILLIUNITS; size_t total_cards_scanned = per_thread_states.total_cards_scanned(); - g1_policy()->record_collection_pause_end(pause_time_ms, total_cards_scanned); + g1_policy()->record_collection_pause_end(pause_time_ms, total_cards_scanned, heap_used_bytes_before_gc); evacuation_info.set_collectionset_used_before(g1_policy()->collection_set_bytes_used_before()); evacuation_info.set_bytes_copied(g1_policy()->bytes_copied_during_gc()); @@ -3951,8 +3504,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { heap_region_iterate(&v_cl); } - verify_after_gc(); - check_bitmaps("GC End"); + _verifier->verify_after_gc(); + _verifier->check_bitmaps("GC End"); assert(!ref_processor_stw()->discovery_enabled(), "Postcondition"); ref_processor_stw()->verify_no_references_recorded(); @@ -3968,7 +3521,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { } // Print the remainder of the GC log output. - log_gc_footer(os::elapsed_counter() - pause_start_counter); + if (evacuation_failed()) { + log_info(gc)("To-space exhausted"); + } + + g1_policy()->print_phases(); + heap_transition.print(); // It is not yet to safe to tell the concurrent mark to // start as we have some optional output below. We don't want the @@ -3976,7 +3534,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // logging output either. _hrm.verify_optional(); - verify_region_sets_optional(); + _verifier->verify_region_sets_optional(); TASKQUEUE_STATS_ONLY(print_taskqueue_stats()); TASKQUEUE_STATS_ONLY(reset_taskqueue_stats()); @@ -5245,197 +4803,6 @@ public: } }; -#ifndef PRODUCT -class G1VerifyCardTableCleanup: public HeapRegionClosure { - G1CollectedHeap* _g1h; - G1SATBCardTableModRefBS* _ct_bs; -public: - G1VerifyCardTableCleanup(G1CollectedHeap* g1h, G1SATBCardTableModRefBS* ct_bs) - : _g1h(g1h), _ct_bs(ct_bs) { } - virtual bool doHeapRegion(HeapRegion* r) { - if (r->is_survivor()) { - _g1h->verify_dirty_region(r); - } else { - _g1h->verify_not_dirty_region(r); - } - return false; - } -}; - -void G1CollectedHeap::verify_not_dirty_region(HeapRegion* hr) { - // All of the region should be clean. - G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); - MemRegion mr(hr->bottom(), hr->end()); - ct_bs->verify_not_dirty_region(mr); -} - -void G1CollectedHeap::verify_dirty_region(HeapRegion* hr) { - // We cannot guarantee that [bottom(),end()] is dirty. Threads - // dirty allocated blocks as they allocate them. The thread that - // retires each region and replaces it with a new one will do a - // maximal allocation to fill in [pre_dummy_top(),end()] but will - // not dirty that area (one less thing to have to do while holding - // a lock). So we can only verify that [bottom(),pre_dummy_top()] - // is dirty. - G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); - MemRegion mr(hr->bottom(), hr->pre_dummy_top()); - if (hr->is_young()) { - ct_bs->verify_g1_young_region(mr); - } else { - ct_bs->verify_dirty_region(mr); - } -} - -void G1CollectedHeap::verify_dirty_young_list(HeapRegion* head) { - G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); - for (HeapRegion* hr = head; hr != NULL; hr = hr->get_next_young_region()) { - verify_dirty_region(hr); - } -} - -void G1CollectedHeap::verify_dirty_young_regions() { - verify_dirty_young_list(_young_list->first_region()); -} - -bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap, - HeapWord* tams, HeapWord* end) { - guarantee(tams <= end, - "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end)); - HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); - if (result < end) { - log_info(gc, verify)("## wrong marked address on %s bitmap: " PTR_FORMAT, bitmap_name, p2i(result)); - log_info(gc, verify)("## %s tams: " PTR_FORMAT " end: " PTR_FORMAT, bitmap_name, p2i(tams), p2i(end)); - return false; - } - return true; -} - -bool G1CollectedHeap::verify_bitmaps(const char* caller, HeapRegion* hr) { - CMBitMapRO* prev_bitmap = concurrent_mark()->prevMarkBitMap(); - CMBitMapRO* next_bitmap = (CMBitMapRO*) concurrent_mark()->nextMarkBitMap(); - - HeapWord* bottom = hr->bottom(); - HeapWord* ptams = hr->prev_top_at_mark_start(); - HeapWord* ntams = hr->next_top_at_mark_start(); - HeapWord* end = hr->end(); - - bool res_p = verify_no_bits_over_tams("prev", prev_bitmap, ptams, end); - - bool res_n = true; - // We reset mark_in_progress() before we reset _cmThread->in_progress() and in this window - // we do the clearing of the next bitmap concurrently. Thus, we can not verify the bitmap - // if we happen to be in that state. - if (collector_state()->mark_in_progress() || !_cmThread->in_progress()) { - res_n = verify_no_bits_over_tams("next", next_bitmap, ntams, end); - } - if (!res_p || !res_n) { - log_info(gc, verify)("#### Bitmap verification failed for " HR_FORMAT, HR_FORMAT_PARAMS(hr)); - log_info(gc, verify)("#### Caller: %s", caller); - return false; - } - return true; -} - -void G1CollectedHeap::check_bitmaps(const char* caller, HeapRegion* hr) { - if (!G1VerifyBitmaps) return; - - guarantee(verify_bitmaps(caller, hr), "bitmap verification"); -} - -class G1VerifyBitmapClosure : public HeapRegionClosure { -private: - const char* _caller; - G1CollectedHeap* _g1h; - bool _failures; - -public: - G1VerifyBitmapClosure(const char* caller, G1CollectedHeap* g1h) : - _caller(caller), _g1h(g1h), _failures(false) { } - - bool failures() { return _failures; } - - virtual bool doHeapRegion(HeapRegion* hr) { - bool result = _g1h->verify_bitmaps(_caller, hr); - if (!result) { - _failures = true; - } - return false; - } -}; - -void G1CollectedHeap::check_bitmaps(const char* caller) { - if (!G1VerifyBitmaps) return; - - G1VerifyBitmapClosure cl(caller, this); - heap_region_iterate(&cl); - guarantee(!cl.failures(), "bitmap verification"); -} - -class G1CheckCSetFastTableClosure : public HeapRegionClosure { - private: - bool _failures; - public: - G1CheckCSetFastTableClosure() : HeapRegionClosure(), _failures(false) { } - - virtual bool doHeapRegion(HeapRegion* hr) { - uint i = hr->hrm_index(); - InCSetState cset_state = (InCSetState) G1CollectedHeap::heap()->_in_cset_fast_test.get_by_index(i); - if (hr->is_humongous()) { - if (hr->in_collection_set()) { - log_info(gc, verify)("## humongous region %u in CSet", i); - _failures = true; - return true; - } - if (cset_state.is_in_cset()) { - log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i); - _failures = true; - return true; - } - if (hr->is_continues_humongous() && cset_state.is_humongous()) { - log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i); - _failures = true; - return true; - } - } else { - if (cset_state.is_humongous()) { - log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i); - _failures = true; - return true; - } - if (hr->in_collection_set() != cset_state.is_in_cset()) { - log_info(gc, verify)("## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->in_collection_set(), cset_state.value(), i); - _failures = true; - return true; - } - if (cset_state.is_in_cset()) { - if (hr->is_young() != (cset_state.is_young())) { - log_info(gc, verify)("## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->is_young(), cset_state.value(), i); - _failures = true; - return true; - } - if (hr->is_old() != (cset_state.is_old())) { - log_info(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->is_old(), cset_state.value(), i); - _failures = true; - return true; - } - } - } - return false; - } - - bool failures() const { return _failures; } -}; - -bool G1CollectedHeap::check_cset_fast_test() { - G1CheckCSetFastTableClosure cl; - _hrm.iterate(&cl); - return !cl.failures(); -} -#endif // PRODUCT - class G1ParScrubRemSetTask: public AbstractGangTask { protected: G1RemSet* _g1rs; @@ -5473,10 +4840,7 @@ void G1CollectedHeap::cleanUpCardTable() { workers()->run_task(&cleanup_task); #ifndef PRODUCT - if (G1VerifyCTCleanup || VerifyAfterGC) { - G1VerifyCardTableCleanup cleanup_verifier(this, ct_bs); - heap_region_iterate(&cleanup_verifier); - } + _verifier->verify_card_table_cleanup(); #endif } @@ -5628,7 +4992,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { G1CollectedHeap* g1h = G1CollectedHeap::heap(); oop obj = (oop)r->bottom(); - CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap(); + G1CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap(); // The following checks whether the humongous object is live are sufficient. // The main additional check (in addition to having a reference from the roots @@ -5998,7 +5362,7 @@ HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size, if (new_alloc_region != NULL) { set_region_short_lived_locked(new_alloc_region); _hr_printer.alloc(new_alloc_region, young_list_full); - check_bitmaps("Mutator Region Allocation", new_alloc_region); + _verifier->check_bitmaps("Mutator Region Allocation", new_alloc_region); return new_alloc_region; } } @@ -6038,10 +5402,10 @@ HeapRegion* G1CollectedHeap::new_gc_alloc_region(size_t word_size, new_alloc_region->record_timestamp(); if (is_survivor) { new_alloc_region->set_survivor(); - check_bitmaps("Survivor Region Allocation", new_alloc_region); + _verifier->check_bitmaps("Survivor Region Allocation", new_alloc_region); } else { new_alloc_region->set_old(); - check_bitmaps("Old Region Allocation", new_alloc_region); + _verifier->check_bitmaps("Old Region Allocation", new_alloc_region); } _hr_printer.alloc(new_alloc_region); bool during_im = collector_state()->during_initial_mark_pause(); @@ -6081,93 +5445,6 @@ HeapRegion* G1CollectedHeap::alloc_highest_free_region() { return NULL; } -// Heap region set verification - -class VerifyRegionListsClosure : public HeapRegionClosure { -private: - HeapRegionSet* _old_set; - HeapRegionSet* _humongous_set; - HeapRegionManager* _hrm; - -public: - uint _old_count; - uint _humongous_count; - uint _free_count; - - VerifyRegionListsClosure(HeapRegionSet* old_set, - HeapRegionSet* humongous_set, - HeapRegionManager* hrm) : - _old_set(old_set), _humongous_set(humongous_set), _hrm(hrm), - _old_count(), _humongous_count(), _free_count(){ } - - bool doHeapRegion(HeapRegion* hr) { - if (hr->is_young()) { - // TODO - } else if (hr->is_humongous()) { - assert(hr->containing_set() == _humongous_set, "Heap region %u is humongous but not in humongous set.", hr->hrm_index()); - _humongous_count++; - } else if (hr->is_empty()) { - assert(_hrm->is_free(hr), "Heap region %u is empty but not on the free list.", hr->hrm_index()); - _free_count++; - } else if (hr->is_old()) { - assert(hr->containing_set() == _old_set, "Heap region %u is old but not in the old set.", hr->hrm_index()); - _old_count++; - } else { - // There are no other valid region types. Check for one invalid - // one we can identify: pinned without old or humongous set. - assert(!hr->is_pinned(), "Heap region %u is pinned but not old (archive) or humongous.", hr->hrm_index()); - ShouldNotReachHere(); - } - return false; - } - - void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) { - guarantee(old_set->length() == _old_count, "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count); - guarantee(humongous_set->length() == _humongous_count, "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count); - guarantee(free_list->num_free_regions() == _free_count, "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count); - } -}; - -void G1CollectedHeap::verify_region_sets() { - assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */); - - // First, check the explicit lists. - _hrm.verify(); - { - // Given that a concurrent operation might be adding regions to - // the secondary free list we have to take the lock before - // verifying it. - MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); - _secondary_free_list.verify_list(); - } - - // If a concurrent region freeing operation is in progress it will - // be difficult to correctly attributed any free regions we come - // across to the correct free list given that they might belong to - // one of several (free_list, secondary_free_list, any local lists, - // etc.). So, if that's the case we will skip the rest of the - // verification operation. Alternatively, waiting for the concurrent - // operation to complete will have a non-trivial effect on the GC's - // operation (no concurrent operation will last longer than the - // interval between two calls to verification) and it might hide - // any issues that we would like to catch during testing. - if (free_regions_coming()) { - return; - } - - // Make sure we append the secondary_free_list on the free_list so - // that all free regions we will come across can be safely - // attributed to the free_list. - append_secondary_free_list_if_not_empty_with_lock(); - - // Finally, make sure that the region accounting in the lists is - // consistent with what we see in the heap. - - VerifyRegionListsClosure cl(&_old_set, &_humongous_set, &_hrm); - heap_region_iterate(&cl); - cl.verify_counts(&_old_set, &_humongous_set, &_hrm); -} - // Optimized nmethod scanning class RegisterNMethodOopClosure: public OopClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index de5088f1f03..3d8badc27bb 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,11 +25,11 @@ #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP -#include "gc/g1/concurrentMark.hpp" #include "gc/g1/evacuationInfo.hpp" #include "gc/g1/g1AllocationContext.hpp" #include "gc/g1/g1BiasedArray.hpp" #include "gc/g1/g1CollectorState.hpp" +#include "gc/g1/g1ConcurrentMark.hpp" #include "gc/g1/g1HRPrinter.hpp" #include "gc/g1/g1InCSetState.hpp" #include "gc/g1/g1MonitoringSupport.hpp" @@ -68,7 +68,7 @@ class Space; class G1CollectorPolicy; class G1RemSet; class HeapRegionRemSetIterator; -class ConcurrentMark; +class G1ConcurrentMark; class ConcurrentMarkThread; class ConcurrentG1Refine; class ConcurrentGCTimer; @@ -82,6 +82,7 @@ class Ticks; class WorkGang; class G1Allocator; class G1ArchiveAllocator; +class G1HeapVerifier; typedef OverflowTaskQueue RefToScanQueue; typedef GenericTaskQueueSet RefToScanQueueSet; @@ -118,6 +119,7 @@ class G1CollectedHeap : public CollectedHeap { friend class VMStructs; friend class MutatorAllocRegion; friend class G1GCAllocRegion; + friend class G1HeapVerifier; // Closures used in implementation. friend class G1ParScanThreadState; @@ -181,6 +183,9 @@ private: // Manages all allocations with regions except humongous object allocations. G1Allocator* _allocator; + // Manages all heap verification. + G1HeapVerifier* _verifier; + // Outside of GC pauses, the number of bytes used in all regions other // than the current allocation region(s). size_t _summary_bytes_used; @@ -286,12 +291,6 @@ private: size_t size, size_t translation_factor); - double verify(bool guard, const char* msg); - void verify_before_gc(); - void verify_after_gc(); - - void log_gc_footer(jlong pause_time_counter); - void trace_heap(GCWhen::Type when, const GCTracer* tracer); void process_weak_jni_handles(); @@ -527,6 +526,10 @@ public: return _allocator; } + G1HeapVerifier* verifier() { + return _verifier; + } + G1MonitoringSupport* g1mm() { assert(_g1mm != NULL, "should have been initialized"); return _g1mm; @@ -768,7 +771,7 @@ protected: void abandon_collection_set(HeapRegion* cs_head); // The concurrent marker (and the thread it runs in.) - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; ConcurrentMarkThread* _cmThread; // The concurrent refiner. @@ -1056,54 +1059,6 @@ public: // The number of regions that are not completely free. uint num_used_regions() const { return num_regions() - num_free_regions(); } - void verify_not_dirty_region(HeapRegion* hr) PRODUCT_RETURN; - void verify_dirty_region(HeapRegion* hr) PRODUCT_RETURN; - void verify_dirty_young_list(HeapRegion* head) PRODUCT_RETURN; - void verify_dirty_young_regions() PRODUCT_RETURN; - -#ifndef PRODUCT - // Make sure that the given bitmap has no marked objects in the - // range [from,limit). If it does, print an error message and return - // false. Otherwise, just return true. bitmap_name should be "prev" - // or "next". - bool verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap, - HeapWord* from, HeapWord* limit); - - // Verify that the prev / next bitmap range [tams,end) for the given - // region has no marks. Return true if all is well, false if errors - // are detected. - bool verify_bitmaps(const char* caller, HeapRegion* hr); -#endif // PRODUCT - - // If G1VerifyBitmaps is set, verify that the marking bitmaps for - // the given region do not have any spurious marks. If errors are - // detected, print appropriate error messages and crash. - void check_bitmaps(const char* caller, HeapRegion* hr) PRODUCT_RETURN; - - // If G1VerifyBitmaps is set, verify that the marking bitmaps do not - // have any spurious marks. If errors are detected, print - // appropriate error messages and crash. - void check_bitmaps(const char* caller) PRODUCT_RETURN; - - // Do sanity check on the contents of the in-cset fast test table. - bool check_cset_fast_test() PRODUCT_RETURN_( return true; ); - - // verify_region_sets() performs verification over the region - // lists. It will be compiled in the product code to be used when - // necessary (i.e., during heap verification). - void verify_region_sets(); - - // verify_region_sets_optional() is planted in the code for - // list verification in non-product builds (and it can be enabled in - // product builds by defining HEAP_REGION_SET_FORCE_VERIFY to be 1). -#if HEAP_REGION_SET_FORCE_VERIFY - void verify_region_sets_optional() { - verify_region_sets(); - } -#else // HEAP_REGION_SET_FORCE_VERIFY - void verify_region_sets_optional() { } -#endif // HEAP_REGION_SET_FORCE_VERIFY - #ifdef ASSERT bool is_on_master_free_list(HeapRegion* hr) { return _hrm.is_free(hr); @@ -1425,12 +1380,7 @@ public: inline bool is_obj_ill(const oop obj) const; - bool allocated_since_marking(oop obj, HeapRegion* hr, VerifyOption vo); - HeapWord* top_at_mark_start(HeapRegion* hr, VerifyOption vo); - bool is_marked(oop obj, VerifyOption vo); - const char* top_at_mark_start_str(VerifyOption vo); - - ConcurrentMark* concurrent_mark() const { return _cm; } + G1ConcurrentMark* concurrent_mark() const { return _cm; } // Refinement diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp index 06143806d59..eaf329b3acd 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,10 @@ #ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP #define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP -#include "gc/g1/concurrentMark.hpp" #include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" +#include "gc/g1/g1ConcurrentMark.hpp" #include "gc/g1/g1SATBCardTableModRefBS.hpp" #include "gc/g1/heapRegionManager.inline.hpp" #include "gc/g1/heapRegionSet.inline.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index 0f435abe90a..a2b949cb417 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,10 +24,10 @@ #include "precompiled.hpp" #include "gc/g1/concurrentG1Refine.hpp" -#include "gc/g1/concurrentMark.hpp" #include "gc/g1/concurrentMarkThread.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" +#include "gc/g1/g1ConcurrentMark.hpp" #include "gc/g1/g1IHOPControl.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" #include "gc/g1/heapRegion.inline.hpp" @@ -117,15 +117,6 @@ G1CollectorPolicy::G1CollectorPolicy() : _rs_lengths_prediction(0), _max_survivor_regions(0), - _eden_used_bytes_before_gc(0), - _survivor_used_bytes_before_gc(0), - _old_used_bytes_before_gc(0), - _humongous_used_bytes_before_gc(0), - _heap_used_bytes_before_gc(0), - _metaspace_used_bytes_before_gc(0), - _eden_capacity_bytes_before_gc(0), - _heap_capacity_bytes_before_gc(0), - _eden_cset_region_length(0), _survivor_cset_region_length(0), _old_cset_region_length(0), @@ -745,22 +736,6 @@ void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) { } } -HeapWord* G1CollectorPolicy::mem_allocate_work(size_t size, - bool is_tlab, - bool* gc_overhead_limit_was_exceeded) { - guarantee(false, "Not using this policy feature yet."); - return NULL; -} - -// This method controls how a collector handles one or more -// of its generations being fully allocated. -HeapWord* G1CollectorPolicy::satisfy_failed_allocation(size_t size, - bool is_tlab) { - guarantee(false, "Not using this policy feature yet."); - return NULL; -} - - #ifndef PRODUCT bool G1CollectorPolicy::verify_young_ages() { HeapRegion* head = _g1->young_list()->first_region(); @@ -809,7 +784,6 @@ G1CollectorPolicy::verify_young_ages(HeapRegion* head, void G1CollectorPolicy::record_full_collection_start() { _full_collection_start_sec = os::elapsedTime(); - record_heap_size_info_at_start(true /* full */); // Release the future to-space so that it is available for compaction into. collector_state()->set_full_collection(true); } @@ -871,8 +845,6 @@ void G1CollectorPolicy::record_collection_pause_start(double start_time_sec) { _trace_young_gen_time_data.record_start_collection(s_w_t_ms); _stop_world_start = 0.0; - record_heap_size_info_at_start(false /* full */); - phase_times()->record_cur_collection_start_sec(start_time_sec); _pending_cards = _g1->pending_card_num(); @@ -987,7 +959,7 @@ bool G1CollectorPolicy::need_to_start_conc_mark(const char* source, size_t alloc // Anything below that is considered to be zero #define MIN_TIMER_GRANULARITY 0.0000001 -void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t cards_scanned) { +void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc) { double end_time_sec = os::elapsedTime(); size_t cur_used_bytes = _g1->used(); @@ -1138,7 +1110,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t } _rs_length_diff_seq->add((double) rs_length_diff); - size_t freed_bytes = _heap_used_bytes_before_gc - cur_used_bytes; + size_t freed_bytes = heap_used_bytes_before_gc - cur_used_bytes; size_t copied_bytes = _collection_set_bytes_used_before - freed_bytes; double cost_per_byte_ms = 0.0; @@ -1260,51 +1232,8 @@ void G1CollectorPolicy::report_ihop_statistics() { _ihop_control->print(); } -#define EXT_SIZE_FORMAT "%.1f%s" -#define EXT_SIZE_PARAMS(bytes) \ - byte_size_in_proper_unit((double)(bytes)), \ - proper_unit_for_byte_size((bytes)) - -void G1CollectorPolicy::record_heap_size_info_at_start(bool full) { - YoungList* young_list = _g1->young_list(); - _eden_used_bytes_before_gc = young_list->eden_used_bytes(); - _survivor_used_bytes_before_gc = young_list->survivor_used_bytes(); - _heap_capacity_bytes_before_gc = _g1->capacity(); - _old_used_bytes_before_gc = _g1->old_regions_count() * HeapRegion::GrainBytes; - _humongous_used_bytes_before_gc = _g1->humongous_regions_count() * HeapRegion::GrainBytes; - _heap_used_bytes_before_gc = _g1->used(); - _eden_capacity_bytes_before_gc = (_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc; - _metaspace_used_bytes_before_gc = MetaspaceAux::used_bytes(); -} - -void G1CollectorPolicy::print_detailed_heap_transition() const { - YoungList* young_list = _g1->young_list(); - - size_t eden_used_bytes_after_gc = young_list->eden_used_bytes(); - size_t survivor_used_bytes_after_gc = young_list->survivor_used_bytes(); - size_t heap_used_bytes_after_gc = _g1->used(); - size_t old_used_bytes_after_gc = _g1->old_regions_count() * HeapRegion::GrainBytes; - size_t humongous_used_bytes_after_gc = _g1->humongous_regions_count() * HeapRegion::GrainBytes; - - size_t heap_capacity_bytes_after_gc = _g1->capacity(); - size_t eden_capacity_bytes_after_gc = - (_young_list_target_length * HeapRegion::GrainBytes) - survivor_used_bytes_after_gc; - size_t survivor_capacity_bytes_after_gc = _max_survivor_regions * HeapRegion::GrainBytes; - - log_info(gc, heap)("Eden: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", - _eden_used_bytes_before_gc / K, eden_used_bytes_after_gc /K, eden_capacity_bytes_after_gc /K); - log_info(gc, heap)("Survivor: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", - _survivor_used_bytes_before_gc / K, survivor_used_bytes_after_gc /K, survivor_capacity_bytes_after_gc /K); - log_info(gc, heap)("Old: " SIZE_FORMAT "K->" SIZE_FORMAT "K", - _old_used_bytes_before_gc / K, old_used_bytes_after_gc /K); - log_info(gc, heap)("Humongous: " SIZE_FORMAT "K->" SIZE_FORMAT "K", - _humongous_used_bytes_before_gc / K, humongous_used_bytes_after_gc /K); - - MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc); -} - -void G1CollectorPolicy::print_phases(double pause_time_ms) { - phase_times()->print(pause_time_ms); +void G1CollectorPolicy::print_phases() { + phase_times()->print(); } void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time, @@ -2310,7 +2239,7 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { // whether we added any apparently expensive regions or not, to // avoid generating output per region. log_debug(gc, ergo, cset)("Added expensive regions to CSet (old CSet region num not reached min)." - "old %u regions, expensive: %u regions, min %u regions, remaining time: %1.2fms", + "old: %u regions, expensive: %u regions, min: %u regions, remaining time: %1.2fms", old_cset_region_length(), expensive_region_num, min_old_cset_length, time_remaining_ms); } @@ -2319,7 +2248,7 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { stop_incremental_cset_building(); - log_debug(gc, ergo, cset)("Finish choosing CSet. old %u regions, predicted old region time: %1.2fms, time remaining: %1.2f", + log_debug(gc, ergo, cset)("Finish choosing CSet. old: %u regions, predicted old region time: %1.2fms, time remaining: %1.2f", old_cset_region_length(), predicted_old_time_ms, time_remaining_ms); double non_young_end_time_sec = os::elapsedTime(); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index 530eddb8f74..2eca31c2175 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -621,22 +621,13 @@ public: // Create jstat counters for the policy. virtual void initialize_gc_policy_counters(); - virtual HeapWord* mem_allocate_work(size_t size, - bool is_tlab, - bool* gc_overhead_limit_was_exceeded); - - // This method controls how a collector handles one or more - // of its generations being fully allocated. - virtual HeapWord* satisfy_failed_allocation(size_t size, - bool is_tlab); - bool need_to_start_conc_mark(const char* source, size_t alloc_word_size = 0); bool about_to_start_mixed_phase() const; // Record the start and end of an evacuation pause. void record_collection_pause_start(double start_time_sec); - void record_collection_pause_end(double pause_time_ms, size_t cards_scanned); + void record_collection_pause_end(double pause_time_ms, size_t cards_scanned, size_t heap_used_bytes_before_gc); // Record the start and end of a full collection. void record_full_collection_start(); @@ -654,15 +645,7 @@ public: void record_concurrent_mark_cleanup_end(); void record_concurrent_mark_cleanup_completed(); - // Records the information about the heap size for reporting in - // print_detailed_heap_transition - void record_heap_size_info_at_start(bool full); - - // Print heap sizing transition (with less and more detail). - - void print_detailed_heap_transition() const; - - virtual void print_phases(double pause_time_ms); + virtual void print_phases(); void record_stop_world_start(); void record_concurrent_pause(); @@ -825,16 +808,6 @@ private: // The value of _heap_bytes_before_gc is also used to calculate // the cost of copying. - size_t _eden_used_bytes_before_gc; // Eden occupancy before GC - size_t _survivor_used_bytes_before_gc; // Survivor occupancy before GC - size_t _old_used_bytes_before_gc; // Old occupancy before GC - size_t _humongous_used_bytes_before_gc; // Humongous occupancy before GC - size_t _heap_used_bytes_before_gc; // Heap occupancy before GC - size_t _metaspace_used_bytes_before_gc; // Metaspace occupancy before GC - - size_t _eden_capacity_bytes_before_gc; // Eden capacity before GC - size_t _heap_capacity_bytes_before_gc; // Heap capacity before GC - // The amount of survivor regions after a collection. uint _recorded_survivor_regions; // List of survivor regions. @@ -846,6 +819,10 @@ private: public: uint tenuring_threshold() const { return _tenuring_threshold; } + uint max_survivor_regions() { + return _max_survivor_regions; + } + static const uint REGIONS_UNLIMITED = (uint) -1; uint max_regions(InCSetState dest) const { diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp similarity index 92% rename from hotspot/src/share/vm/gc/g1/concurrentMark.cpp rename to hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp index 7c805879930..4d4ce498e56 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp @@ -26,11 +26,12 @@ #include "classfile/metadataOnStackMark.hpp" #include "classfile/symbolTable.hpp" #include "code/codeCache.hpp" -#include "gc/g1/concurrentMark.inline.hpp" #include "gc/g1/concurrentMarkThread.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" +#include "gc/g1/g1ConcurrentMark.inline.hpp" +#include "gc/g1/g1HeapVerifier.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/heapRegion.inline.hpp" @@ -58,15 +59,15 @@ // Concurrent marking bit map wrapper -CMBitMapRO::CMBitMapRO(int shifter) : +G1CMBitMapRO::G1CMBitMapRO(int shifter) : _bm(), _shifter(shifter) { _bmStartWord = 0; _bmWordSize = 0; } -HeapWord* CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr, - const HeapWord* limit) const { +HeapWord* G1CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr, + const HeapWord* limit) const { // First we must round addr *up* to a possible object boundary. addr = (HeapWord*)align_size_up((intptr_t)addr, HeapWordSize << _shifter); @@ -82,7 +83,7 @@ HeapWord* CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr, } #ifndef PRODUCT -bool CMBitMapRO::covers(MemRegion heap_rs) const { +bool G1CMBitMapRO::covers(MemRegion heap_rs) const { // assert(_bm.map() == _virtual_space.low(), "map inconsistency"); assert(((size_t)_bm.size() * ((size_t)1 << _shifter)) == _bmWordSize, "size inconsistency"); @@ -91,19 +92,19 @@ bool CMBitMapRO::covers(MemRegion heap_rs) const { } #endif -void CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const { +void G1CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const { _bm.print_on_error(st, prefix); } -size_t CMBitMap::compute_size(size_t heap_size) { +size_t G1CMBitMap::compute_size(size_t heap_size) { return ReservedSpace::allocation_align_size_up(heap_size / mark_distance()); } -size_t CMBitMap::mark_distance() { +size_t G1CMBitMap::mark_distance() { return MinObjAlignmentInBytes * BitsPerByte; } -void CMBitMap::initialize(MemRegion heap, G1RegionToSpaceMapper* storage) { +void G1CMBitMap::initialize(MemRegion heap, G1RegionToSpaceMapper* storage) { _bmStartWord = heap.start(); _bmWordSize = heap.word_size(); @@ -113,7 +114,7 @@ void CMBitMap::initialize(MemRegion heap, G1RegionToSpaceMapper* storage) { storage->set_mapping_changed_listener(&_listener); } -void CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_regions, bool zero_filled) { +void G1CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_regions, bool zero_filled) { if (zero_filled) { return; } @@ -125,11 +126,11 @@ void CMBitMapMappingChangedListener::on_commit(uint start_region, size_t num_reg // Closure used for clearing the given mark bitmap. class ClearBitmapHRClosure : public HeapRegionClosure { private: - ConcurrentMark* _cm; - CMBitMap* _bitmap; + G1ConcurrentMark* _cm; + G1CMBitMap* _bitmap; bool _may_yield; // The closure may yield during iteration. If yielded, abort the iteration. public: - ClearBitmapHRClosure(ConcurrentMark* cm, CMBitMap* bitmap, bool may_yield) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) { + ClearBitmapHRClosure(G1ConcurrentMark* cm, G1CMBitMap* bitmap, bool may_yield) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap), _may_yield(may_yield) { assert(!may_yield || cm != NULL, "CM must be non-NULL if this closure is expected to yield."); } @@ -176,7 +177,7 @@ public: } }; -void CMBitMap::clearAll() { +void G1CMBitMap::clearAll() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); ClearBitmapHRClosure cl(NULL, this, false /* may_yield */); uint n_workers = g1h->workers()->active_workers(); @@ -186,7 +187,7 @@ void CMBitMap::clearAll() { return; } -void CMBitMap::clearRange(MemRegion mr) { +void G1CMBitMap::clearRange(MemRegion mr) { mr.intersection(MemRegion(_bmStartWord, _bmWordSize)); assert(!mr.is_empty(), "unexpected empty region"); // convert address range into offset range @@ -194,11 +195,11 @@ void CMBitMap::clearRange(MemRegion mr) { heapWordToOffset(mr.end()), false); } -CMMarkStack::CMMarkStack(ConcurrentMark* cm) : +G1CMMarkStack::G1CMMarkStack(G1ConcurrentMark* cm) : _base(NULL), _cm(cm) {} -bool CMMarkStack::allocate(size_t capacity) { +bool G1CMMarkStack::allocate(size_t capacity) { // allocate a stack of the requisite depth ReservedSpace rs(ReservedSpace::allocation_align_size_up(capacity * sizeof(oop))); if (!rs.is_reserved()) { @@ -213,7 +214,7 @@ bool CMMarkStack::allocate(size_t capacity) { return false; } assert(_virtual_space.committed_size() == rs.size(), - "Didn't reserve backing store for all of ConcurrentMark stack?"); + "Didn't reserve backing store for all of G1ConcurrentMark stack?"); _base = (oop*) _virtual_space.low(); setEmpty(); _capacity = (jint) capacity; @@ -222,7 +223,7 @@ bool CMMarkStack::allocate(size_t capacity) { return true; } -void CMMarkStack::expand() { +void G1CMMarkStack::expand() { // Called, during remark, if we've overflown the marking stack during marking. assert(isEmpty(), "stack should been emptied while handling overflow"); assert(_capacity <= (jint) MarkStackSizeMax, "stack bigger than permitted"); @@ -255,21 +256,21 @@ void CMMarkStack::expand() { } } -void CMMarkStack::set_should_expand() { +void G1CMMarkStack::set_should_expand() { // If we're resetting the marking state because of an // marking stack overflow, record that we should, if // possible, expand the stack. _should_expand = _cm->has_overflown(); } -CMMarkStack::~CMMarkStack() { +G1CMMarkStack::~G1CMMarkStack() { if (_base != NULL) { _base = NULL; _virtual_space.release(); } } -void CMMarkStack::par_push_arr(oop* ptr_arr, int n) { +void G1CMMarkStack::par_push_arr(oop* ptr_arr, int n) { MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); jint start = _index; jint next_index = start + n; @@ -286,7 +287,7 @@ void CMMarkStack::par_push_arr(oop* ptr_arr, int n) { } } -bool CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) { +bool G1CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) { MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); jint index = _index; if (index == 0) { @@ -304,13 +305,13 @@ bool CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) { } } -void CMMarkStack::note_start_of_gc() { +void G1CMMarkStack::note_start_of_gc() { assert(_saved_index == -1, "note_start_of_gc()/end_of_gc() bracketed incorrectly"); _saved_index = _index; } -void CMMarkStack::note_end_of_gc() { +void G1CMMarkStack::note_end_of_gc() { // This is intentionally a guarantee, instead of an assert. If we // accidentally add something to the mark stack during GC, it // will be a correctness issue so it's better if we crash. we'll @@ -321,16 +322,16 @@ void CMMarkStack::note_end_of_gc() { _saved_index = -1; } -CMRootRegions::CMRootRegions() : +G1CMRootRegions::G1CMRootRegions() : _young_list(NULL), _cm(NULL), _scan_in_progress(false), _should_abort(false), _next_survivor(NULL) { } -void CMRootRegions::init(G1CollectedHeap* g1h, ConcurrentMark* cm) { +void G1CMRootRegions::init(G1CollectedHeap* g1h, G1ConcurrentMark* cm) { _young_list = g1h->young_list(); _cm = cm; } -void CMRootRegions::prepare_for_scan() { +void G1CMRootRegions::prepare_for_scan() { assert(!scan_in_progress(), "pre-condition"); // Currently, only survivors can be root regions. @@ -340,7 +341,7 @@ void CMRootRegions::prepare_for_scan() { _should_abort = false; } -HeapRegion* CMRootRegions::claim_next() { +HeapRegion* G1CMRootRegions::claim_next() { if (_should_abort) { // If someone has set the should_abort flag, we return NULL to // force the caller to bail out of their loop. @@ -371,7 +372,7 @@ HeapRegion* CMRootRegions::claim_next() { return res; } -void CMRootRegions::scan_finished() { +void G1CMRootRegions::scan_finished() { assert(scan_in_progress(), "pre-condition"); // Currently, only survivors can be root regions. @@ -387,7 +388,7 @@ void CMRootRegions::scan_finished() { } } -bool CMRootRegions::wait_until_scan_finished() { +bool G1CMRootRegions::wait_until_scan_finished() { if (!scan_in_progress()) return false; { @@ -399,11 +400,11 @@ bool CMRootRegions::wait_until_scan_finished() { return true; } -uint ConcurrentMark::scale_parallel_threads(uint n_par_threads) { +uint G1ConcurrentMark::scale_parallel_threads(uint n_par_threads) { return MAX2((n_par_threads + 2) / 4, 1U); } -ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage) : +G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev_bitmap_storage, G1RegionToSpaceMapper* next_bitmap_storage) : _g1h(g1h), _markBitMap1(), _markBitMap2(), @@ -426,7 +427,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev _max_worker_id(ParallelGCThreads), // _active_tasks set in set_non_marking_state // _tasks set inside the constructor - _task_queues(new CMTaskQueueSet((int) _max_worker_id)), + _task_queues(new G1CMTaskQueueSet((int) _max_worker_id)), _terminator(ParallelTaskTerminator((int) _max_worker_id, _task_queues)), _has_overflown(false), @@ -559,7 +560,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev return; } - _tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_worker_id, mtGC); + _tasks = NEW_C_HEAP_ARRAY(G1CMTask*, _max_worker_id, mtGC); _accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_worker_id, mtGC); _count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_worker_id, mtGC); @@ -572,17 +573,17 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev uint max_regions = _g1h->max_regions(); for (uint i = 0; i < _max_worker_id; ++i) { - CMTaskQueue* task_queue = new CMTaskQueue(); + G1CMTaskQueue* task_queue = new G1CMTaskQueue(); task_queue->initialize(); _task_queues->register_queue(i, task_queue); _count_card_bitmaps[i] = BitMap(card_bm_size, false); _count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, max_regions, mtGC); - _tasks[i] = new CMTask(i, this, - _count_marked_bytes[i], - &_count_card_bitmaps[i], - task_queue, _task_queues); + _tasks[i] = new G1CMTask(i, this, + _count_marked_bytes[i], + &_count_card_bitmaps[i], + task_queue, _task_queues); _accum_task_vtime[i] = 0.0; } @@ -602,7 +603,7 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev _completed_initialization = true; } -void ConcurrentMark::reset() { +void G1ConcurrentMark::reset() { // Starting values for these two. This should be called in a STW // phase. MemRegion reserved = _g1h->g1_reserved(); @@ -630,7 +631,7 @@ void ConcurrentMark::reset() { } -void ConcurrentMark::reset_marking_state(bool clear_overflow) { +void G1ConcurrentMark::reset_marking_state(bool clear_overflow) { _markStack.set_should_expand(); _markStack.setEmpty(); // Also clears the _markStack overflow flag if (clear_overflow) { @@ -641,12 +642,12 @@ void ConcurrentMark::reset_marking_state(bool clear_overflow) { _finger = _heap_start; for (uint i = 0; i < _max_worker_id; ++i) { - CMTaskQueue* queue = _task_queues->queue(i); + G1CMTaskQueue* queue = _task_queues->queue(i); queue->set_empty(); } } -void ConcurrentMark::set_concurrency(uint active_tasks) { +void G1ConcurrentMark::set_concurrency(uint active_tasks) { assert(active_tasks <= _max_worker_id, "we should not have more"); _active_tasks = active_tasks; @@ -657,7 +658,7 @@ void ConcurrentMark::set_concurrency(uint active_tasks) { _second_overflow_barrier_sync.set_n_workers((int) active_tasks); } -void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) { +void G1ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) { set_concurrency(active_tasks); _concurrent = concurrent; @@ -678,7 +679,7 @@ void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurren } } -void ConcurrentMark::set_non_marking_state() { +void G1ConcurrentMark::set_non_marking_state() { // We set the global marking state to some default values when we're // not doing marking. reset_marking_state(); @@ -686,12 +687,12 @@ void ConcurrentMark::set_non_marking_state() { clear_concurrent_marking_in_progress(); } -ConcurrentMark::~ConcurrentMark() { - // The ConcurrentMark instance is never freed. +G1ConcurrentMark::~G1ConcurrentMark() { + // The G1ConcurrentMark instance is never freed. ShouldNotReachHere(); } -void ConcurrentMark::clearNextBitmap() { +void G1ConcurrentMark::clearNextBitmap() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); // Make sure that the concurrent mark thread looks to still be in @@ -720,10 +721,10 @@ void ConcurrentMark::clearNextBitmap() { } class CheckBitmapClearHRClosure : public HeapRegionClosure { - CMBitMap* _bitmap; + G1CMBitMap* _bitmap; bool _error; public: - CheckBitmapClearHRClosure(CMBitMap* bitmap) : _bitmap(bitmap) { + CheckBitmapClearHRClosure(G1CMBitMap* bitmap) : _bitmap(bitmap) { } virtual bool doHeapRegion(HeapRegion* r) { @@ -736,7 +737,7 @@ class CheckBitmapClearHRClosure : public HeapRegionClosure { } }; -bool ConcurrentMark::nextMarkBitmapIsClear() { +bool G1ConcurrentMark::nextMarkBitmapIsClear() { CheckBitmapClearHRClosure cl(_nextMarkBitMap); _g1h->heap_region_iterate(&cl); return cl.complete(); @@ -750,7 +751,7 @@ public: } }; -void ConcurrentMark::checkpointRootsInitialPre() { +void G1ConcurrentMark::checkpointRootsInitialPre() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1CollectorPolicy* g1p = g1h->g1_policy(); @@ -765,7 +766,7 @@ void ConcurrentMark::checkpointRootsInitialPre() { } -void ConcurrentMark::checkpointRootsInitialPost() { +void G1ConcurrentMark::checkpointRootsInitialPost() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); // Start Concurrent Marking weak-reference discovery. @@ -809,7 +810,7 @@ void ConcurrentMark::checkpointRootsInitialPost() { * doesn't manipulate any data structures afterwards. */ -void ConcurrentMark::enter_first_sync_barrier(uint worker_id) { +void G1ConcurrentMark::enter_first_sync_barrier(uint worker_id) { bool barrier_aborted; { SuspendibleThreadSetLeaver sts_leave(concurrent()); @@ -849,16 +850,16 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) { // then go into the second barrier } -void ConcurrentMark::enter_second_sync_barrier(uint worker_id) { +void G1ConcurrentMark::enter_second_sync_barrier(uint worker_id) { SuspendibleThreadSetLeaver sts_leave(concurrent()); _second_overflow_barrier_sync.enter(); // at this point everything should be re-initialized and ready to go } -class CMConcurrentMarkingTask: public AbstractGangTask { +class G1CMConcurrentMarkingTask: public AbstractGangTask { private: - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; ConcurrentMarkThread* _cmt; public: @@ -873,7 +874,7 @@ public: SuspendibleThreadSetJoiner sts_join; assert(worker_id < _cm->active_tasks(), "invariant"); - CMTask* the_task = _cm->task(worker_id); + G1CMTask* the_task = _cm->task(worker_id); the_task->record_start_time(); if (!_cm->has_aborted()) { do { @@ -909,16 +910,16 @@ public: _cm->update_accum_task_vtime(worker_id, end_vtime - start_vtime); } - CMConcurrentMarkingTask(ConcurrentMark* cm, - ConcurrentMarkThread* cmt) : + G1CMConcurrentMarkingTask(G1ConcurrentMark* cm, + ConcurrentMarkThread* cmt) : AbstractGangTask("Concurrent Mark"), _cm(cm), _cmt(cmt) { } - ~CMConcurrentMarkingTask() { } + ~G1CMConcurrentMarkingTask() { } }; // Calculates the number of active workers for a concurrent // phase. -uint ConcurrentMark::calc_parallel_marking_threads() { +uint G1ConcurrentMark::calc_parallel_marking_threads() { uint n_conc_workers = 0; if (!UseDynamicNumberOfGCThreads || (!FLAG_IS_DEFAULT(ConcGCThreads) && @@ -938,7 +939,7 @@ uint ConcurrentMark::calc_parallel_marking_threads() { return n_conc_workers; } -void ConcurrentMark::scanRootRegion(HeapRegion* hr, uint worker_id) { +void G1ConcurrentMark::scanRootRegion(HeapRegion* hr, uint worker_id) { // Currently, only survivors can be root regions. assert(hr->next_top_at_mark_start() == hr->bottom(), "invariant"); G1RootRegionScanClosure cl(_g1h, this, worker_id); @@ -955,19 +956,19 @@ void ConcurrentMark::scanRootRegion(HeapRegion* hr, uint worker_id) { } } -class CMRootRegionScanTask : public AbstractGangTask { +class G1CMRootRegionScanTask : public AbstractGangTask { private: - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; public: - CMRootRegionScanTask(ConcurrentMark* cm) : + G1CMRootRegionScanTask(G1ConcurrentMark* cm) : AbstractGangTask("Root Region Scan"), _cm(cm) { } void work(uint worker_id) { assert(Thread::current()->is_ConcurrentGC_thread(), "this should only be done by a conc GC thread"); - CMRootRegions* root_regions = _cm->root_regions(); + G1CMRootRegions* root_regions = _cm->root_regions(); HeapRegion* hr = root_regions->claim_next(); while (hr != NULL) { _cm->scanRootRegion(hr, worker_id); @@ -976,7 +977,7 @@ public: } }; -void ConcurrentMark::scanRootRegions() { +void G1ConcurrentMark::scanRootRegions() { // Start of concurrent marking. ClassLoaderDataGraph::clear_claimed_marks(); @@ -991,7 +992,7 @@ void ConcurrentMark::scanRootRegions() { "Maximum number of marking threads exceeded"); uint active_workers = MAX2(1U, parallel_marking_threads()); - CMRootRegionScanTask task(this); + G1CMRootRegionScanTask task(this); _parallel_workers->set_active_workers(active_workers); _parallel_workers->run_task(&task); @@ -1002,20 +1003,20 @@ void ConcurrentMark::scanRootRegions() { } } -void ConcurrentMark::register_concurrent_phase_start(const char* title) { +void G1ConcurrentMark::register_concurrent_phase_start(const char* title) { assert(!_concurrent_phase_started, "Sanity"); _concurrent_phase_started = true; _g1h->gc_timer_cm()->register_gc_concurrent_start(title); } -void ConcurrentMark::register_concurrent_phase_end() { +void G1ConcurrentMark::register_concurrent_phase_end() { if (_concurrent_phase_started) { _concurrent_phase_started = false; _g1h->gc_timer_cm()->register_gc_concurrent_end(); } } -void ConcurrentMark::markFromRoots() { +void G1ConcurrentMark::markFromRoots() { // we might be tempted to assert that: // assert(asynch == !SafepointSynchronize::is_at_safepoint(), // "inconsistent argument?"); @@ -1036,13 +1037,13 @@ void ConcurrentMark::markFromRoots() { // Parallel task terminator is set in "set_concurrency_and_phase()" set_concurrency_and_phase(active_workers, true /* concurrent */); - CMConcurrentMarkingTask markingTask(this, cmThread()); + G1CMConcurrentMarkingTask markingTask(this, cmThread()); _parallel_workers->set_active_workers(active_workers); _parallel_workers->run_task(&markingTask); print_stats(); } -void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { +void G1ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { // world is stopped at this checkpoint assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped"); @@ -1062,7 +1063,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (before)"); } - g1h->check_bitmaps("Remark Start"); + g1h->verifier()->check_bitmaps("Remark Start"); G1CollectorPolicy* g1p = g1h->g1_policy(); g1p->record_concurrent_mark_remark_start(); @@ -1111,7 +1112,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UseNextMarking, "During GC (after)"); } - g1h->check_bitmaps("Remark End"); + g1h->verifier()->check_bitmaps("Remark End"); assert(!restart_for_overflow(), "sanity"); // Completely reset the marking state since marking completed set_non_marking_state(); @@ -1136,10 +1137,10 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { // Base class of the closures that finalize and verify the // liveness counting data. -class CMCountDataClosureBase: public HeapRegionClosure { +class G1CMCountDataClosureBase: public HeapRegionClosure { protected: G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; CardTableModRefBS* _ct_bs; BitMap* _region_bm; @@ -1154,8 +1155,8 @@ protected: } public: - CMCountDataClosureBase(G1CollectedHeap* g1h, - BitMap* region_bm, BitMap* card_bm): + G1CMCountDataClosureBase(G1CollectedHeap* g1h, + BitMap* region_bm, BitMap* card_bm): _g1h(g1h), _cm(g1h->concurrent_mark()), _ct_bs(barrier_set_cast(g1h->barrier_set())), _region_bm(region_bm), _card_bm(card_bm) { } @@ -1163,14 +1164,14 @@ public: // Closure that calculates the # live objects per region. Used // for verification purposes during the cleanup pause. -class CalcLiveObjectsClosure: public CMCountDataClosureBase { - CMBitMapRO* _bm; +class CalcLiveObjectsClosure: public G1CMCountDataClosureBase { + G1CMBitMapRO* _bm; size_t _region_marked_bytes; public: - CalcLiveObjectsClosure(CMBitMapRO *bm, G1CollectedHeap* g1h, + CalcLiveObjectsClosure(G1CMBitMapRO *bm, G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm) : - CMCountDataClosureBase(g1h, region_bm, card_bm), + G1CMCountDataClosureBase(g1h, region_bm, card_bm), _bm(bm), _region_marked_bytes(0) { } bool doHeapRegion(HeapRegion* hr) { @@ -1263,7 +1264,7 @@ public: class VerifyLiveObjectDataHRClosure: public HeapRegionClosure { G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; CalcLiveObjectsClosure _calc_cl; BitMap* _region_bm; // Region BM to be verified BitMap* _card_bm; // Card BM to be verified @@ -1360,7 +1361,7 @@ public: class G1ParVerifyFinalCountTask: public AbstractGangTask { protected: G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; BitMap* _actual_region_bm; BitMap* _actual_card_bm; @@ -1411,12 +1412,12 @@ public: // card liveness bitmap. Also sets the bit for each region, // containing live data, in the region liveness bitmap. -class FinalCountDataUpdateClosure: public CMCountDataClosureBase { +class FinalCountDataUpdateClosure: public G1CMCountDataClosureBase { public: FinalCountDataUpdateClosure(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm) : - CMCountDataClosureBase(g1h, region_bm, card_bm) { } + G1CMCountDataClosureBase(g1h, region_bm, card_bm) { } bool doHeapRegion(HeapRegion* hr) { HeapWord* ntams = hr->next_top_at_mark_start(); @@ -1465,7 +1466,7 @@ class FinalCountDataUpdateClosure: public CMCountDataClosureBase { class G1ParFinalCountTask: public AbstractGangTask { protected: G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; BitMap* _actual_region_bm; BitMap* _actual_card_bm; @@ -1593,7 +1594,7 @@ public: } }; -void ConcurrentMark::cleanup() { +void G1ConcurrentMark::cleanup() { // world is stopped at this checkpoint assert(SafepointSynchronize::is_at_safepoint(), "world should be stopped"); @@ -1605,14 +1606,14 @@ void ConcurrentMark::cleanup() { return; } - g1h->verify_region_sets_optional(); + g1h->verifier()->verify_region_sets_optional(); if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (before)"); } - g1h->check_bitmaps("Cleanup Start"); + g1h->verifier()->check_bitmaps("Cleanup Start"); G1CollectorPolicy* g1p = g1h->g1_policy(); g1p->record_concurrent_mark_cleanup_start(); @@ -1702,9 +1703,9 @@ void ConcurrentMark::cleanup() { Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (after)"); } - g1h->check_bitmaps("Cleanup End"); + g1h->verifier()->check_bitmaps("Cleanup End"); - g1h->verify_region_sets_optional(); + g1h->verifier()->verify_region_sets_optional(); // We need to make this be a "collection" so any collection pause that // races with it goes around and waits for completeCleanup to finish. @@ -1724,7 +1725,7 @@ void ConcurrentMark::cleanup() { g1h->trace_heap_after_concurrent_cycle(); } -void ConcurrentMark::completeCleanup() { +void G1ConcurrentMark::completeCleanup() { if (has_aborted()) return; G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -1785,11 +1786,11 @@ bool G1CMIsAliveClosure::do_object_b(oop obj) { } // 'Keep Alive' oop closure used by both serial parallel reference processing. -// Uses the CMTask associated with a worker thread (for serial reference -// processing the CMTask for worker 0 is used) to preserve (mark) and +// Uses the G1CMTask associated with a worker thread (for serial reference +// processing the G1CMTask for worker 0 is used) to preserve (mark) and // trace referent objects. // -// Using the CMTask and embedded local queues avoids having the worker +// Using the G1CMTask and embedded local queues avoids having the worker // threads operating on the global mark stack. This reduces the risk // of overflowing the stack - which we would rather avoid at this late // state. Also using the tasks' local queues removes the potential @@ -1797,13 +1798,13 @@ bool G1CMIsAliveClosure::do_object_b(oop obj) { // operating on the global stack. class G1CMKeepAliveAndDrainClosure: public OopClosure { - ConcurrentMark* _cm; - CMTask* _task; - int _ref_counter_limit; - int _ref_counter; - bool _is_serial; + G1ConcurrentMark* _cm; + G1CMTask* _task; + int _ref_counter_limit; + int _ref_counter; + bool _is_serial; public: - G1CMKeepAliveAndDrainClosure(ConcurrentMark* cm, CMTask* task, bool is_serial) : + G1CMKeepAliveAndDrainClosure(G1ConcurrentMark* cm, G1CMTask* task, bool is_serial) : _cm(cm), _task(task), _is_serial(is_serial), _ref_counter_limit(G1RefProcDrainInterval) { assert(_ref_counter_limit > 0, "sanity"); @@ -1823,19 +1824,19 @@ class G1CMKeepAliveAndDrainClosure: public OopClosure { if (_ref_counter == 0) { // We have dealt with _ref_counter_limit references, pushing them // and objects reachable from them on to the local stack (and - // possibly the global stack). Call CMTask::do_marking_step() to + // possibly the global stack). Call G1CMTask::do_marking_step() to // process these entries. // - // We call CMTask::do_marking_step() in a loop, which we'll exit if + // We call G1CMTask::do_marking_step() in a loop, which we'll exit if // there's nothing more to do (i.e. we're done with the entries that - // were pushed as a result of the CMTask::deal_with_reference() calls + // were pushed as a result of the G1CMTask::deal_with_reference() calls // above) or we overflow. // - // Note: CMTask::do_marking_step() can set the CMTask::has_aborted() + // Note: G1CMTask::do_marking_step() can set the G1CMTask::has_aborted() // flag while there may still be some work to do. (See the comment at - // the beginning of CMTask::do_marking_step() for those conditions - + // the beginning of G1CMTask::do_marking_step() for those conditions - // one of which is reaching the specified time target.) It is only - // when CMTask::do_marking_step() returns without setting the + // when G1CMTask::do_marking_step() returns without setting the // has_aborted() flag that the marking step has completed. do { double mark_step_duration_ms = G1ConcMarkStepDurationMillis; @@ -1850,39 +1851,39 @@ class G1CMKeepAliveAndDrainClosure: public OopClosure { }; // 'Drain' oop closure used by both serial and parallel reference processing. -// Uses the CMTask associated with a given worker thread (for serial -// reference processing the CMtask for worker 0 is used). Calls the +// Uses the G1CMTask associated with a given worker thread (for serial +// reference processing the G1CMtask for worker 0 is used). Calls the // do_marking_step routine, with an unbelievably large timeout value, // to drain the marking data structures of the remaining entries // added by the 'keep alive' oop closure above. class G1CMDrainMarkingStackClosure: public VoidClosure { - ConcurrentMark* _cm; - CMTask* _task; - bool _is_serial; + G1ConcurrentMark* _cm; + G1CMTask* _task; + bool _is_serial; public: - G1CMDrainMarkingStackClosure(ConcurrentMark* cm, CMTask* task, bool is_serial) : + G1CMDrainMarkingStackClosure(G1ConcurrentMark* cm, G1CMTask* task, bool is_serial) : _cm(cm), _task(task), _is_serial(is_serial) { assert(!_is_serial || _task->worker_id() == 0, "only task 0 for serial code"); } void do_void() { do { - // We call CMTask::do_marking_step() to completely drain the local + // We call G1CMTask::do_marking_step() to completely drain the local // and global marking stacks of entries pushed by the 'keep alive' // oop closure (an instance of G1CMKeepAliveAndDrainClosure above). // - // CMTask::do_marking_step() is called in a loop, which we'll exit + // G1CMTask::do_marking_step() is called in a loop, which we'll exit // if there's nothing more to do (i.e. we've completely drained the // entries that were pushed as a a result of applying the 'keep alive' // closure to the entries on the discovered ref lists) or we overflow // the global marking stack. // - // Note: CMTask::do_marking_step() can set the CMTask::has_aborted() + // Note: G1CMTask::do_marking_step() can set the G1CMTask::has_aborted() // flag while there may still be some work to do. (See the comment at - // the beginning of CMTask::do_marking_step() for those conditions - + // the beginning of G1CMTask::do_marking_step() for those conditions - // one of which is reaching the specified time target.) It is only - // when CMTask::do_marking_step() returns without setting the + // when G1CMTask::do_marking_step() returns without setting the // has_aborted() flag that the marking step has completed. _task->do_marking_step(1000000000.0 /* something very large */, @@ -1897,14 +1898,14 @@ class G1CMDrainMarkingStackClosure: public VoidClosure { class G1CMRefProcTaskExecutor: public AbstractRefProcTaskExecutor { private: - G1CollectedHeap* _g1h; - ConcurrentMark* _cm; - WorkGang* _workers; - uint _active_workers; + G1CollectedHeap* _g1h; + G1ConcurrentMark* _cm; + WorkGang* _workers; + uint _active_workers; public: G1CMRefProcTaskExecutor(G1CollectedHeap* g1h, - ConcurrentMark* cm, + G1ConcurrentMark* cm, WorkGang* workers, uint n_workers) : _g1h(g1h), _cm(cm), @@ -1917,14 +1918,14 @@ public: class G1CMRefProcTaskProxy: public AbstractGangTask { typedef AbstractRefProcTaskExecutor::ProcessTask ProcessTask; - ProcessTask& _proc_task; - G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + ProcessTask& _proc_task; + G1CollectedHeap* _g1h; + G1ConcurrentMark* _cm; public: G1CMRefProcTaskProxy(ProcessTask& proc_task, - G1CollectedHeap* g1h, - ConcurrentMark* cm) : + G1CollectedHeap* g1h, + G1ConcurrentMark* cm) : AbstractGangTask("Process reference objects in parallel"), _proc_task(proc_task), _g1h(g1h), _cm(cm) { ReferenceProcessor* rp = _g1h->ref_processor_cm(); @@ -1934,7 +1935,7 @@ public: virtual void work(uint worker_id) { ResourceMark rm; HandleMark hm; - CMTask* task = _cm->task(worker_id); + G1CMTask* task = _cm->task(worker_id); G1CMIsAliveClosure g1_is_alive(_g1h); G1CMKeepAliveAndDrainClosure g1_par_keep_alive(_cm, task, false /* is_serial */); G1CMDrainMarkingStackClosure g1_par_drain(_cm, task, false /* is_serial */); @@ -1951,7 +1952,7 @@ void G1CMRefProcTaskExecutor::execute(ProcessTask& proc_task) { // We need to reset the concurrency level before each // proxy task execution, so that the termination protocol - // and overflow handling in CMTask::do_marking_step() knows + // and overflow handling in G1CMTask::do_marking_step() knows // how many workers to wait for. _cm->set_concurrency(_active_workers); _workers->run_task(&proc_task_proxy); @@ -1981,17 +1982,17 @@ void G1CMRefProcTaskExecutor::execute(EnqueueTask& enq_task) { // // We need to reset the concurrency level before each // proxy task execution, so that the termination protocol - // and overflow handling in CMTask::do_marking_step() knows + // and overflow handling in G1CMTask::do_marking_step() knows // how many workers to wait for. _cm->set_concurrency(_active_workers); _workers->run_task(&enq_task_proxy); } -void ConcurrentMark::weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes) { +void G1ConcurrentMark::weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes) { G1CollectedHeap::heap()->parallel_cleaning(is_alive, true, true, purged_classes); } -void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { +void G1ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { if (has_overflown()) { // Skip processing the discovered references if we have // overflown the global marking stack. Reference objects @@ -2126,19 +2127,19 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { } } -void ConcurrentMark::swapMarkBitMaps() { - CMBitMapRO* temp = _prevMarkBitMap; - _prevMarkBitMap = (CMBitMapRO*)_nextMarkBitMap; - _nextMarkBitMap = (CMBitMap*) temp; +void G1ConcurrentMark::swapMarkBitMaps() { + G1CMBitMapRO* temp = _prevMarkBitMap; + _prevMarkBitMap = (G1CMBitMapRO*)_nextMarkBitMap; + _nextMarkBitMap = (G1CMBitMap*) temp; } // Closure for marking entries in SATB buffers. -class CMSATBBufferClosure : public SATBBufferClosure { +class G1CMSATBBufferClosure : public SATBBufferClosure { private: - CMTask* _task; + G1CMTask* _task; G1CollectedHeap* _g1h; - // This is very similar to CMTask::deal_with_reference, but with + // This is very similar to G1CMTask::deal_with_reference, but with // more relaxed requirements for the argument, so this must be more // circumspect about treating the argument as an object. void do_entry(void* entry) const { @@ -2155,7 +2156,7 @@ private: } public: - CMSATBBufferClosure(CMTask* task, G1CollectedHeap* g1h) + G1CMSATBBufferClosure(G1CMTask* task, G1CollectedHeap* g1h) : _task(task), _g1h(g1h) { } virtual void do_buffer(void** buffer, size_t size) { @@ -2166,13 +2167,13 @@ public: }; class G1RemarkThreadsClosure : public ThreadClosure { - CMSATBBufferClosure _cm_satb_cl; + G1CMSATBBufferClosure _cm_satb_cl; G1CMOopClosure _cm_cl; MarkingCodeBlobClosure _code_cl; int _thread_parity; public: - G1RemarkThreadsClosure(G1CollectedHeap* g1h, CMTask* task) : + G1RemarkThreadsClosure(G1CollectedHeap* g1h, G1CMTask* task) : _cm_satb_cl(task, g1h), _cm_cl(g1h, g1h->concurrent_mark(), task), _code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations), @@ -2201,15 +2202,15 @@ class G1RemarkThreadsClosure : public ThreadClosure { } }; -class CMRemarkTask: public AbstractGangTask { +class G1CMRemarkTask: public AbstractGangTask { private: - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; public: void work(uint worker_id) { // Since all available tasks are actually started, we should // only proceed if we're supposed to be active. if (worker_id < _cm->active_tasks()) { - CMTask* task = _cm->task(worker_id); + G1CMTask* task = _cm->task(worker_id); task->record_start_time(); { ResourceMark rm; @@ -2230,13 +2231,13 @@ public: } } - CMRemarkTask(ConcurrentMark* cm, uint active_workers) : + G1CMRemarkTask(G1ConcurrentMark* cm, uint active_workers) : AbstractGangTask("Par Remark"), _cm(cm) { _cm->terminator()->reset_for_reuse(active_workers); } }; -void ConcurrentMark::checkpointRootsFinalWork() { +void G1ConcurrentMark::checkpointRootsFinalWork() { ResourceMark rm; HandleMark hm; G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -2249,14 +2250,14 @@ void ConcurrentMark::checkpointRootsFinalWork() { uint active_workers = g1h->workers()->active_workers(); set_concurrency_and_phase(active_workers, false /* concurrent */); // Leave _parallel_marking_threads at it's - // value originally calculated in the ConcurrentMark + // value originally calculated in the G1ConcurrentMark // constructor and pass values of the active workers // through the gang in the task. { StrongRootsScope srs(active_workers); - CMRemarkTask remarkTask(this, active_workers); + G1CMRemarkTask remarkTask(this, active_workers); // We will start all available threads, even if we decide that the // active_workers will be fewer. The extra ones will just bail out // immediately. @@ -2273,14 +2274,14 @@ void ConcurrentMark::checkpointRootsFinalWork() { print_stats(); } -void ConcurrentMark::clearRangePrevBitmap(MemRegion mr) { +void G1ConcurrentMark::clearRangePrevBitmap(MemRegion mr) { // Note we are overriding the read-only view of the prev map here, via // the cast. - ((CMBitMap*)_prevMarkBitMap)->clearRange(mr); + ((G1CMBitMap*)_prevMarkBitMap)->clearRange(mr); } HeapRegion* -ConcurrentMark::claim_region(uint worker_id) { +G1ConcurrentMark::claim_region(uint worker_id) { // "checkpoint" the finger HeapWord* finger = _finger; @@ -2349,7 +2350,7 @@ public: } }; -void ConcurrentMark::verify_no_cset_oops() { +void G1ConcurrentMark::verify_no_cset_oops() { assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint"); if (!G1CollectedHeap::heap()->collector_state()->mark_in_progress()) { return; @@ -2360,7 +2361,7 @@ void ConcurrentMark::verify_no_cset_oops() { // Verify entries on the task queues for (uint i = 0; i < _max_worker_id; ++i) { - CMTaskQueue* queue = _task_queues->queue(i); + G1CMTaskQueue* queue = _task_queues->queue(i); queue->iterate(VerifyNoCSetOops("Queue", i)); } @@ -2378,7 +2379,7 @@ void ConcurrentMark::verify_no_cset_oops() { // Verify the task fingers assert(parallel_marking_threads() <= _max_worker_id, "sanity"); for (uint i = 0; i < parallel_marking_threads(); ++i) { - CMTask* task = _tasks[i]; + G1CMTask* task = _tasks[i]; HeapWord* task_finger = task->finger(); if (task_finger != NULL && task_finger < _heap_end) { // See above note on the global finger verification. @@ -2396,7 +2397,7 @@ void ConcurrentMark::verify_no_cset_oops() { // with marking. class AggregateCountDataHRClosure: public HeapRegionClosure { G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; CardTableModRefBS* _ct_bs; BitMap* _cm_card_bm; uint _max_worker_id; @@ -2491,7 +2492,7 @@ class AggregateCountDataHRClosure: public HeapRegionClosure { class G1AggregateCountDataTask: public AbstractGangTask { protected: G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; BitMap* _cm_card_bm; uint _max_worker_id; uint _active_workers; @@ -2499,7 +2500,7 @@ protected: public: G1AggregateCountDataTask(G1CollectedHeap* g1h, - ConcurrentMark* cm, + G1ConcurrentMark* cm, BitMap* cm_card_bm, uint max_worker_id, uint n_workers) : @@ -2518,7 +2519,7 @@ public: }; -void ConcurrentMark::aggregate_count_data() { +void G1ConcurrentMark::aggregate_count_data() { uint n_workers = _g1h->workers()->active_workers(); G1AggregateCountDataTask g1_par_agg_task(_g1h, this, &_card_bm, @@ -2528,7 +2529,7 @@ void ConcurrentMark::aggregate_count_data() { } // Clear the per-worker arrays used to store the per-region counting data -void ConcurrentMark::clear_all_count_data() { +void G1ConcurrentMark::clear_all_count_data() { // Clear the global card bitmap - it will be filled during // liveness count aggregation (during remark) and the // final counting task. @@ -2553,7 +2554,7 @@ void ConcurrentMark::clear_all_count_data() { } } -void ConcurrentMark::print_stats() { +void G1ConcurrentMark::print_stats() { if (!log_is_enabled(Debug, gc, stats)) { return; } @@ -2565,7 +2566,7 @@ void ConcurrentMark::print_stats() { } // abandon current marking iteration due to a Full GC -void ConcurrentMark::abort() { +void G1ConcurrentMark::abort() { if (!cmThread()->during_cycle() || _has_aborted) { // We haven't started a concurrent cycle or we have already aborted it. No need to do anything. return; @@ -2616,7 +2617,7 @@ static void print_ms_time_info(const char* prefix, const char* name, } } -void ConcurrentMark::print_summary_info() { +void G1ConcurrentMark::print_summary_info() { LogHandle(gc, marking) log; if (!log.is_trace()) { return; @@ -2643,11 +2644,11 @@ void ConcurrentMark::print_summary_info() { cmThread()->vtime_accum(), cmThread()->vtime_mark_accum()); } -void ConcurrentMark::print_worker_threads_on(outputStream* st) const { +void G1ConcurrentMark::print_worker_threads_on(outputStream* st) const { _parallel_workers->print_worker_threads_on(st); } -void ConcurrentMark::print_on_error(outputStream* st) const { +void G1ConcurrentMark::print_on_error(outputStream* st) const { st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT, p2i(_prevMarkBitMap), p2i(_nextMarkBitMap)); _prevMarkBitMap->print_on_error(st, " Prev Bits: "); @@ -2655,7 +2656,7 @@ void ConcurrentMark::print_on_error(outputStream* st) const { } // We take a break if someone is trying to stop the world. -bool ConcurrentMark::do_yield_check(uint worker_id) { +bool G1ConcurrentMark::do_yield_check(uint worker_id) { if (SuspendibleThreadSet::should_yield()) { if (worker_id == 0) { _g1h->g1_policy()->record_concurrent_pause(); @@ -2668,15 +2669,15 @@ bool ConcurrentMark::do_yield_check(uint worker_id) { } // Closure for iteration over bitmaps -class CMBitMapClosure : public BitMapClosure { +class G1CMBitMapClosure : public BitMapClosure { private: // the bitmap that is being iterated over - CMBitMap* _nextMarkBitMap; - ConcurrentMark* _cm; - CMTask* _task; + G1CMBitMap* _nextMarkBitMap; + G1ConcurrentMark* _cm; + G1CMTask* _task; public: - CMBitMapClosure(CMTask *task, ConcurrentMark* cm, CMBitMap* nextMarkBitMap) : + G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm, G1CMBitMap* nextMarkBitMap) : _task(task), _cm(cm), _nextMarkBitMap(nextMarkBitMap) { } bool do_bit(size_t offset) { @@ -2709,13 +2710,13 @@ static ReferenceProcessor* get_cm_oop_closure_ref_processor(G1CollectedHeap* g1h } G1CMOopClosure::G1CMOopClosure(G1CollectedHeap* g1h, - ConcurrentMark* cm, - CMTask* task) + G1ConcurrentMark* cm, + G1CMTask* task) : MetadataAwareOopClosure(get_cm_oop_closure_ref_processor(g1h)), _g1h(g1h), _cm(cm), _task(task) { } -void CMTask::setup_for_region(HeapRegion* hr) { +void G1CMTask::setup_for_region(HeapRegion* hr) { assert(hr != NULL, "claim_region() should have filtered out NULL regions"); _curr_region = hr; @@ -2723,7 +2724,7 @@ void CMTask::setup_for_region(HeapRegion* hr) { update_region_limit(); } -void CMTask::update_region_limit() { +void G1CMTask::update_region_limit() { HeapRegion* hr = _curr_region; HeapWord* bottom = hr->bottom(); HeapWord* limit = hr->next_top_at_mark_start(); @@ -2755,12 +2756,12 @@ void CMTask::update_region_limit() { _region_limit = limit; } -void CMTask::giveup_current_region() { +void G1CMTask::giveup_current_region() { assert(_curr_region != NULL, "invariant"); clear_region_fields(); } -void CMTask::clear_region_fields() { +void G1CMTask::clear_region_fields() { // Values for these three fields that indicate that we're not // holding on to a region. _curr_region = NULL; @@ -2768,7 +2769,7 @@ void CMTask::clear_region_fields() { _region_limit = NULL; } -void CMTask::set_cm_oop_closure(G1CMOopClosure* cm_oop_closure) { +void G1CMTask::set_cm_oop_closure(G1CMOopClosure* cm_oop_closure) { if (cm_oop_closure == NULL) { assert(_cm_oop_closure != NULL, "invariant"); } else { @@ -2777,7 +2778,7 @@ void CMTask::set_cm_oop_closure(G1CMOopClosure* cm_oop_closure) { _cm_oop_closure = cm_oop_closure; } -void CMTask::reset(CMBitMap* nextMarkBitMap) { +void G1CMTask::reset(G1CMBitMap* nextMarkBitMap) { guarantee(nextMarkBitMap != NULL, "invariant"); _nextMarkBitMap = nextMarkBitMap; clear_region_fields(); @@ -2788,7 +2789,7 @@ void CMTask::reset(CMBitMap* nextMarkBitMap) { _termination_start_time_ms = 0.0; } -bool CMTask::should_exit_termination() { +bool G1CMTask::should_exit_termination() { regular_clock_call(); // This is called when we are in the termination protocol. We should // quit if, for some reason, this task wants to abort or the global @@ -2796,14 +2797,14 @@ bool CMTask::should_exit_termination() { return !_cm->mark_stack_empty() || has_aborted(); } -void CMTask::reached_limit() { +void G1CMTask::reached_limit() { assert(_words_scanned >= _words_scanned_limit || _refs_reached >= _refs_reached_limit , "shouldn't have been called otherwise"); regular_clock_call(); } -void CMTask::regular_clock_call() { +void G1CMTask::regular_clock_call() { if (has_aborted()) return; // First, we need to recalculate the words scanned and refs reached @@ -2859,7 +2860,7 @@ void CMTask::regular_clock_call() { } } -void CMTask::recalculate_limits() { +void G1CMTask::recalculate_limits() { _real_words_scanned_limit = _words_scanned + words_scanned_period; _words_scanned_limit = _real_words_scanned_limit; @@ -2867,7 +2868,7 @@ void CMTask::recalculate_limits() { _refs_reached_limit = _real_refs_reached_limit; } -void CMTask::decrease_limits() { +void G1CMTask::decrease_limits() { // This is called when we believe that we're going to do an infrequent // operation which will increase the per byte scanned cost (i.e. move // entries to/from the global stack). It basically tries to decrease the @@ -2879,7 +2880,7 @@ void CMTask::decrease_limits() { 3 * refs_reached_period / 4; } -void CMTask::move_entries_to_global_stack() { +void G1CMTask::move_entries_to_global_stack() { // local array where we'll store the entries that will be popped // from the local queue oop buffer[global_stack_transfer_size]; @@ -2903,7 +2904,7 @@ void CMTask::move_entries_to_global_stack() { decrease_limits(); } -void CMTask::get_entries_from_global_stack() { +void G1CMTask::get_entries_from_global_stack() { // local array where we'll store the entries that will be popped // from the global stack. oop buffer[global_stack_transfer_size]; @@ -2925,7 +2926,7 @@ void CMTask::get_entries_from_global_stack() { decrease_limits(); } -void CMTask::drain_local_queue(bool partially) { +void G1CMTask::drain_local_queue(bool partially) { if (has_aborted()) return; // Decide what the target size is, depending whether we're going to @@ -2957,7 +2958,7 @@ void CMTask::drain_local_queue(bool partially) { } } -void CMTask::drain_global_stack(bool partially) { +void G1CMTask::drain_global_stack(bool partially) { if (has_aborted()) return; // We have a policy to drain the local queue before we attempt to @@ -2989,7 +2990,7 @@ void CMTask::drain_global_stack(bool partially) { // non-par versions of the methods. this is why some of the code is // replicated. We should really get rid of the single-threaded version // of the code to simplify things. -void CMTask::drain_satb_buffers() { +void G1CMTask::drain_satb_buffers() { if (has_aborted()) return; // We set this so that the regular clock knows that we're in the @@ -2998,7 +2999,7 @@ void CMTask::drain_satb_buffers() { // very counter productive if it did that. :-) _draining_satb_buffers = true; - CMSATBBufferClosure satb_cl(this, _g1h); + G1CMSATBBufferClosure satb_cl(this, _g1h); SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set(); // This keeps claiming and applying the closure to completed buffers @@ -3019,7 +3020,7 @@ void CMTask::drain_satb_buffers() { decrease_limits(); } -void CMTask::print_stats() { +void G1CMTask::print_stats() { log_debug(gc, stats)("Marking Stats, task = %u, calls = %d", _worker_id, _calls); log_debug(gc, stats)(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", @@ -3031,7 +3032,7 @@ void CMTask::print_stats() { _step_times_ms.maximum(), _step_times_ms.sum()); } -bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { +bool G1ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { return _task_queues->steal(worker_id, hash_seed, obj); } @@ -3150,9 +3151,9 @@ bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { *****************************************************************************/ -void CMTask::do_marking_step(double time_target_ms, - bool do_termination, - bool is_serial) { +void G1CMTask::do_marking_step(double time_target_ms, + bool do_termination, + bool is_serial) { assert(time_target_ms >= 1.0, "minimum granularity is 1ms"); assert(concurrent() == _cm->concurrent(), "they should be the same"); @@ -3173,7 +3174,7 @@ void CMTask::do_marking_step(double time_target_ms, _start_time_ms = os::elapsedVTime() * 1000.0; // If do_stealing is true then do_marking_step will attempt to - // steal work from the other CMTasks. It only makes sense to + // steal work from the other G1CMTasks. It only makes sense to // enable stealing when the termination protocol is enabled // and do_marking_step() is not being called serially. bool do_stealing = do_termination && !is_serial; @@ -3197,8 +3198,8 @@ void CMTask::do_marking_step(double time_target_ms, // Set up the bitmap and oop closures. Anything that uses them is // eventually called from this method, so it is OK to allocate these // statically. - CMBitMapClosure bitmap_closure(this, _cm, _nextMarkBitMap); - G1CMOopClosure cm_oop_closure(_g1h, _cm, this); + G1CMBitMapClosure bitmap_closure(this, _cm, _nextMarkBitMap); + G1CMOopClosure cm_oop_closure(_g1h, _cm, this); set_cm_oop_closure(&cm_oop_closure); if (_cm->has_overflown()) { @@ -3381,7 +3382,7 @@ void CMTask::do_marking_step(double time_target_ms, assert(_task_queue->size() == 0, "only way to reach here"); _termination_start_time_ms = os::elapsedVTime() * 1000.0; - // The CMTask class also extends the TerminatorTerminator class, + // The G1CMTask class also extends the TerminatorTerminator class, // hence its should_exit_termination() method will also decide // whether to exit the termination protocol or not. bool finished = (is_serial || @@ -3474,12 +3475,12 @@ void CMTask::do_marking_step(double time_target_ms, _claimed = false; } -CMTask::CMTask(uint worker_id, - ConcurrentMark* cm, - size_t* marked_bytes, - BitMap* card_bm, - CMTaskQueue* task_queue, - CMTaskQueueSet* task_queues) +G1CMTask::G1CMTask(uint worker_id, + G1ConcurrentMark* cm, + size_t* marked_bytes, + BitMap* card_bm, + G1CMTaskQueue* task_queue, + G1CMTaskQueueSet* task_queues) : _g1h(G1CollectedHeap::heap()), _worker_id(worker_id), _cm(cm), _claimed(false), diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp similarity index 92% rename from hotspot/src/share/vm/gc/g1/concurrentMark.hpp rename to hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp index 5d195e51cb1..0cce8b70d61 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,8 +22,8 @@ * */ -#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_HPP -#define SHARE_VM_GC_G1_CONCURRENTMARK_HPP +#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP +#define SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP #include "classfile/javaClasses.hpp" #include "gc/g1/g1RegionToSpaceMapper.hpp" @@ -31,11 +31,11 @@ #include "gc/shared/taskqueue.hpp" class G1CollectedHeap; -class CMBitMap; -class CMTask; -class ConcurrentMark; -typedef GenericTaskQueue CMTaskQueue; -typedef GenericTaskQueueSet CMTaskQueueSet; +class G1CMBitMap; +class G1CMTask; +class G1ConcurrentMark; +typedef GenericTaskQueue G1CMTaskQueue; +typedef GenericTaskQueueSet G1CMTaskQueueSet; // Closure used by CM during concurrent reference discovery // and reference processing (during remarking) to determine @@ -54,7 +54,7 @@ class G1CMIsAliveClosure: public BoolObjectClosure { // A generic CM bit map. This is essentially a wrapper around the BitMap // class, with one bit per (1<<_shifter) HeapWords. -class CMBitMapRO VALUE_OBJ_CLASS_SPEC { +class G1CMBitMapRO VALUE_OBJ_CLASS_SPEC { protected: HeapWord* _bmStartWord; // base address of range covered by map size_t _bmWordSize; // map size (in #HeapWords covered) @@ -63,7 +63,7 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC { public: // constructor - CMBitMapRO(int shifter); + G1CMBitMapRO(int shifter); // inquiries HeapWord* startWord() const { return _bmStartWord; } @@ -96,12 +96,7 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC { } // The argument addr should be the start address of a valid object - HeapWord* nextObject(HeapWord* addr) { - oop obj = (oop) addr; - HeapWord* res = addr + obj->size(); - assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity"); - return res; - } + inline HeapWord* nextObject(HeapWord* addr); void print_on_error(outputStream* st, const char* prefix) const; @@ -109,20 +104,20 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC { NOT_PRODUCT(bool covers(MemRegion rs) const;) }; -class CMBitMapMappingChangedListener : public G1MappingChangedListener { +class G1CMBitMapMappingChangedListener : public G1MappingChangedListener { private: - CMBitMap* _bm; + G1CMBitMap* _bm; public: - CMBitMapMappingChangedListener() : _bm(NULL) {} + G1CMBitMapMappingChangedListener() : _bm(NULL) {} - void set_bitmap(CMBitMap* bm) { _bm = bm; } + void set_bitmap(G1CMBitMap* bm) { _bm = bm; } virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled); }; -class CMBitMap : public CMBitMapRO { +class G1CMBitMap : public G1CMBitMapRO { private: - CMBitMapMappingChangedListener _listener; + G1CMBitMapMappingChangedListener _listener; public: static size_t compute_size(size_t heap_size); @@ -134,7 +129,7 @@ class CMBitMap : public CMBitMapRO { return mark_distance(); } - CMBitMap() : CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); } + G1CMBitMap() : G1CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); } // Initializes the underlying BitMap to cover the given area. void initialize(MemRegion heap, G1RegionToSpaceMapper* storage); @@ -151,9 +146,9 @@ class CMBitMap : public CMBitMapRO { }; // Represents a marking stack used by ConcurrentMarking in the G1 collector. -class CMMarkStack VALUE_OBJ_CLASS_SPEC { +class G1CMMarkStack VALUE_OBJ_CLASS_SPEC { VirtualSpace _virtual_space; // Underlying backing store for actual stack - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; oop* _base; // bottom of stack jint _index; // one more than last occupied index jint _capacity; // max #elements @@ -163,8 +158,8 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC { bool _should_expand; public: - CMMarkStack(ConcurrentMark* cm); - ~CMMarkStack(); + G1CMMarkStack(G1ConcurrentMark* cm); + ~G1CMMarkStack(); bool allocate(size_t capacity); @@ -225,19 +220,19 @@ class YoungList; // Currently, we only support root region scanning once (at the start // of the marking cycle) and the root regions are all the survivor // regions populated during the initial-mark pause. -class CMRootRegions VALUE_OBJ_CLASS_SPEC { +class G1CMRootRegions VALUE_OBJ_CLASS_SPEC { private: YoungList* _young_list; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; volatile bool _scan_in_progress; volatile bool _should_abort; HeapRegion* volatile _next_survivor; public: - CMRootRegions(); + G1CMRootRegions(); // We actually do most of the initialization in this method. - void init(G1CollectedHeap* g1h, ConcurrentMark* cm); + void init(G1CollectedHeap* g1h, G1ConcurrentMark* cm); // Reset the claiming / scanning of the root regions. void prepare_for_scan(); @@ -265,19 +260,19 @@ public: class ConcurrentMarkThread; -class ConcurrentMark: public CHeapObj { - friend class CMMarkStack; +class G1ConcurrentMark: public CHeapObj { friend class ConcurrentMarkThread; - friend class CMTask; - friend class CMBitMapClosure; - friend class CMRemarkTask; - friend class CMConcurrentMarkingTask; friend class G1ParNoteEndTask; friend class CalcLiveObjectsClosure; friend class G1CMRefProcTaskProxy; friend class G1CMRefProcTaskExecutor; friend class G1CMKeepAliveAndDrainClosure; friend class G1CMDrainMarkingStackClosure; + friend class G1CMBitMapClosure; + friend class G1CMConcurrentMarkingTask; + friend class G1CMMarkStack; + friend class G1CMRemarkTask; + friend class G1CMTask; protected: ConcurrentMarkThread* _cmThread; // The thread doing the work @@ -295,10 +290,10 @@ protected: FreeRegionList _cleanup_list; // Concurrent marking support structures - CMBitMap _markBitMap1; - CMBitMap _markBitMap2; - CMBitMapRO* _prevMarkBitMap; // Completed mark bitmap - CMBitMap* _nextMarkBitMap; // Under-construction mark bitmap + G1CMBitMap _markBitMap1; + G1CMBitMap _markBitMap2; + G1CMBitMapRO* _prevMarkBitMap; // Completed mark bitmap + G1CMBitMap* _nextMarkBitMap; // Under-construction mark bitmap BitMap _region_bm; BitMap _card_bm; @@ -308,10 +303,10 @@ protected: HeapWord* _heap_end; // Root region tracking and claiming - CMRootRegions _root_regions; + G1CMRootRegions _root_regions; // For gray objects - CMMarkStack _markStack; // Grey objects behind global finger + G1CMMarkStack _markStack; // Grey objects behind global finger HeapWord* volatile _finger; // The global finger, region aligned, // always points to the end of the // last claimed region @@ -319,8 +314,8 @@ protected: // Marking tasks uint _max_worker_id;// Maximum worker id uint _active_tasks; // Task num currently active - CMTask** _tasks; // Task queue array (max_worker_id len) - CMTaskQueueSet* _task_queues; // Task queue set + G1CMTask** _tasks; // Task queue array (max_worker_id len) + G1CMTaskQueueSet* _task_queues; // Task queue set ParallelTaskTerminator _terminator; // For termination // Two sync barriers that are used to synchronize tasks when an @@ -435,21 +430,21 @@ protected: bool out_of_regions() { return _finger >= _heap_end; } // Returns the task with the given id - CMTask* task(int id) { + G1CMTask* task(int id) { assert(0 <= id && id < (int) _active_tasks, "task id not within active bounds"); return _tasks[id]; } // Returns the task queue with the given id - CMTaskQueue* task_queue(int id) { + G1CMTaskQueue* task_queue(int id) { assert(0 <= id && id < (int) _active_tasks, "task queue id not within active bounds"); - return (CMTaskQueue*) _task_queues->queue(id); + return (G1CMTaskQueue*) _task_queues->queue(id); } // Returns the task queue set - CMTaskQueueSet* task_queues() { return _task_queues; } + G1CMTaskQueueSet* task_queues() { return _task_queues; } // Access / manipulation of the overflow flag which is set to // indicate that the global stack has overflown @@ -507,7 +502,7 @@ public: bool mark_stack_overflow() { return _markStack.overflow(); } bool mark_stack_empty() { return _markStack.isEmpty(); } - CMRootRegions* root_regions() { return &_root_regions; } + G1CMRootRegions* root_regions() { return &_root_regions; } bool concurrent_marking_in_progress() { return _concurrent_marking_in_progress; @@ -536,15 +531,15 @@ public: // Attempts to steal an object from the task queues of other tasks bool try_stealing(uint worker_id, int* hash_seed, oop& obj); - ConcurrentMark(G1CollectedHeap* g1h, - G1RegionToSpaceMapper* prev_bitmap_storage, - G1RegionToSpaceMapper* next_bitmap_storage); - ~ConcurrentMark(); + G1ConcurrentMark(G1CollectedHeap* g1h, + G1RegionToSpaceMapper* prev_bitmap_storage, + G1RegionToSpaceMapper* next_bitmap_storage); + ~G1ConcurrentMark(); ConcurrentMarkThread* cmThread() { return _cmThread; } - CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; } - CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; } + G1CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; } + G1CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; } // Returns the number of GC threads to be used in a concurrent // phase based on the number of GC threads being used in a STW @@ -627,14 +622,7 @@ public: // If marking is not in progress, it's a no-op. void verify_no_cset_oops() PRODUCT_RETURN; - bool isPrevMarked(oop p) const { - assert(p != NULL && p->is_oop(), "expected an oop"); - HeapWord* addr = (HeapWord*)p; - assert(addr >= _prevMarkBitMap->startWord() || - addr < _prevMarkBitMap->endWord(), "in a region"); - - return _prevMarkBitMap->isMarked(addr); - } + inline bool isPrevMarked(oop p) const; inline bool do_yield_check(uint worker_i = 0); @@ -740,7 +728,7 @@ protected: }; // A class representing a marking task. -class CMTask : public TerminatorTerminator { +class G1CMTask : public TerminatorTerminator { private: enum PrivateConstants { // the regular clock call is called once the scanned words reaches @@ -758,13 +746,13 @@ private: uint _worker_id; G1CollectedHeap* _g1h; - ConcurrentMark* _cm; - CMBitMap* _nextMarkBitMap; + G1ConcurrentMark* _cm; + G1CMBitMap* _nextMarkBitMap; // the task queue of this task - CMTaskQueue* _task_queue; + G1CMTaskQueue* _task_queue; private: // the task queue set---needed for stealing - CMTaskQueueSet* _task_queues; + G1CMTaskQueueSet* _task_queues; // indicates whether the task has been claimed---this is only for // debugging purposes bool _claimed; @@ -881,7 +869,7 @@ private: public: // It resets the task; it should be called right at the beginning of // a marking phase. - void reset(CMBitMap* _nextMarkBitMap); + void reset(G1CMBitMap* _nextMarkBitMap); // it clears all the fields that correspond to a claimed region. void clear_region_fields(); @@ -968,12 +956,12 @@ public: _finger = new_finger; } - CMTask(uint worker_id, - ConcurrentMark *cm, - size_t* marked_bytes, - BitMap* card_bm, - CMTaskQueue* task_queue, - CMTaskQueueSet* task_queues); + G1CMTask(uint worker_id, + G1ConcurrentMark *cm, + size_t* marked_bytes, + BitMap* card_bm, + G1CMTaskQueue* task_queue, + G1CMTaskQueueSet* task_queues); // it prints statistics associated with this task void print_stats(); @@ -1033,4 +1021,4 @@ public: ~G1PrintRegionLivenessInfoClosure(); }; -#endif // SHARE_VM_GC_G1_CONCURRENTMARK_HPP +#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp similarity index 79% rename from hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp rename to hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp index fe26975cc20..4a934e0b15e 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,19 +22,19 @@ * */ -#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP -#define SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP +#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP +#define SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP -#include "gc/g1/concurrentMark.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" +#include "gc/g1/g1ConcurrentMark.hpp" #include "gc/shared/taskqueue.inline.hpp" // Utility routine to set an exclusive range of cards on the given // card liveness bitmap -inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm, - BitMap::idx_t start_idx, - BitMap::idx_t end_idx, - bool is_par) { +inline void G1ConcurrentMark::set_card_bitmap_range(BitMap* card_bm, + BitMap::idx_t start_idx, + BitMap::idx_t end_idx, + bool is_par) { // Set the exclusive bit range [start_idx, end_idx). assert((end_idx - start_idx) > 0, "at least one card"); @@ -67,7 +67,7 @@ inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm, // Returns the index in the liveness accounting card bitmap // for the given address -inline BitMap::idx_t ConcurrentMark::card_bitmap_index_for(HeapWord* addr) { +inline BitMap::idx_t G1ConcurrentMark::card_bitmap_index_for(HeapWord* addr) { // Below, the term "card num" means the result of shifting an address // by the card shift -- address 0 corresponds to card number 0. One // must subtract the card num of the bottom of the heap to obtain a @@ -78,9 +78,9 @@ inline BitMap::idx_t ConcurrentMark::card_bitmap_index_for(HeapWord* addr) { // Counts the given memory region in the given task/worker // counting data structures. -inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr, - size_t* marked_bytes_array, - BitMap* task_card_bm) { +inline void G1ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr, + size_t* marked_bytes_array, + BitMap* task_card_bm) { G1CollectedHeap* g1h = _g1h; CardTableModRefBS* ct_bs = g1h->g1_barrier_set(); @@ -115,11 +115,11 @@ inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr, } // Counts the given object in the given task/worker counting data structures. -inline void ConcurrentMark::count_object(oop obj, - HeapRegion* hr, - size_t* marked_bytes_array, - BitMap* task_card_bm, - size_t word_size) { +inline void G1ConcurrentMark::count_object(oop obj, + HeapRegion* hr, + size_t* marked_bytes_array, + BitMap* task_card_bm, + size_t word_size) { assert(!hr->is_continues_humongous(), "Cannot enter count_object with continues humongous"); if (!hr->is_starts_humongous()) { MemRegion mr((HeapWord*)obj, word_size); @@ -135,10 +135,10 @@ inline void ConcurrentMark::count_object(oop obj, // Attempts to mark the given object and, if successful, counts // the object in the given task/worker counting structures. -inline bool ConcurrentMark::par_mark_and_count(oop obj, - HeapRegion* hr, - size_t* marked_bytes_array, - BitMap* task_card_bm) { +inline bool G1ConcurrentMark::par_mark_and_count(oop obj, + HeapRegion* hr, + size_t* marked_bytes_array, + BitMap* task_card_bm) { if (_nextMarkBitMap->parMark((HeapWord*)obj)) { // Update the task specific count data for the object. count_object(obj, hr, marked_bytes_array, task_card_bm, obj->size()); @@ -150,10 +150,10 @@ inline bool ConcurrentMark::par_mark_and_count(oop obj, // Attempts to mark the given object and, if successful, counts // the object in the task/worker counting structures for the // given worker id. -inline bool ConcurrentMark::par_mark_and_count(oop obj, - size_t word_size, - HeapRegion* hr, - uint worker_id) { +inline bool G1ConcurrentMark::par_mark_and_count(oop obj, + size_t word_size, + HeapRegion* hr, + uint worker_id) { if (_nextMarkBitMap->parMark((HeapWord*)obj)) { size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id); BitMap* task_card_bm = count_card_bitmap_for(worker_id); @@ -163,7 +163,7 @@ inline bool ConcurrentMark::par_mark_and_count(oop obj, return false; } -inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) { +inline bool G1CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) { HeapWord* start_addr = MAX2(startWord(), mr.start()); HeapWord* end_addr = MIN2(endWord(), mr.end()); @@ -185,6 +185,14 @@ inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) { return true; } +// The argument addr should be the start address of a valid object +HeapWord* G1CMBitMapRO::nextObject(HeapWord* addr) { + oop obj = (oop) addr; + HeapWord* res = addr + obj->size(); + assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity"); + return res; +} + #define check_mark(addr) \ assert(_bmStartWord <= (addr) && (addr) < (_bmStartWord + _bmWordSize), \ "outside underlying space?"); \ @@ -193,17 +201,17 @@ inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) { " corresponding to " PTR_FORMAT " (%u)", \ p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr)); -inline void CMBitMap::mark(HeapWord* addr) { +inline void G1CMBitMap::mark(HeapWord* addr) { check_mark(addr); _bm.set_bit(heapWordToOffset(addr)); } -inline void CMBitMap::clear(HeapWord* addr) { +inline void G1CMBitMap::clear(HeapWord* addr) { check_mark(addr); _bm.clear_bit(heapWordToOffset(addr)); } -inline bool CMBitMap::parMark(HeapWord* addr) { +inline bool G1CMBitMap::parMark(HeapWord* addr) { check_mark(addr); return _bm.par_set_bit(heapWordToOffset(addr)); } @@ -211,7 +219,7 @@ inline bool CMBitMap::parMark(HeapWord* addr) { #undef check_mark template -inline void CMMarkStack::iterate(Fn fn) { +inline void G1CMMarkStack::iterate(Fn fn) { assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index); for (int i = 0; i < _index; ++i) { fn(_base[i]); @@ -219,9 +227,9 @@ inline void CMMarkStack::iterate(Fn fn) { } // It scans an object and visits its children. -inline void CMTask::scan_object(oop obj) { process_grey_object(obj); } +inline void G1CMTask::scan_object(oop obj) { process_grey_object(obj); } -inline void CMTask::push(oop obj) { +inline void G1CMTask::push(oop obj) { HeapWord* objAddr = (HeapWord*) obj; assert(_g1h->is_in_g1_reserved(objAddr), "invariant"); assert(!_g1h->is_on_master_free_list( @@ -242,7 +250,7 @@ inline void CMTask::push(oop obj) { } } -inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const { +inline bool G1CMTask::is_below_finger(oop obj, HeapWord* global_finger) const { // If obj is above the global finger, then the mark bitmap scan // will find it later, and no push is needed. Similarly, if we have // a current region and obj is between the local finger and the @@ -273,7 +281,7 @@ inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const { } template -inline void CMTask::process_grey_object(oop obj) { +inline void G1CMTask::process_grey_object(oop obj) { assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray"); assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant"); @@ -288,10 +296,10 @@ inline void CMTask::process_grey_object(oop obj) { -inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) { +inline void G1CMTask::make_reference_grey(oop obj, HeapRegion* hr) { if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) { // No OrderAccess:store_load() is needed. It is implicit in the - // CAS done in CMBitMap::parMark() call in the routine above. + // CAS done in G1CMBitMap::parMark() call in the routine above. HeapWord* global_finger = _cm->finger(); // We only need to push a newly grey object on the mark @@ -327,7 +335,7 @@ inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) { } } -inline void CMTask::deal_with_reference(oop obj) { +inline void G1CMTask::deal_with_reference(oop obj) { increment_refs_reached(); HeapWord* objAddr = (HeapWord*) obj; @@ -346,15 +354,24 @@ inline void CMTask::deal_with_reference(oop obj) { } } -inline void ConcurrentMark::markPrev(oop p) { +inline void G1ConcurrentMark::markPrev(oop p) { assert(!_prevMarkBitMap->isMarked((HeapWord*) p), "sanity"); // Note we are overriding the read-only view of the prev map here, via // the cast. - ((CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p); + ((G1CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p); } -inline void ConcurrentMark::grayRoot(oop obj, size_t word_size, - uint worker_id, HeapRegion* hr) { +bool G1ConcurrentMark::isPrevMarked(oop p) const { + assert(p != NULL && p->is_oop(), "expected an oop"); + HeapWord* addr = (HeapWord*)p; + assert(addr >= _prevMarkBitMap->startWord() || + addr < _prevMarkBitMap->endWord(), "in a region"); + + return _prevMarkBitMap->isMarked(addr); +} + +inline void G1ConcurrentMark::grayRoot(oop obj, size_t word_size, + uint worker_id, HeapRegion* hr) { assert(obj != NULL, "pre-condition"); HeapWord* addr = (HeapWord*) obj; if (hr == NULL) { @@ -374,4 +391,4 @@ inline void ConcurrentMark::grayRoot(oop obj, size_t word_size, } } -#endif // SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP +#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp index d71a1b941c7..06721ee9295 100644 --- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp +++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * 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,11 +23,12 @@ */ #include "precompiled.hpp" -#include "gc/g1/concurrentMark.inline.hpp" #include "gc/g1/dirtyCardQueue.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorState.hpp" +#include "gc/g1/g1ConcurrentMark.inline.hpp" #include "gc/g1/g1EvacFailure.hpp" +#include "gc/g1/g1HeapVerifier.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1_globals.hpp" #include "gc/g1/heapRegion.hpp" @@ -61,7 +62,7 @@ public: class RemoveSelfForwardPtrObjClosure: public ObjectClosure { private: G1CollectedHeap* _g1; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; HeapRegion* _hr; size_t _marked_bytes; OopsInHeapRegionClosure *_update_rset_cl; @@ -223,7 +224,7 @@ public: if (hr->evacuation_failed()) { hr->note_self_forwarding_removal_start(during_initial_mark, during_conc_mark); - _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr); + _g1h->verifier()->check_bitmaps("Self-Forwarding Ptr Removal", hr); // In the common case (i.e. when there is no evacuation // failure) we make sure that the following is done when diff --git a/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp b/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp index 1db22eb46a9..ca7643f59a8 100644 --- a/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp +++ b/hotspot/src/share/vm/gc/g1/g1EvacFailure.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp index c6b7fed4fdf..706495fdbc7 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp @@ -30,6 +30,7 @@ #include "gc/g1/workerDataArray.inline.hpp" #include "memory/allocation.hpp" #include "logging/log.hpp" +#include "runtime/timer.hpp" #include "runtime/os.hpp" // Helper class for avoiding interleaved logging @@ -125,7 +126,7 @@ G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) : _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray(max_gc_threads, "Queue Fixup:", true, 2); _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray(max_gc_threads, "Table Fixup:", true, 2); - _gc_par_phases[RedirtyCards] = new WorkerDataArray(max_gc_threads, "Parallel Redirty", true, 3); + _gc_par_phases[RedirtyCards] = new WorkerDataArray(max_gc_threads, "Parallel Redirty:", true, 3); _redirtied_cards = new WorkerDataArray(max_gc_threads, "Redirtied Cards:", true, 3); _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards); } @@ -133,6 +134,7 @@ G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) : void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) { assert(active_gc_threads > 0, "The number of threads must be > 0"); assert(active_gc_threads <= _max_gc_threads, "The number of active threads must be <= the max number of threads"); + _gc_start_counter = os::elapsed_counter(); _active_gc_threads = active_gc_threads; _cur_expand_heap_time_ms = 0.0; _external_accounted_time_ms = 0.0; @@ -146,6 +148,7 @@ void G1GCPhaseTimes::note_gc_start(uint active_gc_threads) { } void G1GCPhaseTimes::note_gc_end() { + _gc_pause_time_ms = TimeHelper::counter_to_millis(os::elapsed_counter() - _gc_start_counter); for (uint i = 0; i < _active_gc_threads; i++) { double worker_time = _gc_par_phases[GCWorkerEnd]->get(i) - _gc_par_phases[GCWorkerStart]->get(i); record_time_secs(GCWorkerTotal, i , worker_time); @@ -349,7 +352,7 @@ class G1GCParPhasePrinter : public StackObj { } }; -void G1GCPhaseTimes::print(double pause_time_ms) { +void G1GCPhaseTimes::print() { note_gc_end(); G1GCParPhasePrinter par_phase_printer(this); @@ -373,7 +376,7 @@ void G1GCPhaseTimes::print(double pause_time_ms) { } print_stats(Indents[1], "Clear CT", _cur_clear_ct_time_ms); print_stats(Indents[1], "Expand Heap After Collection", _cur_expand_heap_time_ms); - double misc_time_ms = pause_time_ms - accounted_time_ms(); + double misc_time_ms = _gc_pause_time_ms - accounted_time_ms(); print_stats(Indents[1], "Other", misc_time_ms); if (_cur_verify_before_time_ms > 0.0) { print_stats(Indents[2], "Verify Before", _cur_verify_before_time_ms); diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp index 1e4b166459a..5607c3f4ea0 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp @@ -36,6 +36,8 @@ class G1GCPhaseTimes : public CHeapObj { uint _active_gc_threads; uint _max_gc_threads; + jlong _gc_start_counter; + double _gc_pause_time_ms; public: enum GCParPhases { @@ -126,7 +128,7 @@ class G1GCPhaseTimes : public CHeapObj { public: G1GCPhaseTimes(uint max_gc_threads); void note_gc_start(uint active_gc_threads); - void print(double pause_time_ms); + void print(); // record the time a phase took in seconds void record_time_secs(GCParPhases phase, uint worker_i, double secs); diff --git a/hotspot/src/share/vm/gc/g1/g1HeapTransition.cpp b/hotspot/src/share/vm/gc/g1/g1HeapTransition.cpp new file mode 100644 index 00000000000..8a74f817794 --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1HeapTransition.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#include "precompiled.hpp" +#include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1CollectorPolicy.hpp" +#include "gc/g1/g1HeapTransition.hpp" +#include "logging/log.hpp" +#include "memory/metaspace.hpp" + +G1HeapTransition::Data::Data(G1CollectedHeap* g1_heap) { + YoungList* young_list = g1_heap->young_list(); + _eden_length = young_list->eden_length(); + _survivor_length = young_list->survivor_length(); + _old_length = g1_heap->old_regions_count(); + _humongous_length = g1_heap->humongous_regions_count(); + _metaspace_used_bytes = MetaspaceAux::used_bytes(); +} + +G1HeapTransition::G1HeapTransition(G1CollectedHeap* g1_heap) : _g1_heap(g1_heap), _before(g1_heap) { } + +struct DetailedUsage : public StackObj { + size_t _eden_used; + size_t _survivor_used; + size_t _old_used; + size_t _humongous_used; + + size_t _eden_region_count; + size_t _survivor_region_count; + size_t _old_region_count; + size_t _humongous_region_count; + + DetailedUsage() : + _eden_used(0), _survivor_used(0), _old_used(0), _humongous_used(0), + _eden_region_count(0), _survivor_region_count(0), _old_region_count(0), _humongous_region_count(0) {} +}; + +class DetailedUsageClosure: public HeapRegionClosure { +public: + DetailedUsage _usage; + bool doHeapRegion(HeapRegion* r) { + if (r->is_old()) { + _usage._old_used += r->used(); + _usage._old_region_count++; + } else if (r->is_survivor()) { + _usage._survivor_used += r->used(); + _usage._survivor_region_count++; + } else if (r->is_eden()) { + _usage._eden_used += r->used(); + _usage._eden_region_count++; + } else if (r->is_humongous()) { + _usage._humongous_used += r->used(); + _usage._humongous_region_count++; + } else { + assert(r->used() == 0, "Expected used to be 0 but it was " SIZE_FORMAT, r->used()); + } + return false; + } +}; + +void G1HeapTransition::print() { + Data after(_g1_heap); + + size_t eden_capacity_bytes_after_gc = _g1_heap->g1_policy()->young_list_target_length() - after._survivor_length; + size_t survivor_capacity_bytes_after_gc = _g1_heap->g1_policy()->max_survivor_regions(); + + DetailedUsage usage; + if (log_is_enabled(Trace, gc, heap)) { + DetailedUsageClosure blk; + _g1_heap->heap_region_iterate(&blk); + usage = blk._usage; + assert(usage._eden_region_count == 0, "Expected no eden regions, but got " SIZE_FORMAT, usage._eden_region_count); + assert(usage._survivor_region_count == after._survivor_length, "Expected survivors to be " SIZE_FORMAT " but was " SIZE_FORMAT, + after._survivor_length, usage._survivor_region_count); + assert(usage._old_region_count == after._old_length, "Expected old to be " SIZE_FORMAT " but was " SIZE_FORMAT, + after._old_length, usage._old_region_count); + assert(usage._humongous_region_count == after._humongous_length, "Expected humongous to be " SIZE_FORMAT " but was " SIZE_FORMAT, + after._humongous_length, usage._humongous_region_count); + } + + log_info(gc, heap)("Eden regions: " SIZE_FORMAT "->" SIZE_FORMAT "(" SIZE_FORMAT ")", + _before._eden_length, after._eden_length, eden_capacity_bytes_after_gc); + log_trace(gc, heap)(" Used: 0K, Waste: 0K"); + + log_info(gc, heap)("Survivor regions: " SIZE_FORMAT "->" SIZE_FORMAT "(" SIZE_FORMAT ")", + _before._survivor_length, after._survivor_length, survivor_capacity_bytes_after_gc); + log_trace(gc, heap)(" Used: " SIZE_FORMAT "K, Waste: " SIZE_FORMAT "K", + usage._survivor_used / K, ((after._survivor_length * HeapRegion::GrainBytes) - usage._survivor_used) / K); + + log_info(gc, heap)("Old regions: " SIZE_FORMAT "->" SIZE_FORMAT, + _before._old_length, after._old_length); + log_trace(gc, heap)(" Used: " SIZE_FORMAT "K, Waste: " SIZE_FORMAT "K", + usage._old_used / K, ((after._old_length * HeapRegion::GrainBytes) - usage._old_used) / K); + + log_info(gc, heap)("Humongous regions: " SIZE_FORMAT "->" SIZE_FORMAT, + _before._humongous_length, after._humongous_length); + log_trace(gc, heap)(" Used: " SIZE_FORMAT "K, Waste: " SIZE_FORMAT "K", + usage._humongous_used / K, ((after._humongous_length * HeapRegion::GrainBytes) - usage._humongous_used) / K); + + MetaspaceAux::print_metaspace_change(_before._metaspace_used_bytes); +} diff --git a/hotspot/src/share/vm/gc/g1/g1HeapTransition.hpp b/hotspot/src/share/vm/gc/g1/g1HeapTransition.hpp new file mode 100644 index 00000000000..97db5076997 --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1HeapTransition.hpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_GC_G1_G1HEAPTRANSITION_HPP +#define SHARE_VM_GC_G1_G1HEAPTRANSITION_HPP + +#include "gc/shared/plab.hpp" + +class G1CollectedHeap; + +class G1HeapTransition { + struct Data { + size_t _eden_length; + size_t _survivor_length; + size_t _old_length; + size_t _humongous_length; + size_t _metaspace_used_bytes; + + Data(G1CollectedHeap* g1_heap); + }; + + G1CollectedHeap* _g1_heap; + Data _before; + +public: + G1HeapTransition(G1CollectedHeap* g1_heap); + + void print(); +}; + +#endif // SHARE_VM_GC_G1_G1HEAPTRANSITION_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp new file mode 100644 index 00000000000..8b895582096 --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.cpp @@ -0,0 +1,731 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#include "precompiled.hpp" +#include "logging/log.hpp" +#include "gc/g1/concurrentMarkThread.hpp" +#include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1CollectedHeap.inline.hpp" +#include "gc/g1/g1HeapVerifier.hpp" +#include "gc/g1/g1MarkSweep.hpp" +#include "gc/g1/g1RemSet.hpp" +#include "gc/g1/g1RootProcessor.hpp" +#include "gc/g1/heapRegion.hpp" +#include "gc/g1/heapRegion.inline.hpp" +#include "gc/g1/heapRegionRemSet.hpp" +#include "gc/g1/g1StringDedup.hpp" +#include "gc/g1/youngList.hpp" +#include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" + +class VerifyRootsClosure: public OopClosure { +private: + G1CollectedHeap* _g1h; + VerifyOption _vo; + bool _failures; +public: + // _vo == UsePrevMarking -> use "prev" marking information, + // _vo == UseNextMarking -> use "next" marking information, + // _vo == UseMarkWord -> use mark word from object header. + VerifyRootsClosure(VerifyOption vo) : + _g1h(G1CollectedHeap::heap()), + _vo(vo), + _failures(false) { } + + bool failures() { return _failures; } + + template void do_oop_nv(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + if (_g1h->is_obj_dead_cond(obj, _vo)) { + LogHandle(gc, verify) log; + log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); + if (_vo == VerifyOption_G1UseMarkWord) { + log.info(" Mark word: " PTR_FORMAT, p2i(obj->mark())); + } + ResourceMark rm; + obj->print_on(log.info_stream()); + _failures = true; + } + } + } + + void do_oop(oop* p) { do_oop_nv(p); } + void do_oop(narrowOop* p) { do_oop_nv(p); } +}; + +class G1VerifyCodeRootOopClosure: public OopClosure { + G1CollectedHeap* _g1h; + OopClosure* _root_cl; + nmethod* _nm; + VerifyOption _vo; + bool _failures; + + template void do_oop_work(T* p) { + // First verify that this root is live + _root_cl->do_oop(p); + + if (!G1VerifyHeapRegionCodeRoots) { + // We're not verifying the code roots attached to heap region. + return; + } + + // Don't check the code roots during marking verification in a full GC + if (_vo == VerifyOption_G1UseMarkWord) { + return; + } + + // Now verify that the current nmethod (which contains p) is + // in the code root list of the heap region containing the + // object referenced by p. + + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + + // Now fetch the region containing the object + HeapRegion* hr = _g1h->heap_region_containing(obj); + HeapRegionRemSet* hrrs = hr->rem_set(); + // Verify that the strong code root list for this region + // contains the nmethod + if (!hrrs->strong_code_roots_list_contains(_nm)) { + log_info(gc, verify)("Code root location " PTR_FORMAT " " + "from nmethod " PTR_FORMAT " not in strong " + "code roots for region [" PTR_FORMAT "," PTR_FORMAT ")", + p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); + _failures = true; + } + } + } + +public: + G1VerifyCodeRootOopClosure(G1CollectedHeap* g1h, OopClosure* root_cl, VerifyOption vo): + _g1h(g1h), _root_cl(root_cl), _vo(vo), _nm(NULL), _failures(false) {} + + void do_oop(oop* p) { do_oop_work(p); } + void do_oop(narrowOop* p) { do_oop_work(p); } + + void set_nmethod(nmethod* nm) { _nm = nm; } + bool failures() { return _failures; } +}; + +class G1VerifyCodeRootBlobClosure: public CodeBlobClosure { + G1VerifyCodeRootOopClosure* _oop_cl; + +public: + G1VerifyCodeRootBlobClosure(G1VerifyCodeRootOopClosure* oop_cl): + _oop_cl(oop_cl) {} + + void do_code_blob(CodeBlob* cb) { + nmethod* nm = cb->as_nmethod_or_null(); + if (nm != NULL) { + _oop_cl->set_nmethod(nm); + nm->oops_do(_oop_cl); + } + } +}; + +class YoungRefCounterClosure : public OopClosure { + G1CollectedHeap* _g1h; + int _count; + public: + YoungRefCounterClosure(G1CollectedHeap* g1h) : _g1h(g1h), _count(0) {} + void do_oop(oop* p) { if (_g1h->is_in_young(*p)) { _count++; } } + void do_oop(narrowOop* p) { ShouldNotReachHere(); } + + int count() { return _count; } + void reset_count() { _count = 0; }; +}; + +class VerifyKlassClosure: public KlassClosure { + YoungRefCounterClosure _young_ref_counter_closure; + OopClosure *_oop_closure; + public: + VerifyKlassClosure(G1CollectedHeap* g1h, OopClosure* cl) : _young_ref_counter_closure(g1h), _oop_closure(cl) {} + void do_klass(Klass* k) { + k->oops_do(_oop_closure); + + _young_ref_counter_closure.reset_count(); + k->oops_do(&_young_ref_counter_closure); + if (_young_ref_counter_closure.count() > 0) { + guarantee(k->has_modified_oops(), "Klass " PTR_FORMAT ", has young refs but is not dirty.", p2i(k)); + } + } +}; + +class VerifyLivenessOopClosure: public OopClosure { + G1CollectedHeap* _g1h; + VerifyOption _vo; +public: + VerifyLivenessOopClosure(G1CollectedHeap* g1h, VerifyOption vo): + _g1h(g1h), _vo(vo) + { } + void do_oop(narrowOop *p) { do_oop_work(p); } + void do_oop( oop *p) { do_oop_work(p); } + + template void do_oop_work(T *p) { + oop obj = oopDesc::load_decode_heap_oop(p); + guarantee(obj == NULL || !_g1h->is_obj_dead_cond(obj, _vo), + "Dead object referenced by a not dead object"); + } +}; + +class VerifyObjsInRegionClosure: public ObjectClosure { +private: + G1CollectedHeap* _g1h; + size_t _live_bytes; + HeapRegion *_hr; + VerifyOption _vo; +public: + // _vo == UsePrevMarking -> use "prev" marking information, + // _vo == UseNextMarking -> use "next" marking information, + // _vo == UseMarkWord -> use mark word from object header. + VerifyObjsInRegionClosure(HeapRegion *hr, VerifyOption vo) + : _live_bytes(0), _hr(hr), _vo(vo) { + _g1h = G1CollectedHeap::heap(); + } + void do_object(oop o) { + VerifyLivenessOopClosure isLive(_g1h, _vo); + assert(o != NULL, "Huh?"); + if (!_g1h->is_obj_dead_cond(o, _vo)) { + // If the object is alive according to the mark word, + // then verify that the marking information agrees. + // Note we can't verify the contra-positive of the + // above: if the object is dead (according to the mark + // word), it may not be marked, or may have been marked + // but has since became dead, or may have been allocated + // since the last marking. + if (_vo == VerifyOption_G1UseMarkWord) { + guarantee(!_g1h->is_obj_dead(o), "mark word and concurrent mark mismatch"); + } + + o->oop_iterate_no_header(&isLive); + if (!_hr->obj_allocated_since_prev_marking(o)) { + size_t obj_size = o->size(); // Make sure we don't overflow + _live_bytes += (obj_size * HeapWordSize); + } + } + } + size_t live_bytes() { return _live_bytes; } +}; + +class VerifyArchiveOopClosure: public OopClosure { +public: + VerifyArchiveOopClosure(HeapRegion *hr) { } + void do_oop(narrowOop *p) { do_oop_work(p); } + void do_oop( oop *p) { do_oop_work(p); } + + template void do_oop_work(T *p) { + oop obj = oopDesc::load_decode_heap_oop(p); + guarantee(obj == NULL || G1MarkSweep::in_archive_range(obj), + "Archive object at " PTR_FORMAT " references a non-archive object at " PTR_FORMAT, + p2i(p), p2i(obj)); + } +}; + +class VerifyArchiveRegionClosure: public ObjectClosure { +public: + VerifyArchiveRegionClosure(HeapRegion *hr) { } + // Verify that all object pointers are to archive regions. + void do_object(oop o) { + VerifyArchiveOopClosure checkOop(NULL); + assert(o != NULL, "Should not be here for NULL oops"); + o->oop_iterate_no_header(&checkOop); + } +}; + +class VerifyRegionClosure: public HeapRegionClosure { +private: + bool _par; + VerifyOption _vo; + bool _failures; +public: + // _vo == UsePrevMarking -> use "prev" marking information, + // _vo == UseNextMarking -> use "next" marking information, + // _vo == UseMarkWord -> use mark word from object header. + VerifyRegionClosure(bool par, VerifyOption vo) + : _par(par), + _vo(vo), + _failures(false) {} + + bool failures() { + return _failures; + } + + bool doHeapRegion(HeapRegion* r) { + // For archive regions, verify there are no heap pointers to + // non-pinned regions. For all others, verify liveness info. + if (r->is_archive()) { + VerifyArchiveRegionClosure verify_oop_pointers(r); + r->object_iterate(&verify_oop_pointers); + return true; + } + if (!r->is_continues_humongous()) { + bool failures = false; + r->verify(_vo, &failures); + if (failures) { + _failures = true; + } else if (!r->is_starts_humongous()) { + VerifyObjsInRegionClosure not_dead_yet_cl(r, _vo); + r->object_iterate(¬_dead_yet_cl); + if (_vo != VerifyOption_G1UseNextMarking) { + if (r->max_live_bytes() < not_dead_yet_cl.live_bytes()) { + log_info(gc, verify)("[" PTR_FORMAT "," PTR_FORMAT "] max_live_bytes " SIZE_FORMAT " < calculated " SIZE_FORMAT, + p2i(r->bottom()), p2i(r->end()), r->max_live_bytes(), not_dead_yet_cl.live_bytes()); + _failures = true; + } + } else { + // When vo == UseNextMarking we cannot currently do a sanity + // check on the live bytes as the calculation has not been + // finalized yet. + } + } + } + return false; // stop the region iteration if we hit a failure + } +}; + +// This is the task used for parallel verification of the heap regions + +class G1ParVerifyTask: public AbstractGangTask { +private: + G1CollectedHeap* _g1h; + VerifyOption _vo; + bool _failures; + HeapRegionClaimer _hrclaimer; + +public: + // _vo == UsePrevMarking -> use "prev" marking information, + // _vo == UseNextMarking -> use "next" marking information, + // _vo == UseMarkWord -> use mark word from object header. + G1ParVerifyTask(G1CollectedHeap* g1h, VerifyOption vo) : + AbstractGangTask("Parallel verify task"), + _g1h(g1h), + _vo(vo), + _failures(false), + _hrclaimer(g1h->workers()->active_workers()) {} + + bool failures() { + return _failures; + } + + void work(uint worker_id) { + HandleMark hm; + VerifyRegionClosure blk(true, _vo); + _g1h->heap_region_par_iterate(&blk, worker_id, &_hrclaimer); + if (blk.failures()) { + _failures = true; + } + } +}; + + +void G1HeapVerifier::verify(VerifyOption vo) { + if (!SafepointSynchronize::is_at_safepoint()) { + log_info(gc, verify)("Skipping verification. Not at safepoint."); + } + + assert(Thread::current()->is_VM_thread(), + "Expected to be executed serially by the VM thread at this point"); + + log_debug(gc, verify)("Roots"); + VerifyRootsClosure rootsCl(vo); + VerifyKlassClosure klassCl(_g1h, &rootsCl); + CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false); + + // We apply the relevant closures to all the oops in the + // system dictionary, class loader data graph, the string table + // and the nmethods in the code cache. + G1VerifyCodeRootOopClosure codeRootsCl(_g1h, &rootsCl, vo); + G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); + + { + G1RootProcessor root_processor(_g1h, 1); + root_processor.process_all_roots(&rootsCl, + &cldCl, + &blobsCl); + } + + bool failures = rootsCl.failures() || codeRootsCl.failures(); + + if (vo != VerifyOption_G1UseMarkWord) { + // If we're verifying during a full GC then the region sets + // will have been torn down at the start of the GC. Therefore + // verifying the region sets will fail. So we only verify + // the region sets when not in a full GC. + log_debug(gc, verify)("HeapRegionSets"); + verify_region_sets(); + } + + log_debug(gc, verify)("HeapRegions"); + if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { + + G1ParVerifyTask task(_g1h, vo); + _g1h->workers()->run_task(&task); + if (task.failures()) { + failures = true; + } + + } else { + VerifyRegionClosure blk(false, vo); + _g1h->heap_region_iterate(&blk); + if (blk.failures()) { + failures = true; + } + } + + if (G1StringDedup::is_enabled()) { + log_debug(gc, verify)("StrDedup"); + G1StringDedup::verify(); + } + + if (failures) { + log_info(gc, verify)("Heap after failed verification:"); + // It helps to have the per-region information in the output to + // help us track down what went wrong. This is why we call + // print_extended_on() instead of print_on(). + LogHandle(gc, verify) log; + ResourceMark rm; + _g1h->print_extended_on(log.info_stream()); + } + guarantee(!failures, "there should not have been any failures"); +} + +// Heap region set verification + +class VerifyRegionListsClosure : public HeapRegionClosure { +private: + HeapRegionSet* _old_set; + HeapRegionSet* _humongous_set; + HeapRegionManager* _hrm; + +public: + uint _old_count; + uint _humongous_count; + uint _free_count; + + VerifyRegionListsClosure(HeapRegionSet* old_set, + HeapRegionSet* humongous_set, + HeapRegionManager* hrm) : + _old_set(old_set), _humongous_set(humongous_set), _hrm(hrm), + _old_count(), _humongous_count(), _free_count(){ } + + bool doHeapRegion(HeapRegion* hr) { + if (hr->is_young()) { + // TODO + } else if (hr->is_humongous()) { + assert(hr->containing_set() == _humongous_set, "Heap region %u is humongous but not in humongous set.", hr->hrm_index()); + _humongous_count++; + } else if (hr->is_empty()) { + assert(_hrm->is_free(hr), "Heap region %u is empty but not on the free list.", hr->hrm_index()); + _free_count++; + } else if (hr->is_old()) { + assert(hr->containing_set() == _old_set, "Heap region %u is old but not in the old set.", hr->hrm_index()); + _old_count++; + } else { + // There are no other valid region types. Check for one invalid + // one we can identify: pinned without old or humongous set. + assert(!hr->is_pinned(), "Heap region %u is pinned but not old (archive) or humongous.", hr->hrm_index()); + ShouldNotReachHere(); + } + return false; + } + + void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) { + guarantee(old_set->length() == _old_count, "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count); + guarantee(humongous_set->length() == _humongous_count, "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count); + guarantee(free_list->num_free_regions() == _free_count, "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count); + } +}; + +void G1HeapVerifier::verify_region_sets() { + assert_heap_locked_or_at_safepoint(true /* should_be_vm_thread */); + + // First, check the explicit lists. + _g1h->_hrm.verify(); + { + // Given that a concurrent operation might be adding regions to + // the secondary free list we have to take the lock before + // verifying it. + MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); + _g1h->_secondary_free_list.verify_list(); + } + + // If a concurrent region freeing operation is in progress it will + // be difficult to correctly attributed any free regions we come + // across to the correct free list given that they might belong to + // one of several (free_list, secondary_free_list, any local lists, + // etc.). So, if that's the case we will skip the rest of the + // verification operation. Alternatively, waiting for the concurrent + // operation to complete will have a non-trivial effect on the GC's + // operation (no concurrent operation will last longer than the + // interval between two calls to verification) and it might hide + // any issues that we would like to catch during testing. + if (_g1h->free_regions_coming()) { + return; + } + + // Make sure we append the secondary_free_list on the free_list so + // that all free regions we will come across can be safely + // attributed to the free_list. + _g1h->append_secondary_free_list_if_not_empty_with_lock(); + + // Finally, make sure that the region accounting in the lists is + // consistent with what we see in the heap. + + VerifyRegionListsClosure cl(&_g1h->_old_set, &_g1h->_humongous_set, &_g1h->_hrm); + _g1h->heap_region_iterate(&cl); + cl.verify_counts(&_g1h->_old_set, &_g1h->_humongous_set, &_g1h->_hrm); +} + +void G1HeapVerifier::prepare_for_verify() { + if (SafepointSynchronize::is_at_safepoint() || ! UseTLAB) { + _g1h->ensure_parsability(false); + } + _g1h->g1_rem_set()->prepare_for_verify(); +} + +double G1HeapVerifier::verify(bool guard, const char* msg) { + double verify_time_ms = 0.0; + + if (guard && _g1h->total_collections() >= VerifyGCStartAt) { + double verify_start = os::elapsedTime(); + HandleMark hm; // Discard invalid handles created during verification + prepare_for_verify(); + Universe::verify(VerifyOption_G1UsePrevMarking, msg); + verify_time_ms = (os::elapsedTime() - verify_start) * 1000; + } + + return verify_time_ms; +} + +void G1HeapVerifier::verify_before_gc() { + double verify_time_ms = verify(VerifyBeforeGC, "Before GC"); + _g1h->g1_policy()->phase_times()->record_verify_before_time_ms(verify_time_ms); +} + +void G1HeapVerifier::verify_after_gc() { + double verify_time_ms = verify(VerifyAfterGC, "After GC"); + _g1h->g1_policy()->phase_times()->record_verify_after_time_ms(verify_time_ms); +} + + +#ifndef PRODUCT +class G1VerifyCardTableCleanup: public HeapRegionClosure { + G1HeapVerifier* _verifier; + G1SATBCardTableModRefBS* _ct_bs; +public: + G1VerifyCardTableCleanup(G1HeapVerifier* verifier, G1SATBCardTableModRefBS* ct_bs) + : _verifier(verifier), _ct_bs(ct_bs) { } + virtual bool doHeapRegion(HeapRegion* r) { + if (r->is_survivor()) { + _verifier->verify_dirty_region(r); + } else { + _verifier->verify_not_dirty_region(r); + } + return false; + } +}; + +void G1HeapVerifier::verify_card_table_cleanup() { + if (G1VerifyCTCleanup || VerifyAfterGC) { + G1VerifyCardTableCleanup cleanup_verifier(this, _g1h->g1_barrier_set()); + _g1h->heap_region_iterate(&cleanup_verifier); + } +} + +void G1HeapVerifier::verify_not_dirty_region(HeapRegion* hr) { + // All of the region should be clean. + G1SATBCardTableModRefBS* ct_bs = _g1h->g1_barrier_set(); + MemRegion mr(hr->bottom(), hr->end()); + ct_bs->verify_not_dirty_region(mr); +} + +void G1HeapVerifier::verify_dirty_region(HeapRegion* hr) { + // We cannot guarantee that [bottom(),end()] is dirty. Threads + // dirty allocated blocks as they allocate them. The thread that + // retires each region and replaces it with a new one will do a + // maximal allocation to fill in [pre_dummy_top(),end()] but will + // not dirty that area (one less thing to have to do while holding + // a lock). So we can only verify that [bottom(),pre_dummy_top()] + // is dirty. + G1SATBCardTableModRefBS* ct_bs = _g1h->g1_barrier_set(); + MemRegion mr(hr->bottom(), hr->pre_dummy_top()); + if (hr->is_young()) { + ct_bs->verify_g1_young_region(mr); + } else { + ct_bs->verify_dirty_region(mr); + } +} + +void G1HeapVerifier::verify_dirty_young_list(HeapRegion* head) { + G1SATBCardTableModRefBS* ct_bs = _g1h->g1_barrier_set(); + for (HeapRegion* hr = head; hr != NULL; hr = hr->get_next_young_region()) { + verify_dirty_region(hr); + } +} + +void G1HeapVerifier::verify_dirty_young_regions() { + verify_dirty_young_list(_g1h->young_list()->first_region()); +} + +bool G1HeapVerifier::verify_no_bits_over_tams(const char* bitmap_name, G1CMBitMapRO* bitmap, + HeapWord* tams, HeapWord* end) { + guarantee(tams <= end, + "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end)); + HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); + if (result < end) { + log_info(gc, verify)("## wrong marked address on %s bitmap: " PTR_FORMAT, bitmap_name, p2i(result)); + log_info(gc, verify)("## %s tams: " PTR_FORMAT " end: " PTR_FORMAT, bitmap_name, p2i(tams), p2i(end)); + return false; + } + return true; +} + +bool G1HeapVerifier::verify_bitmaps(const char* caller, HeapRegion* hr) { + G1CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap(); + G1CMBitMapRO* next_bitmap = (G1CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap(); + + HeapWord* bottom = hr->bottom(); + HeapWord* ptams = hr->prev_top_at_mark_start(); + HeapWord* ntams = hr->next_top_at_mark_start(); + HeapWord* end = hr->end(); + + bool res_p = verify_no_bits_over_tams("prev", prev_bitmap, ptams, end); + + bool res_n = true; + // We reset mark_in_progress() before we reset _cmThread->in_progress() and in this window + // we do the clearing of the next bitmap concurrently. Thus, we can not verify the bitmap + // if we happen to be in that state. + if (_g1h->collector_state()->mark_in_progress() || !_g1h->_cmThread->in_progress()) { + res_n = verify_no_bits_over_tams("next", next_bitmap, ntams, end); + } + if (!res_p || !res_n) { + log_info(gc, verify)("#### Bitmap verification failed for " HR_FORMAT, HR_FORMAT_PARAMS(hr)); + log_info(gc, verify)("#### Caller: %s", caller); + return false; + } + return true; +} + +void G1HeapVerifier::check_bitmaps(const char* caller, HeapRegion* hr) { + if (!G1VerifyBitmaps) return; + + guarantee(verify_bitmaps(caller, hr), "bitmap verification"); +} + +class G1VerifyBitmapClosure : public HeapRegionClosure { +private: + const char* _caller; + G1HeapVerifier* _verifier; + bool _failures; + +public: + G1VerifyBitmapClosure(const char* caller, G1HeapVerifier* verifier) : + _caller(caller), _verifier(verifier), _failures(false) { } + + bool failures() { return _failures; } + + virtual bool doHeapRegion(HeapRegion* hr) { + bool result = _verifier->verify_bitmaps(_caller, hr); + if (!result) { + _failures = true; + } + return false; + } +}; + +void G1HeapVerifier::check_bitmaps(const char* caller) { + if (!G1VerifyBitmaps) return; + + G1VerifyBitmapClosure cl(caller, this); + _g1h->heap_region_iterate(&cl); + guarantee(!cl.failures(), "bitmap verification"); +} + +class G1CheckCSetFastTableClosure : public HeapRegionClosure { + private: + bool _failures; + public: + G1CheckCSetFastTableClosure() : HeapRegionClosure(), _failures(false) { } + + virtual bool doHeapRegion(HeapRegion* hr) { + uint i = hr->hrm_index(); + InCSetState cset_state = (InCSetState) G1CollectedHeap::heap()->_in_cset_fast_test.get_by_index(i); + if (hr->is_humongous()) { + if (hr->in_collection_set()) { + log_info(gc, verify)("## humongous region %u in CSet", i); + _failures = true; + return true; + } + if (cset_state.is_in_cset()) { + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i); + _failures = true; + return true; + } + if (hr->is_continues_humongous() && cset_state.is_humongous()) { + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i); + _failures = true; + return true; + } + } else { + if (cset_state.is_humongous()) { + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i); + _failures = true; + return true; + } + if (hr->in_collection_set() != cset_state.is_in_cset()) { + log_info(gc, verify)("## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->in_collection_set(), cset_state.value(), i); + _failures = true; + return true; + } + if (cset_state.is_in_cset()) { + if (hr->is_young() != (cset_state.is_young())) { + log_info(gc, verify)("## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->is_young(), cset_state.value(), i); + _failures = true; + return true; + } + if (hr->is_old() != (cset_state.is_old())) { + log_info(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->is_old(), cset_state.value(), i); + _failures = true; + return true; + } + } + } + return false; + } + + bool failures() const { return _failures; } +}; + +bool G1HeapVerifier::check_cset_fast_test() { + G1CheckCSetFastTableClosure cl; + _g1h->_hrm.iterate(&cl); + return !cl.failures(); +} +#endif // PRODUCT diff --git a/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp new file mode 100644 index 00000000000..4d6aa684093 --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_GC_G1_G1HEAPVERIFIER_HPP +#define SHARE_VM_GC_G1_G1HEAPVERIFIER_HPP + +#include "gc/g1/heapRegionSet.hpp" +#include "memory/allocation.hpp" +#include "memory/universe.hpp" + +class G1CollectedHeap; + +class G1HeapVerifier : public CHeapObj { +private: + G1CollectedHeap* _g1h; + + // verify_region_sets() performs verification over the region + // lists. It will be compiled in the product code to be used when + // necessary (i.e., during heap verification). + void verify_region_sets(); + +public: + + G1HeapVerifier(G1CollectedHeap* heap) : _g1h(heap) { } + + // Perform verification. + + // vo == UsePrevMarking -> use "prev" marking information, + // vo == UseNextMarking -> use "next" marking information + // vo == UseMarkWord -> use the mark word in the object header + // + // NOTE: Only the "prev" marking information is guaranteed to be + // consistent most of the time, so most calls to this should use + // vo == UsePrevMarking. + // Currently, there is only one case where this is called with + // vo == UseNextMarking, which is to verify the "next" marking + // information at the end of remark. + // Currently there is only one place where this is called with + // vo == UseMarkWord, which is to verify the marking during a + // full GC. + void verify(VerifyOption vo); + + // verify_region_sets_optional() is planted in the code for + // list verification in non-product builds (and it can be enabled in + // product builds by defining HEAP_REGION_SET_FORCE_VERIFY to be 1). +#if HEAP_REGION_SET_FORCE_VERIFY + void verify_region_sets_optional() { + verify_region_sets(); + } +#else // HEAP_REGION_SET_FORCE_VERIFY + void verify_region_sets_optional() { } +#endif // HEAP_REGION_SET_FORCE_VERIFY + + void prepare_for_verify(); + double verify(bool guard, const char* msg); + void verify_before_gc(); + void verify_after_gc(); + +#ifndef PRODUCT + // Make sure that the given bitmap has no marked objects in the + // range [from,limit). If it does, print an error message and return + // false. Otherwise, just return true. bitmap_name should be "prev" + // or "next". + bool verify_no_bits_over_tams(const char* bitmap_name, G1CMBitMapRO* bitmap, + HeapWord* from, HeapWord* limit); + + // Verify that the prev / next bitmap range [tams,end) for the given + // region has no marks. Return true if all is well, false if errors + // are detected. + bool verify_bitmaps(const char* caller, HeapRegion* hr); +#endif // PRODUCT + + // If G1VerifyBitmaps is set, verify that the marking bitmaps for + // the given region do not have any spurious marks. If errors are + // detected, print appropriate error messages and crash. + void check_bitmaps(const char* caller, HeapRegion* hr) PRODUCT_RETURN; + + // If G1VerifyBitmaps is set, verify that the marking bitmaps do not + // have any spurious marks. If errors are detected, print + // appropriate error messages and crash. + void check_bitmaps(const char* caller) PRODUCT_RETURN; + + // Do sanity check on the contents of the in-cset fast test table. + bool check_cset_fast_test() PRODUCT_RETURN_( return true; ); + + void verify_card_table_cleanup() PRODUCT_RETURN; + + void verify_not_dirty_region(HeapRegion* hr) PRODUCT_RETURN; + void verify_dirty_region(HeapRegion* hr) PRODUCT_RETURN; + void verify_dirty_young_list(HeapRegion* head) PRODUCT_RETURN; + void verify_dirty_young_regions() PRODUCT_RETURN; +}; + +#endif // SHARE_VM_GC_G1_G1HEAPVERIFIER_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index 2ba19e33d6c..05f90f75f4e 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,12 +31,12 @@ class HeapRegion; class G1CollectedHeap; class G1RemSet; -class ConcurrentMark; +class G1ConcurrentMark; class DirtyCardToOopClosure; -class CMBitMap; -class CMMarkStack; +class G1CMBitMap; +class G1CMMarkStack; class G1ParScanThreadState; -class CMTask; +class G1CMTask; class ReferenceProcessor; // A class that scans oops in a given heap region (much as OopsInGenClosure @@ -92,7 +92,7 @@ protected: G1ParScanThreadState* _par_scan_state; uint _worker_id; // Cache value from par_scan_state. Klass* _scanned_klass; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; // Mark the object if it's not already marked. This is used to mark // objects pointed to by roots that are guaranteed not to move @@ -170,12 +170,12 @@ public: // Closure for iterating over object fields during concurrent marking class G1CMOopClosure : public MetadataAwareOopClosure { protected: - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; private: G1CollectedHeap* _g1h; - CMTask* _task; + G1CMTask* _task; public: - G1CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task); + G1CMOopClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm, G1CMTask* task); template void do_oop_nv(T* p); virtual void do_oop( oop* p) { do_oop_nv(p); } virtual void do_oop(narrowOop* p) { do_oop_nv(p); } @@ -185,10 +185,10 @@ public: class G1RootRegionScanClosure : public MetadataAwareOopClosure { private: G1CollectedHeap* _g1h; - ConcurrentMark* _cm; + G1ConcurrentMark* _cm; uint _worker_id; public: - G1RootRegionScanClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, + G1RootRegionScanClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm, uint worker_id) : _g1h(g1h), _cm(cm), _worker_id(worker_id) { } template void do_oop_nv(T* p); @@ -206,9 +206,9 @@ class G1Mux2Closure : public OopClosure { OopClosure* _c2; public: G1Mux2Closure(OopClosure *c1, OopClosure *c2); - template void do_oop_work(T* p); - virtual void do_oop(oop* p) { do_oop_work(p); } - virtual void do_oop(narrowOop* p) { do_oop_work(p); } + template inline void do_oop_work(T* p); + virtual inline void do_oop(oop* p); + virtual inline void do_oop(narrowOop* p); }; // A closure that returns true if it is actually applied @@ -219,9 +219,9 @@ class G1TriggerClosure : public OopClosure { public: G1TriggerClosure(); bool triggered() const { return _triggered; } - template void do_oop_work(T* p); - virtual void do_oop(oop* p) { do_oop_work(p); } - virtual void do_oop(narrowOop* p) { do_oop_work(p); } + template inline void do_oop_work(T* p); + virtual inline void do_oop(oop* p); + virtual inline void do_oop(narrowOop* p); }; // A closure which uses a triggering closure to determine @@ -232,9 +232,9 @@ class G1InvokeIfNotTriggeredClosure: public OopClosure { OopClosure* _oop_cl; public: G1InvokeIfNotTriggeredClosure(G1TriggerClosure* t, OopClosure* oc); - template void do_oop_work(T* p); - virtual void do_oop(oop* p) { do_oop_work(p); } - virtual void do_oop(narrowOop* p) { do_oop_work(p); } + template inline void do_oop_work(T* p); + virtual inline void do_oop(oop* p); + virtual inline void do_oop(narrowOop* p); }; class G1UpdateRSOrPushRefOopClosure: public OopClosure { @@ -263,9 +263,9 @@ public: return result; } - template void do_oop_work(T* p); - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } + template inline void do_oop_work(T* p); + virtual inline void do_oop(narrowOop* p); + virtual inline void do_oop(oop* p); }; #endif // SHARE_VM_GC_G1_G1OOPCLOSURES_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index b65002af6b4..06289683254 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ #ifndef SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP #define SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP -#include "gc/g1/concurrentMark.inline.hpp" #include "gc/g1/g1CollectedHeap.hpp" +#include "gc/g1/g1ConcurrentMark.inline.hpp" #include "gc/g1/g1OopClosures.hpp" #include "gc/g1/g1ParScanThreadState.inline.hpp" #include "gc/g1/g1RemSet.hpp" @@ -141,12 +141,16 @@ inline void G1Mux2Closure::do_oop_work(T* p) { _c1->do_oop(p); _c2->do_oop(p); } +void G1Mux2Closure::do_oop(oop* p) { do_oop_work(p); } +void G1Mux2Closure::do_oop(narrowOop* p) { do_oop_work(p); } template inline void G1TriggerClosure::do_oop_work(T* p) { // Record that this closure was actually applied (triggered). _triggered = true; } +void G1TriggerClosure::do_oop(oop* p) { do_oop_work(p); } +void G1TriggerClosure::do_oop(narrowOop* p) { do_oop_work(p); } template inline void G1InvokeIfNotTriggeredClosure::do_oop_work(T* p) { @@ -154,6 +158,8 @@ inline void G1InvokeIfNotTriggeredClosure::do_oop_work(T* p) { _oop_cl->do_oop(p); } } +void G1InvokeIfNotTriggeredClosure::do_oop(oop* p) { do_oop_work(p); } +void G1InvokeIfNotTriggeredClosure::do_oop(narrowOop* p) { do_oop_work(p); } template inline void G1UpdateRSOrPushRefOopClosure::do_oop_work(T* p) { @@ -224,6 +230,8 @@ inline void G1UpdateRSOrPushRefOopClosure::do_oop_work(T* p) { to->rem_set()->add_reference(p, _worker_i); } } +void G1UpdateRSOrPushRefOopClosure::do_oop(oop* p) { do_oop_work(p); } +void G1UpdateRSOrPushRefOopClosure::do_oop(narrowOop* p) { do_oop_work(p); } template void G1ParCopyHelper::do_klass_barrier(T* p, oop new_obj) { diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 9258d575a95..40e3959c886 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -34,6 +34,7 @@ #include "gc/g1/g1HotCardCache.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1RemSet.inline.hpp" +#include "gc/g1/g1SATBCardTableModRefBS.inline.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionManager.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp index 8cd76fd9ffc..5b226d1d5a4 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp @@ -221,7 +221,7 @@ public: class HRRSStatsIter: public HeapRegionClosure { private: RegionTypeCounter _young; - RegionTypeCounter _humonguous; + RegionTypeCounter _humongous; RegionTypeCounter _free; RegionTypeCounter _old; RegionTypeCounter _all; @@ -245,7 +245,7 @@ private: HeapRegion* max_code_root_mem_sz_region() const { return _max_code_root_mem_sz_region; } public: - HRRSStatsIter() : _all("All"), _young("Young"), _humonguous("Humonguous"), + HRRSStatsIter() : _all("All"), _young("Young"), _humongous("Humongous"), _free("Free"), _old("Old"), _max_code_root_mem_sz_region(NULL), _max_rs_mem_sz_region(NULL), _max_rs_mem_sz(0), _max_code_root_mem_sz(0) {} @@ -274,7 +274,7 @@ public: } else if (r->is_young()) { current = &_young; } else if (r->is_humongous()) { - current = &_humonguous; + current = &_humongous; } else if (r->is_old()) { current = &_old; } else { @@ -287,7 +287,7 @@ public: } void print_summary_on(outputStream* out) { - RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL }; + RegionTypeCounter* counters[] = { &_young, &_humongous, &_free, &_old, NULL }; out->print_cr(" Current rem set statistics"); out->print_cr(" Total per region rem sets sizes = " SIZE_FORMAT "K." diff --git a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp index 5cd8b594e8e..c701b700c6a 100644 --- a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include "precompiled.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" -#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#include "gc/g1/g1SATBCardTableModRefBS.inline.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/g1/satbMarkQueue.hpp" #include "gc/shared/memset_with_concurrent_readers.hpp" diff --git a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.hpp index d08d36f43ca..d07d6c507b0 100644 --- a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.hpp +++ b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,20 +58,11 @@ public: // We export this to make it available in cases where the static // type of the barrier set is known. Note that it is non-virtual. - template inline void inline_write_ref_field_pre(T* field, oop newVal) { - T heap_oop = oopDesc::load_heap_oop(field); - if (!oopDesc::is_null(heap_oop)) { - enqueue(oopDesc::decode_heap_oop(heap_oop)); - } - } + template inline void inline_write_ref_field_pre(T* field, oop newVal); // These are the more general virtual versions. - virtual void write_ref_field_pre_work(oop* field, oop new_val) { - inline_write_ref_field_pre(field, new_val); - } - virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) { - inline_write_ref_field_pre(field, new_val); - } + inline virtual void write_ref_field_pre_work(oop* field, oop new_val); + inline virtual void write_ref_field_pre_work(narrowOop* field, oop new_val); virtual void write_ref_field_pre_work(void* field, oop new_val) { guarantee(false, "Not needed"); } @@ -98,15 +89,7 @@ public: return (val & (clean_card_mask_val() | claimed_card_val())) == claimed_card_val(); } - void set_card_claimed(size_t card_index) { - jbyte val = _byte_map[card_index]; - if (val == clean_card_val()) { - val = (jbyte)claimed_card_val(); - } else { - val |= (jbyte)claimed_card_val(); - } - _byte_map[card_index] = val; - } + inline void set_card_claimed(size_t card_index); void verify_g1_young_region(MemRegion mr) PRODUCT_RETURN; void g1_mark_as_young(const MemRegion& mr); diff --git a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.inline.hpp b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.inline.hpp new file mode 100644 index 00000000000..ae81d54cdee --- /dev/null +++ b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.inline.hpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_INLINE_HPP +#define SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_INLINE_HPP + +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#include "oops/oop.inline.hpp" + +// We export this to make it available in cases where the static +// type of the barrier set is known. Note that it is non-virtual. +template void G1SATBCardTableModRefBS::inline_write_ref_field_pre(T* field, oop newVal) { + T heap_oop = oopDesc::load_heap_oop(field); + if (!oopDesc::is_null(heap_oop)) { + enqueue(oopDesc::decode_heap_oop(heap_oop)); + } +} + +// These are the more general virtual versions. +void G1SATBCardTableModRefBS::write_ref_field_pre_work(oop* field, oop new_val) { + inline_write_ref_field_pre(field, new_val); +} +void G1SATBCardTableModRefBS::write_ref_field_pre_work(narrowOop* field, oop new_val) { + inline_write_ref_field_pre(field, new_val); +} + +void G1SATBCardTableModRefBS::set_card_claimed(size_t card_index) { + jbyte val = _byte_map[card_index]; + if (val == clean_card_val()) { + val = (jbyte)claimed_card_val(); + } else { + val |= (jbyte)claimed_card_val(); + } + _byte_map[card_index] = val; +} + +#endif // SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.cpp b/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.cpp index cc0506da12a..b511b04617f 100644 --- a/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.cpp +++ b/hotspot/src/share/vm/gc/g1/g1YoungRemSetSamplingThread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,9 +61,8 @@ G1YoungRemSetSamplingThread::G1YoungRemSetSamplingThread() : ConcurrentGCThread( true, Monitor::_safepoint_check_never); - create_and_start(); - set_name("G1 Young RemSet Sampling"); + create_and_start(); } void G1YoungRemSetSamplingThread::sleep_before_next_cycle() { diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index 8ade4641c36..3c52afb166f 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -143,6 +143,7 @@ void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_hea // The cast to int is safe, given that we've bounded region_size by // MIN_REGION_SIZE and MAX_REGION_SIZE. GrainBytes = region_size; + log_info(gc, heap)("Heap region size: " SIZE_FORMAT "M", GrainBytes / M); guarantee(GrainWords == 0, "we should only set it once"); GrainWords = GrainBytes >> LogHeapWordSize; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 30fed52f93c..26d5ce3e7e0 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,7 +110,9 @@ protected: public: - HeapRegion* hr() const { return _hr; } + HeapRegion* hr() const { + return (HeapRegion*) OrderAccess::load_ptr_acquire(&_hr); + } jint occupied() const { // Overkill, but if we ever need it... @@ -123,10 +125,12 @@ public: set_next(NULL); set_prev(NULL); } - _hr = hr; _collision_list_next = NULL; _occupied = 0; _bm.clear(); + // Make sure that the bitmap clearing above has been finished before publishing + // this PRT to concurrent threads. + OrderAccess::release_store_ptr(&_hr, hr); } void add_reference(OopOrNarrowOopStar from) { @@ -357,7 +361,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) { int from_card = (int)(uintptr_t(from) >> CardTableModRefBS::card_shift); if (G1FromCardCache::contains_or_replace(tid, cur_hrm_ind, from_card)) { - assert(contains_reference(from), "We just added it!"); + assert(contains_reference(from), "We just found " PTR_FORMAT " in the FromCardCache", p2i(from)); return; } @@ -367,7 +371,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) { // If the region is already coarsened, return. if (_coarse_map.at(from_hrm_ind)) { - assert(contains_reference(from), "We just added it!"); + assert(contains_reference(from), "We just found " PTR_FORMAT " in the Coarse table", p2i(from)); return; } @@ -388,7 +392,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) { "Must be in range."); if (G1HRRSUseSparseTable && _sparse_table.add_card(from_hrm_ind, card_index)) { - assert(contains_reference_locked(from), "We just added it!"); + assert(contains_reference_locked(from), "We just added " PTR_FORMAT " to the Sparse table", p2i(from)); return; } @@ -438,7 +442,7 @@ void OtherRegionsTable::add_reference(OopOrNarrowOopStar from, uint tid) { assert(prt != NULL, "Inv"); prt->add_reference(from); - assert(contains_reference(from), "We just added it!"); + assert(contains_reference(from), "We just added " PTR_FORMAT " to the PRT", p2i(from)); } PerRegionTable* @@ -785,6 +789,9 @@ void HeapRegionRemSet::scrub(CardTableModRefBS* ctbs, void HeapRegionRemSet::add_strong_code_root(nmethod* nm) { assert(nm != NULL, "sanity"); + assert((!CodeCache_lock->owned_by_self() || SafepointSynchronize::is_at_safepoint()), + "should call add_strong_code_root_locked instead. CodeCache_lock->owned_by_self(): %s, is_at_safepoint(): %s", + BOOL_TO_STR(CodeCache_lock->owned_by_self()), BOOL_TO_STR(SafepointSynchronize::is_at_safepoint())); // Optimistic unlocked contains-check if (!_code_roots.contains(nm)) { MutexLockerEx ml(&_m, Mutex::_no_safepoint_check_flag); @@ -794,6 +801,12 @@ void HeapRegionRemSet::add_strong_code_root(nmethod* nm) { void HeapRegionRemSet::add_strong_code_root_locked(nmethod* nm) { assert(nm != NULL, "sanity"); + assert((CodeCache_lock->owned_by_self() || + (SafepointSynchronize::is_at_safepoint() && + (_m.owned_by_self() || Thread::current()->is_VM_thread()))), + "not safely locked. CodeCache_lock->owned_by_self(): %s, is_at_safepoint(): %s, _m.owned_by_self(): %s, Thread::current()->is_VM_thread(): %s", + BOOL_TO_STR(CodeCache_lock->owned_by_self()), BOOL_TO_STR(SafepointSynchronize::is_at_safepoint()), + BOOL_TO_STR(_m.owned_by_self()), BOOL_TO_STR(Thread::current()->is_VM_thread())); _code_roots.add(nm); } diff --git a/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp b/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp index 130e51ab5d5..b0fea5ba6fe 100644 --- a/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * 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 "gc/parallel/asPSYoungGen.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/psMarkSweepDecorator.hpp" -#include "gc/parallel/psScavenge.hpp" +#include "gc/parallel/psScavenge.inline.hpp" #include "gc/parallel/psYoungGen.hpp" #include "gc/shared/gcUtil.hpp" #include "gc/shared/spaceDecorator.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp index 083fb2a2fb0..d4be1aa0639 100644 --- a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include "precompiled.hpp" #include "gc/parallel/cardTableExtension.hpp" #include "gc/parallel/gcTaskManager.hpp" +#include "gc/parallel/objectStartArray.inline.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/psPromotionManager.inline.hpp" #include "gc/parallel/psScavenge.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/objectStartArray.cpp b/hotspot/src/share/vm/gc/parallel/objectStartArray.cpp index 81d9d1bb833..ef871aad915 100644 --- a/hotspot/src/share/vm/gc/parallel/objectStartArray.cpp +++ b/hotspot/src/share/vm/gc/parallel/objectStartArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "gc/parallel/objectStartArray.hpp" +#include "gc/parallel/objectStartArray.inline.hpp" #include "gc/shared/cardTableModRefBS.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" @@ -123,7 +123,6 @@ void ObjectStartArray::reset() { memset(_blocks_region.start(), clean_block, _blocks_region.byte_size()); } - bool ObjectStartArray::object_starts_in_range(HeapWord* start_addr, HeapWord* end_addr) const { assert(start_addr <= end_addr, diff --git a/hotspot/src/share/vm/gc/parallel/objectStartArray.hpp b/hotspot/src/share/vm/gc/parallel/objectStartArray.hpp index 3c51c4e12d0..3b801c8f63d 100644 --- a/hotspot/src/share/vm/gc/parallel/objectStartArray.hpp +++ b/hotspot/src/share/vm/gc/parallel/objectStartArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -139,23 +139,7 @@ class ObjectStartArray : public CHeapObj { // a given block. The blocks contain the offset of the last // object in that block. Scroll backwards by one, and the first // object hit should be at the beginning of the block - HeapWord* object_start(HeapWord* addr) const { - assert_covered_region_contains(addr); - jbyte* block = block_for_addr(addr); - HeapWord* scroll_forward = offset_addr_for_block(block--); - while (scroll_forward > addr) { - scroll_forward = offset_addr_for_block(block--); - } - - HeapWord* next = scroll_forward; - while (next <= addr) { - scroll_forward = next; - next += oop(next)->size(); - } - assert(scroll_forward <= addr, "wrong order for current and arg"); - assert(addr <= next, "wrong order for arg and next"); - return scroll_forward; - } + inline HeapWord* object_start(HeapWord* addr) const; bool is_block_allocated(HeapWord* addr) { assert_covered_region_contains(addr); @@ -165,7 +149,6 @@ class ObjectStartArray : public CHeapObj { return true; } -#undef assert_covered_region_contains // Return true if an object starts in the range of heap addresses. // If an object starts at an address corresponding to diff --git a/hotspot/src/share/vm/gc/parallel/objectStartArray.inline.hpp b/hotspot/src/share/vm/gc/parallel/objectStartArray.inline.hpp new file mode 100644 index 00000000000..53d9fea5fd6 --- /dev/null +++ b/hotspot/src/share/vm/gc/parallel/objectStartArray.inline.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_GC_PARALLEL_OBJECTSTARTARRAY_INLINE_HPP +#define SHARE_VM_GC_PARALLEL_OBJECTSTARTARRAY_INLINE_HPP + +#include "gc/parallel/objectStartArray.hpp" + +// Optimized for finding the first object that crosses into +// a given block. The blocks contain the offset of the last +// object in that block. Scroll backwards by one, and the first +// object hit should be at the beginning of the block +HeapWord* ObjectStartArray::object_start(HeapWord* addr) const { + assert_covered_region_contains(addr); + jbyte* block = block_for_addr(addr); + HeapWord* scroll_forward = offset_addr_for_block(block--); + while (scroll_forward > addr) { + scroll_forward = offset_addr_for_block(block--); + } + + HeapWord* next = scroll_forward; + while (next <= addr) { + scroll_forward = next; + next += oop(next)->size(); + } + assert(scroll_forward <= addr, "wrong order for current and arg"); + assert(addr <= next, "wrong order for arg and next"); + return scroll_forward; +} + + +#endif // SHARE_VM_GC_PARALLEL_OBJECTSTARTARRAY_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp b/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp index 0e6ec57b18c..569ff9ecbb1 100644 --- a/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parMarkBitMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #include "precompiled.hpp" #include "gc/parallel/parMarkBitMap.hpp" -#include "gc/parallel/psParallelCompact.hpp" +#include "gc/parallel/psCompactionManager.inline.hpp" +#include "gc/parallel/psParallelCompact.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/os.hpp" @@ -96,7 +97,20 @@ ParMarkBitMap::mark_obj(HeapWord* addr, size_t size) return false; } -size_t ParMarkBitMap::live_words_in_range(HeapWord* beg_addr, oop end_obj) const +inline bool +ParMarkBitMap::is_live_words_in_range_in_cache(ParCompactionManager* cm, HeapWord* beg_addr) const { + return cm->last_query_begin() == beg_addr; +} + +inline void +ParMarkBitMap::update_live_words_in_range_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj, size_t result) const { + cm->set_last_query_begin(beg_addr); + cm->set_last_query_object(end_obj); + cm->set_last_query_return(result); +} + +size_t +ParMarkBitMap::live_words_in_range_helper(HeapWord* beg_addr, oop end_obj) const { assert(beg_addr <= (HeapWord*)end_obj, "bad range"); assert(is_marked(end_obj), "end_obj must be live"); @@ -117,6 +131,42 @@ size_t ParMarkBitMap::live_words_in_range(HeapWord* beg_addr, oop end_obj) const return bits_to_words(live_bits); } +size_t +ParMarkBitMap::live_words_in_range_use_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const +{ + HeapWord* last_beg = cm->last_query_begin(); + oop last_obj = cm->last_query_object(); + size_t last_ret = cm->last_query_return(); + if (end_obj > last_obj) { + last_ret = last_ret + live_words_in_range_helper((HeapWord*)last_obj, end_obj); + last_obj = end_obj; + } else if (end_obj < last_obj) { + // The cached value is for an object that is to the left (lower address) of the current + // end_obj. Calculate back from that cached value. + if (pointer_delta((HeapWord*)end_obj, (HeapWord*)beg_addr) > pointer_delta((HeapWord*)last_obj, (HeapWord*)end_obj)) { + last_ret = last_ret - live_words_in_range_helper((HeapWord*)end_obj, last_obj); + } else { + last_ret = live_words_in_range_helper(beg_addr, end_obj); + } + last_obj = end_obj; + } + + update_live_words_in_range_cache(cm, last_beg, last_obj, last_ret); + return last_ret; +} + +size_t +ParMarkBitMap::live_words_in_range(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const +{ + // Try to reuse result from ParCompactionManager cache first. + if (is_live_words_in_range_in_cache(cm, beg_addr)) { + return live_words_in_range_use_cache(cm, beg_addr, end_obj); + } + size_t ret = live_words_in_range_helper(beg_addr, end_obj); + update_live_words_in_range_cache(cm, beg_addr, end_obj, ret); + return ret; +} + ParMarkBitMap::IterationStatus ParMarkBitMap::iterate(ParMarkBitMapClosure* live_closure, idx_t range_beg, idx_t range_end) const diff --git a/hotspot/src/share/vm/gc/parallel/parMarkBitMap.hpp b/hotspot/src/share/vm/gc/parallel/parMarkBitMap.hpp index acf2f917d59..3f29f94fc97 100644 --- a/hotspot/src/share/vm/gc/parallel/parMarkBitMap.hpp +++ b/hotspot/src/share/vm/gc/parallel/parMarkBitMap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ class ParMarkBitMapClosure; class PSVirtualSpace; +class ParCompactionManager; class ParMarkBitMap: public CHeapObj { @@ -124,7 +125,7 @@ public: // the range are included in the result. The end of the range must be a live object, // which is the case when updating pointers. This allows a branch to be removed // from inside the loop. - size_t live_words_in_range(HeapWord* beg_addr, oop end_obj) const; + size_t live_words_in_range(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const; inline HeapWord* region_start() const; inline HeapWord* region_end() const; @@ -167,6 +168,12 @@ public: #endif // #ifdef ASSERT private: + size_t live_words_in_range_helper(HeapWord* beg_addr, oop end_obj) const; + + bool is_live_words_in_range_in_cache(ParCompactionManager* cm, HeapWord* beg_addr) const; + size_t live_words_in_range_use_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj) const; + void update_live_words_in_range_cache(ParCompactionManager* cm, HeapWord* beg_addr, oop end_obj, size_t result) const; + // Each bit in the bitmap represents one unit of 'object granularity.' Objects // are double-word aligned in 32-bit VMs, but not in 64-bit VMs, so the 32-bit // granularity is 2, 64-bit is 1. diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp index cfe23356b5a..76d2e0abd2d 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ #include "gc/parallel/cardTableExtension.hpp" #include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/generationSizer.hpp" +#include "gc/parallel/objectStartArray.inline.hpp" #include "gc/parallel/parallelScavengeHeap.inline.hpp" #include "gc/parallel/psAdaptiveSizePolicy.hpp" #include "gc/parallel/psMarkSweep.hpp" -#include "gc/parallel/psParallelCompact.hpp" +#include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/parallel/psPromotionManager.hpp" #include "gc/parallel/psScavenge.hpp" #include "gc/parallel/vmPSOperations.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp index 261098b0c49..433b4dc2a06 100644 --- a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +68,8 @@ ParCompactionManager::ParCompactionManager() : marking_stack()->initialize(); _objarray_stack.initialize(); + + reset_bitmap_query_cache(); } ParCompactionManager::~ParCompactionManager() { @@ -124,6 +126,13 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) { "Not initialized?"); } +void ParCompactionManager::reset_all_bitmap_query_caches() { + uint parallel_gc_threads = PSParallelCompact::gc_task_manager()->workers(); + for (uint i=0; i<=parallel_gc_threads; i++) { + _manager_array[i]->reset_bitmap_query_cache(); + } +} + int ParCompactionManager::pop_recycled_stack_index() { assert(_recycled_bottom <= _recycled_top, "list is empty"); // Get the next available index diff --git a/hotspot/src/share/vm/gc/parallel/psCompactionManager.hpp b/hotspot/src/share/vm/gc/parallel/psCompactionManager.hpp index be680ae4197..9e35ff29d9e 100644 --- a/hotspot/src/share/vm/gc/parallel/psCompactionManager.hpp +++ b/hotspot/src/share/vm/gc/parallel/psCompactionManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,6 +109,10 @@ private: Action _action; + HeapWord* _last_query_beg; + oop _last_query_obj; + size_t _last_query_ret; + static PSOldGen* old_gen() { return _old_gen; } static ObjectStartArray* start_array() { return _start_array; } static OopTaskQueueSet* stack_array() { return _stack_array; } @@ -127,9 +131,26 @@ private: // marking stack and overflow stack directly. public: + void reset_bitmap_query_cache() { + _last_query_beg = NULL; + _last_query_obj = NULL; + _last_query_ret = 0; + } + Action action() { return _action; } void set_action(Action v) { _action = v; } + // Bitmap query support, cache last query and result + HeapWord* last_query_begin() { return _last_query_beg; } + oop last_query_object() { return _last_query_obj; } + size_t last_query_return() { return _last_query_ret; } + + void set_last_query_begin(HeapWord *new_beg) { _last_query_beg = new_beg; } + void set_last_query_object(oop new_obj) { _last_query_obj = new_obj; } + void set_last_query_return(size_t new_ret) { _last_query_ret = new_ret; } + + static void reset_all_bitmap_query_caches(); + RegionTaskQueue* region_stack() { return _region_stack; } void set_region_stack(RegionTaskQueue* v) { _region_stack = v; } diff --git a/hotspot/src/share/vm/gc/parallel/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc/parallel/psCompactionManager.inline.hpp index 7ba99f95ede..7def8417b42 100644 --- a/hotspot/src/share/vm/gc/parallel/psCompactionManager.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psCompactionManager.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,7 +144,7 @@ inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) { } inline void ParCompactionManager::update_contents(oop obj) { - obj->pc_update_contents(); + obj->pc_update_contents(this); } #endif // SHARE_VM_GC_PARALLEL_PSCOMPACTIONMANAGER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp index 4b8bcf77c71..928aa85bed0 100644 --- a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -99,7 +99,7 @@ void PSMarkSweep::invoke(bool maximum_heap_compaction) { heap->collector_policy()->should_clear_all_soft_refs(); uint count = maximum_heap_compaction ? 1 : MarkSweepAlwaysCompactCount; - UIntXFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count); + UIntFlagSetting flag_setting(MarkSweepAlwaysCompactCount, count); PSMarkSweep::invoke_no_policy(clear_all_soft_refs || maximum_heap_compaction); } @@ -156,8 +156,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { old_gen->verify_object_start_array(); } - heap->pre_full_gc_dump(_gc_timer); - // Filled in below to track the state of the young gen after the collection. bool eden_empty; bool survivors_empty; @@ -168,6 +166,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { GCTraceCPUTime tcpu; GCTraceTime(Info, gc) t("Pause Full", NULL, gc_cause, true); + + heap->pre_full_gc_dump(_gc_timer); + TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); @@ -345,6 +346,8 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { // Track memory usage and detect low memory MemoryService::track_memory_usage(); heap->update_counters(); + + heap->post_full_gc_dump(_gc_timer); } if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { @@ -367,8 +370,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { heap->print_heap_after_gc(); heap->trace_heap_after_gc(_gc_tracer); - heap->post_full_gc_dump(_gc_timer); - #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); #endif diff --git a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp index 0a89c5f9d22..f567fe03e9a 100644 --- a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +23,7 @@ */ #include "precompiled.hpp" +#include "gc/parallel/objectStartArray.inline.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/psAdaptiveSizePolicy.hpp" #include "gc/parallel/psMarkSweepDecorator.hpp" diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp index 2198705943a..75c67c25b78 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -195,7 +195,7 @@ const char* PSParallelCompact::space_names[] = { }; void PSParallelCompact::print_region_ranges() { - if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + if (!log_develop_is_enabled(Trace, gc, compaction, phases)) { return; } LogHandle(gc, compaction, phases) log; @@ -265,7 +265,7 @@ void print_generic_summary_data(ParallelCompactData& summary_data, SpaceInfo* space_info) { - if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + if (!log_develop_is_enabled(Trace, gc, compaction, phases)) { return; } @@ -360,7 +360,7 @@ print_initial_summary_data(ParallelCompactData& summary_data, void print_initial_summary_data(ParallelCompactData& summary_data, SpaceInfo* space_info) { - if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + if (!log_develop_is_enabled(Trace, gc, compaction, phases)) { return; } @@ -641,7 +641,7 @@ ParallelCompactData::summarize_split_space(size_t src_region, *target_next = split_destination + partial_obj_size; HeapWord* const source_next = region_to_addr(split_region) + partial_obj_size; - if (develop_log_is_enabled(Trace, gc, compaction, phases)) { + if (log_develop_is_enabled(Trace, gc, compaction, phases)) { const char * split_type = partial_obj_size == 0 ? "easy" : "hard"; log_develop_trace(gc, compaction, phases)("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT " pos=" SIZE_FORMAT, split_type, p2i(source_next), split_region, partial_obj_size); @@ -751,7 +751,7 @@ bool ParallelCompactData::summarize(SplitInfo& split_info, return true; } -HeapWord* ParallelCompactData::calc_new_pointer(HeapWord* addr) { +HeapWord* ParallelCompactData::calc_new_pointer(HeapWord* addr, ParCompactionManager* cm) { assert(addr != NULL, "Should detect NULL oop earlier"); assert(ParallelScavengeHeap::heap()->is_in(addr), "not in heap"); assert(PSParallelCompact::mark_bitmap()->is_marked(addr), "not marked"); @@ -788,7 +788,7 @@ HeapWord* ParallelCompactData::calc_new_pointer(HeapWord* addr) { const size_t block_offset = addr_to_block_ptr(addr)->offset(); const ParMarkBitMap* bitmap = PSParallelCompact::mark_bitmap(); - const size_t live = bitmap->live_words_in_range(search_start, oop(addr)); + const size_t live = bitmap->live_words_in_range(cm, search_start, oop(addr)); result += block_offset + live; DEBUG_ONLY(PSParallelCompact::check_new_location(addr, result)); return result; @@ -825,11 +825,9 @@ PSParallelCompact::IsAliveClosure PSParallelCompact::_is_alive_closure; bool PSParallelCompact::IsAliveClosure::do_object_b(oop p) { return mark_bitmap()->is_marked(p); } -PSParallelCompact::AdjustPointerClosure PSParallelCompact::_adjust_pointer_closure; -PSParallelCompact::AdjustKlassClosure PSParallelCompact::_adjust_klass_closure; - void PSParallelCompact::AdjustKlassClosure::do_klass(Klass* klass) { - klass->oops_do(&PSParallelCompact::_adjust_pointer_closure); + PSParallelCompact::AdjustPointerClosure closure(_cm); + klass->oops_do(&closure); } void PSParallelCompact::post_initialize() { @@ -977,6 +975,8 @@ void PSParallelCompact::pre_compact() // Have worker threads release resources the next time they run a task. gc_task_manager()->release_all_resources(); + + ParCompactionManager::reset_all_bitmap_query_caches(); } void PSParallelCompact::post_compact() @@ -1535,7 +1535,7 @@ PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction) } } - if (develop_log_is_enabled(Trace, gc, compaction, phases)) { + if (log_develop_is_enabled(Trace, gc, compaction, phases)) { const size_t region_size = ParallelCompactData::RegionSize; HeapWord* const dense_prefix_end = _space_info[id].dense_prefix(); const size_t dp_region = _summary_data.addr_to_region_idx(dense_prefix_end); @@ -1746,8 +1746,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->record_gen_tops_before_GC(); } - heap->pre_full_gc_dump(&_gc_timer); - // Make sure data structures are sane, make the heap parsable, and do other // miscellaneous bookkeeping. pre_compact(); @@ -1768,6 +1766,9 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { GCTraceCPUTime tcpu; GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true); + + heap->pre_full_gc_dump(&_gc_timer); + TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); @@ -1801,7 +1802,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { // adjust_roots() updates Universe::_intArrayKlassObj which is // needed by the compaction for filling holes in the dense prefix. - adjust_roots(); + adjust_roots(vmthread_cm); compaction_start.update(); compact(); @@ -1902,6 +1903,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { MemoryService::track_memory_usage(); heap->update_counters(); gc_task_manager()->release_idle_workers(); + + heap->post_full_gc_dump(&_gc_timer); } #ifdef ASSERT @@ -1940,8 +1943,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { collection_exit.ticks()); gc_task_manager()->print_task_time_stamps(); - heap->post_full_gc_dump(&_gc_timer); - #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); #endif @@ -2142,39 +2143,42 @@ public: }; static PSAlwaysTrueClosure always_true; -void PSParallelCompact::adjust_roots() { +void PSParallelCompact::adjust_roots(ParCompactionManager* cm) { // Adjust the pointers to reflect the new locations GCTraceTime(Trace, gc, phases) tm("Adjust Roots", &_gc_timer); // Need new claim bits when tracing through and adjusting pointers. ClassLoaderDataGraph::clear_claimed_marks(); + PSParallelCompact::AdjustPointerClosure oop_closure(cm); + PSParallelCompact::AdjustKlassClosure klass_closure(cm); + // General strong roots. - Universe::oops_do(adjust_pointer_closure()); - JNIHandles::oops_do(adjust_pointer_closure()); // Global (strong) JNI handles - CLDToOopClosure adjust_from_cld(adjust_pointer_closure()); - Threads::oops_do(adjust_pointer_closure(), &adjust_from_cld, NULL); - ObjectSynchronizer::oops_do(adjust_pointer_closure()); - FlatProfiler::oops_do(adjust_pointer_closure()); - Management::oops_do(adjust_pointer_closure()); - JvmtiExport::oops_do(adjust_pointer_closure()); - SystemDictionary::oops_do(adjust_pointer_closure()); - ClassLoaderDataGraph::oops_do(adjust_pointer_closure(), adjust_klass_closure(), true); + Universe::oops_do(&oop_closure); + JNIHandles::oops_do(&oop_closure); // Global (strong) JNI handles + CLDToOopClosure adjust_from_cld(&oop_closure); + Threads::oops_do(&oop_closure, &adjust_from_cld, NULL); + ObjectSynchronizer::oops_do(&oop_closure); + FlatProfiler::oops_do(&oop_closure); + Management::oops_do(&oop_closure); + JvmtiExport::oops_do(&oop_closure); + SystemDictionary::oops_do(&oop_closure); + ClassLoaderDataGraph::oops_do(&oop_closure, &klass_closure, true); // Now adjust pointers in remaining weak roots. (All of which should // have been cleared if they pointed to non-surviving objects.) // Global (weak) JNI handles - JNIHandles::weak_oops_do(&always_true, adjust_pointer_closure()); + JNIHandles::weak_oops_do(&always_true, &oop_closure); - CodeBlobToOopClosure adjust_from_blobs(adjust_pointer_closure(), CodeBlobToOopClosure::FixRelocations); + CodeBlobToOopClosure adjust_from_blobs(&oop_closure, CodeBlobToOopClosure::FixRelocations); CodeCache::blobs_do(&adjust_from_blobs); - StringTable::oops_do(adjust_pointer_closure()); - ref_processor()->weak_oops_do(adjust_pointer_closure()); + StringTable::oops_do(&oop_closure); + ref_processor()->weak_oops_do(&oop_closure); // Roots were visited so references into the young gen in roots // may have been scanned. Process them also. // Should the reference processor have a span that excludes // young gen objects? - PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure()); + PSScavenge::reference_processor()->weak_oops_do(&oop_closure); } // Helper class to print 8 region numbers per line and then print the total at the end. @@ -2187,7 +2191,7 @@ private: bool _enabled; size_t _total_regions; public: - FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(develop_log_is_enabled(Trace, gc, compaction)) { } + FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)) { } ~FillableRegionLogger() { log.trace(SIZE_FORMAT " initially fillable regions", _total_regions); } @@ -2378,7 +2382,7 @@ void PSParallelCompact::enqueue_region_stealing_tasks( // region. void PSParallelCompact::write_block_fill_histogram() { - if (!develop_log_is_enabled(Trace, gc, compaction)) { + if (!log_develop_is_enabled(Trace, gc, compaction)) { return; } @@ -3062,18 +3066,20 @@ void MoveAndUpdateClosure::copy_partial_obj() update_state(words); } -void InstanceKlass::oop_pc_update_pointers(oop obj) { - oop_oop_iterate_oop_maps(obj, PSParallelCompact::adjust_pointer_closure()); +void InstanceKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { + PSParallelCompact::AdjustPointerClosure closure(cm); + oop_oop_iterate_oop_maps(obj, &closure); } -void InstanceMirrorKlass::oop_pc_update_pointers(oop obj) { - InstanceKlass::oop_pc_update_pointers(obj); +void InstanceMirrorKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { + InstanceKlass::oop_pc_update_pointers(obj, cm); - oop_oop_iterate_statics(obj, PSParallelCompact::adjust_pointer_closure()); + PSParallelCompact::AdjustPointerClosure closure(cm); + oop_oop_iterate_statics(obj, &closure); } -void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj) { - InstanceKlass::oop_pc_update_pointers(obj); +void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { + InstanceKlass::oop_pc_update_pointers(obj, cm); } #ifdef ASSERT @@ -3092,33 +3098,34 @@ template static void trace_reference_gc(const char *s, oop obj, #endif template -static void oop_pc_update_pointers_specialized(oop obj) { +static void oop_pc_update_pointers_specialized(oop obj, ParCompactionManager* cm) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); - PSParallelCompact::adjust_pointer(referent_addr); + PSParallelCompact::adjust_pointer(referent_addr, cm); T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj); - PSParallelCompact::adjust_pointer(next_addr); + PSParallelCompact::adjust_pointer(next_addr, cm); T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - PSParallelCompact::adjust_pointer(discovered_addr); + PSParallelCompact::adjust_pointer(discovered_addr, cm); debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj, referent_addr, next_addr, discovered_addr);) } -void InstanceRefKlass::oop_pc_update_pointers(oop obj) { - InstanceKlass::oop_pc_update_pointers(obj); +void InstanceRefKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { + InstanceKlass::oop_pc_update_pointers(obj, cm); if (UseCompressedOops) { - oop_pc_update_pointers_specialized(obj); + oop_pc_update_pointers_specialized(obj, cm); } else { - oop_pc_update_pointers_specialized(obj); + oop_pc_update_pointers_specialized(obj, cm); } } -void ObjArrayKlass::oop_pc_update_pointers(oop obj) { +void ObjArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { assert(obj->is_objArray(), "obj must be obj array"); - oop_oop_iterate_elements(objArrayOop(obj), PSParallelCompact::adjust_pointer_closure()); + PSParallelCompact::AdjustPointerClosure closure(cm); + oop_oop_iterate_elements(objArrayOop(obj), &closure); } -void TypeArrayKlass::oop_pc_update_pointers(oop obj) { +void TypeArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { assert(obj->is_typeArray(),"must be a type array"); } @@ -3128,7 +3135,7 @@ MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) { assert(bitmap()->obj_size(addr) == words, "bad size"); _source = addr; - assert(PSParallelCompact::summary_data().calc_new_pointer(source()) == + assert(PSParallelCompact::summary_data().calc_new_pointer(source(), compaction_manager()) == destination(), "wrong destination"); if (words > words_remaining()) { @@ -3169,3 +3176,14 @@ UpdateOnlyClosure::do_addr(HeapWord* addr, size_t words) { do_addr(addr); return ParMarkBitMap::incomplete; } + +ParMarkBitMapClosure::IterationStatus +FillClosure::do_addr(HeapWord* addr, size_t size) { + CollectedHeap::fill_with_objects(addr, size); + HeapWord* const end = addr + size; + do { + _start_array->allocate_block(addr); + addr += oop(addr)->size(); + } while (addr < end); + return ParMarkBitMap::incomplete; +} diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp index 76e55666d34..ec695e04a88 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -451,10 +451,10 @@ public: HeapWord* partial_obj_end(size_t region_idx) const; // Return the location of the object after compaction. - HeapWord* calc_new_pointer(HeapWord* addr); + HeapWord* calc_new_pointer(HeapWord* addr, ParCompactionManager* cm); - HeapWord* calc_new_pointer(oop p) { - return calc_new_pointer((HeapWord*) p); + HeapWord* calc_new_pointer(oop p, ParCompactionManager* cm) { + return calc_new_pointer((HeapWord*) p, cm); } #ifdef ASSERT @@ -937,17 +937,29 @@ class PSParallelCompact : AllStatic { class AdjustPointerClosure: public ExtendedOopClosure { public: + AdjustPointerClosure(ParCompactionManager* cm) { + assert(cm != NULL, "associate ParCompactionManage should not be NULL"); + _cm = cm; + } template void do_oop_nv(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); // This closure provides its own oop verification code. debug_only(virtual bool should_verify_oops() { return false; }) + private: + ParCompactionManager* _cm; }; class AdjustKlassClosure : public KlassClosure { public: + AdjustKlassClosure(ParCompactionManager* cm) { + assert(cm != NULL, "associate ParCompactionManage should not be NULL"); + _cm = cm; + } void do_klass(Klass* klass); + private: + ParCompactionManager* _cm; }; friend class AdjustPointerClosure; @@ -966,8 +978,6 @@ class PSParallelCompact : AllStatic { static ParallelCompactData _summary_data; static IsAliveClosure _is_alive_closure; static SpaceInfo _space_info[last_space_id]; - static AdjustPointerClosure _adjust_pointer_closure; - static AdjustKlassClosure _adjust_klass_closure; // Reference processing (used in ...follow_contents) static ReferenceProcessor* _ref_processor; @@ -1063,7 +1073,7 @@ class PSParallelCompact : AllStatic { static void summary_phase(ParCompactionManager* cm, bool maximum_compaction); // Adjust addresses in roots. Does not adjust addresses in heap. - static void adjust_roots(); + static void adjust_roots(ParCompactionManager* cm); DEBUG_ONLY(static void write_block_fill_histogram();) @@ -1109,10 +1119,6 @@ class PSParallelCompact : AllStatic { static bool initialize(); // Closure accessors - static PSParallelCompact::AdjustPointerClosure* adjust_pointer_closure() { - return &_adjust_pointer_closure; - } - static KlassClosure* adjust_klass_closure() { return (KlassClosure*)&_adjust_klass_closure; } static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&_is_alive_closure; } // Public accessors @@ -1127,7 +1133,7 @@ class PSParallelCompact : AllStatic { static inline bool mark_obj(oop obj); static inline bool is_marked(oop obj); - template static inline void adjust_pointer(T* p); + template static inline void adjust_pointer(T* p, ParCompactionManager* cm); // Compaction support. // Return true if p is in the range [beg_addr, end_addr). @@ -1242,16 +1248,6 @@ class PSParallelCompact : AllStatic { #endif // #ifdef ASSERT }; -inline bool PSParallelCompact::mark_obj(oop obj) { - const int obj_size = obj->size(); - if (mark_bitmap()->mark_obj(obj, obj_size)) { - _summary_data.add_obj(obj, obj_size); - return true; - } else { - return false; - } -} - inline bool PSParallelCompact::is_marked(oop obj) { return mark_bitmap()->is_marked(obj); } @@ -1386,9 +1382,8 @@ class UpdateOnlyClosure: public ParMarkBitMapClosure { inline void do_addr(HeapWord* addr); }; -class FillClosure: public ParMarkBitMapClosure -{ -public: +class FillClosure: public ParMarkBitMapClosure { + public: FillClosure(ParCompactionManager* cm, PSParallelCompact::SpaceId space_id) : ParMarkBitMapClosure(PSParallelCompact::mark_bitmap(), cm), _start_array(PSParallelCompact::start_array(space_id)) @@ -1397,17 +1392,9 @@ public: "cannot use FillClosure in the young gen"); } - virtual IterationStatus do_addr(HeapWord* addr, size_t size) { - CollectedHeap::fill_with_objects(addr, size); - HeapWord* const end = addr + size; - do { - _start_array->allocate_block(addr); - addr += oop(addr)->size(); - } while (addr < end); - return ParMarkBitMap::incomplete; - } + virtual IterationStatus do_addr(HeapWord* addr, size_t size); -private: + private: ObjectStartArray* const _start_array; }; diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.inline.hpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.inline.hpp index 43063fd154e..dfb2ac0d53a 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * 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,14 +31,24 @@ #include "oops/klass.hpp" #include "oops/oop.inline.hpp" +inline bool PSParallelCompact::mark_obj(oop obj) { + const int obj_size = obj->size(); + if (mark_bitmap()->mark_obj(obj, obj_size)) { + _summary_data.add_obj(obj, obj_size); + return true; + } else { + return false; + } +} + template -inline void PSParallelCompact::adjust_pointer(T* p) { +inline void PSParallelCompact::adjust_pointer(T* p, ParCompactionManager* cm) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); assert(ParallelScavengeHeap::heap()->is_in(obj), "should be in heap"); - oop new_obj = (oop)summary_data().calc_new_pointer(obj); + oop new_obj = (oop)summary_data().calc_new_pointer(obj, cm); assert(new_obj != NULL, // is forwarding ptr? "should be forwarded"); // Just always do the update unconditionally? @@ -52,7 +62,7 @@ inline void PSParallelCompact::adjust_pointer(T* p) { template void PSParallelCompact::AdjustPointerClosure::do_oop_nv(T* p) { - adjust_pointer(p); + adjust_pointer(p, _cm); } inline void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { do_oop_nv(p); } diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp index fce698b6ee1..a147cd77ad3 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp @@ -130,7 +130,7 @@ static const char* const pm_stats_hdr[] = { void PSPromotionManager::print_taskqueue_stats() { - if (!develop_log_is_enabled(Trace, gc, task, stats)) { + if (!log_develop_is_enabled(Trace, gc, task, stats)) { return; } LogHandle(gc, task, stats) log; diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp index 2b6ac4a595c..b6e3a6e7b63 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp @@ -284,7 +284,7 @@ inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { // This code must come after the CAS test, or it will print incorrect // information. - if (develop_log_is_enabled(Trace, gc, scavenge) && o->is_forwarded()) { + if (log_develop_is_enabled(Trace, gc, scavenge) && o->is_forwarded()) { log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", "forwarding", new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp index 6b9e9318b0b..acc12d0ce95 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/psAdaptiveSizePolicy.hpp" #include "gc/parallel/psMarkSweep.hpp" -#include "gc/parallel/psParallelCompact.hpp" +#include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/parallel/psScavenge.inline.hpp" #include "gc/parallel/psTasks.hpp" #include "gc/shared/collectorPolicy.hpp" @@ -763,6 +763,15 @@ GCTaskManager* const PSScavenge::gc_task_manager() { return ParallelScavengeHeap::gc_task_manager(); } +// Adaptive size policy support. When the young generation/old generation +// boundary moves, _young_generation_boundary must be reset +void PSScavenge::set_young_generation_boundary(HeapWord* v) { + _young_generation_boundary = v; + if (UseCompressedOops) { + _young_generation_boundary_compressed = (uintptr_t)oopDesc::encode_heap_oop((oop)v); + } +} + void PSScavenge::initialize() { // Arguments must have been parsed diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.hpp b/hotspot/src/share/vm/gc/parallel/psScavenge.hpp index dfabc1b81bc..3fb235f043d 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.hpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,12 +117,7 @@ class PSScavenge: AllStatic { } // Adaptive size policy support. When the young generation/old generation // boundary moves, _young_generation_boundary must be reset - static void set_young_generation_boundary(HeapWord* v) { - _young_generation_boundary = v; - if (UseCompressedOops) { - _young_generation_boundary_compressed = (uintptr_t)oopDesc::encode_heap_oop((oop)v); - } - } + static void set_young_generation_boundary(HeapWord* v); // Called by parallelScavengeHeap to init the tenuring threshold static void initialize(); diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index e86037cc5d9..9c00cd90383 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/serial/defNewGeneration.inline.hpp" +#include "gc/shared/ageTable.inline.hpp" #include "gc/shared/cardTableRS.hpp" #include "gc/shared/collectorCounters.hpp" #include "gc/shared/gcHeapSummary.hpp" diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp index f42c8ed8b47..484a6b6aa52 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp @@ -285,9 +285,6 @@ protected: // Save the tops for eden, from, and to virtual void record_spaces_top(); - // Doesn't require additional work during GC prologue and epilogue - virtual bool performs_in_place_marking() const { return false; } - // Accessing marks void save_marks(); void reset_saved_marks(); diff --git a/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp b/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp index a4958b71d3a..64165542433 100644 --- a/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp @@ -176,8 +176,12 @@ void TenuredGeneration::collect(bool full, SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer(); gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start()); + gch->pre_full_gc_dump(gc_timer); + GenMarkSweep::invoke_at_safepoint(ref_processor(), clear_all_soft_refs); + gch->post_full_gc_dump(gc_timer); + gc_timer->register_gc_end(); gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions()); diff --git a/hotspot/src/share/vm/gc/shared/ageTable.cpp b/hotspot/src/share/vm/gc/shared/ageTable.cpp index cf6542ddf11..f741061e591 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * 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,15 +23,16 @@ */ #include "precompiled.hpp" -#include "gc/shared/ageTable.hpp" +#include "gc/shared/ageTable.inline.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcPolicyCounters.hpp" #include "memory/resourceArea.hpp" #include "logging/log.hpp" +#include "oops/oop.inline.hpp" #include "utilities/copy.hpp" -/* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. +/* Copyright (c) 1992, 2016, Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ AgeTable::AgeTable(bool global) { diff --git a/hotspot/src/share/vm/gc/shared/ageTable.hpp b/hotspot/src/share/vm/gc/shared/ageTable.hpp index b0724101642..4af836f8acd 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.hpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ class GCPolicyCounters; -/* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. +/* Copyright (c) 1992, 2016, Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ // Age table for adaptive feedback-mediated tenuring (scavenging) @@ -56,9 +56,7 @@ class AgeTable VALUE_OBJ_CLASS_SPEC { void clear(); // add entry - void add(oop p, size_t oop_size) { - add(p->age(), oop_size); - } + inline void add(oop p, size_t oop_size); void add(uint age, size_t oop_size) { assert(age > 0 && age < table_size, "invalid age of object"); diff --git a/hotspot/src/share/vm/gc/shared/ageTable.inline.hpp b/hotspot/src/share/vm/gc/shared/ageTable.inline.hpp new file mode 100644 index 00000000000..aaa7470d927 --- /dev/null +++ b/hotspot/src/share/vm/gc/shared/ageTable.inline.hpp @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_GC_SHARED_AGETABLE_INLINE_HPP +#define SHARE_VM_GC_SHARED_AGETABLE_INLINE_HPP + +#include "gc/shared/ageTable.hpp" +#include "oops/oop.inline.hpp" + +// add entry +void AgeTable::add(oop p, size_t oop_size) { + add(p->age(), oop_size); +} + +#endif // SHARE_VM_GC_SHARED_AGETABLE_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp index b4055f67e57..9bba8daf55e 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -571,30 +571,28 @@ void CollectedHeap::resize_all_tlabs() { } } -void CollectedHeap::full_gc_dump(GCTimer* timer, const char* when) { - if (HeapDumpBeforeFullGC || HeapDumpAfterFullGC) { - GCIdMarkAndRestore gc_id_mark; - FormatBuffer<> title("Heap Dump (%s full gc)", when); - GCTraceTime(Info, gc) tm(title.buffer(), timer); +void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) { + assert(timer != NULL, "timer is null"); + if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) { + GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer); HeapDumper::dump_heap(); } + LogHandle(gc, classhisto) log; if (log.is_trace()) { + GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer); ResourceMark rm; - GCIdMarkAndRestore gc_id_mark; - FormatBuffer<> title("Class Histogram (%s full gc)", when); - GCTraceTime(Trace, gc, classhisto) tm(title.buffer(), timer); VM_GC_HeapInspection inspector(log.trace_stream(), false /* ! full gc */); inspector.doit(); } } void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { - full_gc_dump(timer, "before"); + full_gc_dump(timer, true); } void CollectedHeap::post_full_gc_dump(GCTimer* timer) { - full_gc_dump(timer, "after"); + full_gc_dump(timer, false); } void CollectedHeap::initialize_reserved_region(HeapWord *start, HeapWord *end) { diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp index 7b959e994b8..613397b02d6 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -525,7 +525,7 @@ class CollectedHeap : public CHeapObj { // Generate any dumps preceding or following a full gc private: - void full_gc_dump(GCTimer* timer, const char* when); + void full_gc_dump(GCTimer* timer, bool before); public: void pre_full_gc_dump(GCTimer* timer); void post_full_gc_dump(GCTimer* timer); diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.inline.hpp b/hotspot/src/share/vm/gc/shared/collectedHeap.inline.hpp index ef4de405437..71b3c360044 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "gc/shared/threadLocalAllocBuffer.inline.hpp" #include "memory/universe.hpp" #include "oops/arrayOop.hpp" +#include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" @@ -248,7 +249,7 @@ inline HeapWord* CollectedHeap::align_allocation_or_fail(HeapWord* addr, assert(is_size_aligned(alignment_in_bytes, HeapWordSize), "Alignment size %u is incorrect.", alignment_in_bytes); - HeapWord* new_addr = (HeapWord*) align_pointer_up(addr, alignment_in_bytes); + HeapWord* new_addr = (HeapWord*) align_ptr_up(addr, alignment_in_bytes); size_t padding = pointer_delta(new_addr, addr); if (padding == 0) { diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp index fa1e2eaddbc..bdfe9688818 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -774,7 +774,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size, // free memory should be here, especially if they are expensive. If this // attempt fails, an OOM exception will be thrown. { - UIntXFlagSetting flag_change(MarkSweepAlwaysCompactCount, 1); // Make sure the heap is fully compacted + UIntFlagSetting flag_change(MarkSweepAlwaysCompactCount, 1); // Make sure the heap is fully compacted gch->do_collection(true, // full true, // clear_all_soft_refs diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.hpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.hpp index d42ed13b6d1..82ac817d70b 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,24 +145,9 @@ class CollectorPolicy : public CHeapObj { virtual CardTableRS* create_rem_set(MemRegion reserved); - // This method controls how a collector satisfies a request - // for a block of memory. "gc_time_limit_was_exceeded" will - // be set to true if the adaptive size policy determine that - // an excessive amount of time is being spent doing collections - // and caused a NULL to be returned. If a NULL is not returned, - // "gc_time_limit_was_exceeded" has an undefined meaning. - virtual HeapWord* mem_allocate_work(size_t size, - bool is_tlab, - bool* gc_overhead_limit_was_exceeded) = 0; - - // This method controls how a collector handles one or more - // of its generations being fully allocated. - virtual HeapWord *satisfy_failed_allocation(size_t size, bool is_tlab) = 0; - // This method controls how a collector handles a metadata allocation - // failure. - virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data, - size_t size, - Metaspace::MetadataType mdtype); + MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data, + size_t size, + Metaspace::MetadataType mdtype); // Performance Counter support GCPolicyCounters* counters() { return _gc_policy_counters; } diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp index 6afef5c5494..b0d1af971e4 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -289,9 +289,9 @@ HeapWord* GenCollectedHeap::attempt_allocation(size_t size, HeapWord* GenCollectedHeap::mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded) { - return collector_policy()->mem_allocate_work(size, - false /* is_tlab */, - gc_overhead_limit_was_exceeded); + return gen_policy()->mem_allocate_work(size, + false /* is_tlab */, + gc_overhead_limit_was_exceeded); } bool GenCollectedHeap::must_clear_all_soft_refs() { @@ -458,7 +458,6 @@ void GenCollectedHeap::do_collection(bool full, prepared_for_verification = true; } - assert(!_young_gen->performs_in_place_marking(), "No young generation do in place marking"); collect_generation(_young_gen, full, size, @@ -482,15 +481,11 @@ void GenCollectedHeap::do_collection(bool full, increment_total_full_collections(); } - pre_full_gc_dump(NULL); // do any pre full gc dumps - if (!prepared_for_verification && run_verification && VerifyGCLevel <= 1 && VerifyBeforeGC) { prepare_for_verify(); } - assert(_old_gen->performs_in_place_marking(), "All old generations do in place marking"); - if (do_young_collection) { // We did a young GC. Need a new GC id for the old GC. GCIdMarkAndRestore gc_id_mark; @@ -510,11 +505,6 @@ void GenCollectedHeap::do_collection(bool full, // a whole heap collection. complete = complete || collected_old; - if (complete) { // We did a full collection - // FIXME: See comment at pre_full_gc_dump call - post_full_gc_dump(NULL); // do any post full gc dumps - } - print_heap_change(young_prev_used, old_prev_used); MetaspaceAux::print_metaspace_change(metadata_prev_used); @@ -551,7 +541,7 @@ void GenCollectedHeap::do_collection(bool full, } HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab) { - return collector_policy()->satisfy_failed_allocation(size, is_tlab); + return gen_policy()->satisfy_failed_allocation(size, is_tlab); } #ifdef ASSERT @@ -988,9 +978,9 @@ size_t GenCollectedHeap::unsafe_max_tlab_alloc(Thread* thr) const { HeapWord* GenCollectedHeap::allocate_new_tlab(size_t size) { bool gc_overhead_limit_was_exceeded; - return collector_policy()->mem_allocate_work(size /* size */, - true /* is_tlab */, - &gc_overhead_limit_was_exceeded); + return gen_policy()->mem_allocate_work(size /* size */, + true /* is_tlab */, + &gc_overhead_limit_was_exceeded); } // Requires "*prev_ptr" to be non-NULL. Deletes and a block of minimal size diff --git a/hotspot/src/share/vm/gc/shared/genOopClosures.hpp b/hotspot/src/share/vm/gc/shared/genOopClosures.hpp index 05009cc1372..f1dd89344d8 100644 --- a/hotspot/src/share/vm/gc/shared/genOopClosures.hpp +++ b/hotspot/src/share/vm/gc/shared/genOopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,23 +146,15 @@ class FilteringClosure: public ExtendedOopClosure { HeapWord* _boundary; ExtendedOopClosure* _cl; protected: - template inline void do_oop_work(T* p) { - T heap_oop = oopDesc::load_heap_oop(p); - if (!oopDesc::is_null(heap_oop)) { - oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - if ((HeapWord*)obj < _boundary) { - _cl->do_oop(p); - } - } - } + template inline void do_oop_work(T* p); public: FilteringClosure(HeapWord* boundary, ExtendedOopClosure* cl) : ExtendedOopClosure(cl->ref_processor()), _boundary(boundary), _cl(cl) {} virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { FilteringClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p); + inline void do_oop_nv(narrowOop* p); virtual bool do_metadata() { return do_metadata_nv(); } inline bool do_metadata_nv() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; } }; diff --git a/hotspot/src/share/vm/gc/shared/genOopClosures.inline.hpp b/hotspot/src/share/vm/gc/shared/genOopClosures.inline.hpp index ea570baa68f..13883f2283a 100644 --- a/hotspot/src/share/vm/gc/shared/genOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/genOopClosures.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,6 +124,19 @@ template inline void FastScanClosure::do_oop_work(T* p) { inline void FastScanClosure::do_oop_nv(oop* p) { FastScanClosure::do_oop_work(p); } inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); } +template void FilteringClosure::do_oop_work(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + if ((HeapWord*)obj < _boundary) { + _cl->do_oop(p); + } + } +} + +void FilteringClosure::do_oop_nv(oop* p) { FilteringClosure::do_oop_work(p); } +void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); } + // Note similarity to ScanClosure; the difference is that // the barrier set is taken care of outside this closure. template inline void ScanWeakRefClosure::do_oop_work(T* p) { diff --git a/hotspot/src/share/vm/gc/shared/generation.hpp b/hotspot/src/share/vm/gc/shared/generation.hpp index 9e1eed7d9f4..6b60291d129 100644 --- a/hotspot/src/share/vm/gc/shared/generation.hpp +++ b/hotspot/src/share/vm/gc/shared/generation.hpp @@ -309,13 +309,6 @@ class Generation: public CHeapObj { // do nothing. virtual void par_oop_since_save_marks_iterate_done(int thread_num) {} - // This generation does in-place marking, meaning that mark words - // are mutated during the marking phase and presumably reinitialized - // to a canonical value after the GC. This is currently used by the - // biased locking implementation to determine whether additional - // work is required during the GC prologue and epilogue. - virtual bool performs_in_place_marking() const { return true; } - // Returns "true" iff collect() should subsequently be called on this // this generation. See comment below. // This is a generic implementation which can be overridden. diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 73be2d60d14..544cf81001d 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -30,7 +30,7 @@ #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referencePolicy.hpp" -#include "gc/shared/referenceProcessor.hpp" +#include "gc/shared/referenceProcessor.inline.hpp" #include "logging/log.hpp" #include "memory/allocation.hpp" #include "oops/oop.inline.hpp" diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp index 0d100893465..b7656845c72 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp @@ -58,23 +58,13 @@ class AbstractRefProcTaskExecutor; class DiscoveredList { public: DiscoveredList() : _len(0), _compressed_head(0), _oop_head(NULL) { } - oop head() const { - return UseCompressedOops ? oopDesc::decode_heap_oop(_compressed_head) : - _oop_head; - } + inline oop head() const; HeapWord* adr_head() { return UseCompressedOops ? (HeapWord*)&_compressed_head : (HeapWord*)&_oop_head; } - void set_head(oop o) { - if (UseCompressedOops) { - // Must compress the head ptr. - _compressed_head = oopDesc::encode_heap_oop(o); - } else { - _oop_head = o; - } - } - bool is_empty() const { return head() == NULL; } + inline void set_head(oop o); + inline bool is_empty() const; size_t length() { return _len; } void set_length(size_t len) { _len = len; } void inc_length(size_t inc) { _len += inc; assert(_len > 0, "Error"); } @@ -113,22 +103,7 @@ private: public: inline DiscoveredListIterator(DiscoveredList& refs_list, OopClosure* keep_alive, - BoolObjectClosure* is_alive): - _refs_list(refs_list), - _prev_next(refs_list.adr_head()), - _prev(NULL), - _ref(refs_list.head()), -#ifdef ASSERT - _first_seen(refs_list.head()), -#endif -#ifndef PRODUCT - _processed(0), - _removed(0), -#endif - _next(NULL), - _keep_alive(keep_alive), - _is_alive(is_alive) -{ } + BoolObjectClosure* is_alive); // End Of List. inline bool has_next() const { return _ref != NULL; } diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.inline.hpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.inline.hpp new file mode 100644 index 00000000000..51e96921803 --- /dev/null +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.inline.hpp @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + * + */ + +#ifndef SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_INLINE_HPP +#define SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_INLINE_HPP + +#include "gc/shared/referenceProcessor.hpp" +#include "oops/oop.inline.hpp" + +oop DiscoveredList::head() const { + return UseCompressedOops ? oopDesc::decode_heap_oop(_compressed_head) : + _oop_head; +} + +void DiscoveredList::set_head(oop o) { + if (UseCompressedOops) { + // Must compress the head ptr. + _compressed_head = oopDesc::encode_heap_oop(o); + } else { + _oop_head = o; + } +} + +bool DiscoveredList::is_empty() const { + return head() == NULL; +} + +DiscoveredListIterator::DiscoveredListIterator(DiscoveredList& refs_list, + OopClosure* keep_alive, + BoolObjectClosure* is_alive): + _refs_list(refs_list), + _prev_next(refs_list.adr_head()), + _prev(NULL), + _ref(refs_list.head()), +#ifdef ASSERT + _first_seen(refs_list.head()), +#endif +#ifndef PRODUCT + _processed(0), + _removed(0), +#endif + _next(NULL), + _keep_alive(keep_alive), + _is_alive(is_alive) { +} + +#endif // SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/shared/space.hpp b/hotspot/src/share/vm/gc/shared/space.hpp index c44383d18f3..465dca90eb6 100644 --- a/hotspot/src/share/vm/gc/shared/space.hpp +++ b/hotspot/src/share/vm/gc/shared/space.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -360,9 +360,7 @@ private: return size; } - inline size_t obj_size(const HeapWord* addr) const { - return oop(addr)->size(); - } + inline size_t obj_size(const HeapWord* addr) const; public: CompactibleSpace() : @@ -508,9 +506,7 @@ class ContiguousSpace: public CompactibleSpace { return true; // Always true, since scan_limit is top } - inline size_t scanned_block_size(const HeapWord* addr) const { - return oop(addr)->size(); - } + inline size_t scanned_block_size(const HeapWord* addr) const; protected: HeapWord* _top; diff --git a/hotspot/src/share/vm/gc/shared/space.inline.hpp b/hotspot/src/share/vm/gc/shared/space.inline.hpp index af6f1a8bfb2..7b27598e286 100644 --- a/hotspot/src/share/vm/gc/shared/space.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/space.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,6 +72,10 @@ OffsetTableContigSpace::block_start_const(const void* p) const { return _offsets.block_start(p); } +size_t CompactibleSpace::obj_size(const HeapWord* addr) const { + return oop(addr)->size(); +} + template inline void CompactibleSpace::scan_and_forward(SpaceType* space, CompactPoint* cp) { // Compute the new addresses for the live objects and store it in the mark @@ -331,4 +335,9 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space) { if (ZapUnusedHeapArea) space->mangle_unused_area(); } } + +size_t ContiguousSpace::scanned_block_size(const HeapWord* addr) const { + return oop(addr)->size(); +} + #endif // SHARE_VM_GC_SHARED_SPACE_INLINE_HPP diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index cab530d379c..83e6a2146f7 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -2502,10 +2502,10 @@ run: // Same comments as invokevirtual apply here. oop rcvr = STACK_OBJECT(-parms); VERIFY_OOP(rcvr); - InstanceKlass* rcvrKlass = (InstanceKlass*)rcvr->klass(); - callee = (Method*) rcvrKlass->start_of_vtable()[ cache->f2_as_index()]; + Klass* rcvrKlass = rcvr->klass(); + callee = (Method*) rcvrKlass->method_at_vtable(cache->f2_as_index()); // Profile 'special case of invokeinterface' virtual call. - BI_PROFILE_UPDATE_VIRTUALCALL(rcvr->klass()); + BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass); } istate->set_callee(callee); istate->set_callee_entry_point(callee->from_interpreted_entry()); @@ -2594,7 +2594,7 @@ run: // but this works oop rcvr = STACK_OBJECT(-parms); VERIFY_OOP(rcvr); - InstanceKlass* rcvrKlass = (InstanceKlass*)rcvr->klass(); + Klass* rcvrKlass = rcvr->klass(); /* Executing this code in java.lang.String: public String(char value[]) { @@ -2611,9 +2611,9 @@ run: However it seems to have a vtable in the right location. Huh? Because vtables have the same offset for ArrayKlass and InstanceKlass. */ - callee = (Method*) rcvrKlass->start_of_vtable()[ cache->f2_as_index()]; + callee = (Method*) rcvrKlass->method_at_vtable(cache->f2_as_index()); // Profile virtual call. - BI_PROFILE_UPDATE_VIRTUALCALL(rcvr->klass()); + BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass); } } else { if ((Bytecodes::Code)opcode == Bytecodes::_invokespecial) { diff --git a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp index a1ae0eee4a6..4cd70c85484 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -264,7 +264,7 @@ bool BytecodePrinter::check_cp_cache_index(int i, int& cp_index, outputStream* s return true; } //climit = cache->length(); // %%% private! - size_t size = cache->size() * HeapWordSize; + size_t size = cache->size() * wordSize; size -= sizeof(ConstantPoolCache); size /= sizeof(ConstantPoolCacheEntry); climit = (int) size; diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index f8902c76f93..166390d8d6b 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -763,7 +763,7 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte if (cp_cache_entry->is_resolved(bytecode)) return; if (bytecode == Bytecodes::_invokeinterface) { - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { ResourceMark rm(thread); log_develop_trace(itables)("Resolving: klass: %s to method: %s", info.resolved_klass()->name()->as_C_string(), diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 837be42ef2e..7e3c60b185d 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -168,7 +168,7 @@ CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) { } else if (!resolved_klass->is_interface()) { // A default or miranda method. Compute the vtable index. ResourceMark rm; - klassVtable* vt = InstanceKlass::cast(resolved_klass)->vtable(); + klassVtable* vt = resolved_klass->vtable(); index = LinkResolver::vtable_index_of_interface_method(resolved_klass, resolved_method); assert(index >= 0 , "we should have valid vtable index at this point"); @@ -818,7 +818,7 @@ methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { trace_method_resolution("invokeinterface resolved method: caller-class", link_info.current_klass(), resolved_klass, resolved_method, true); @@ -1066,7 +1066,7 @@ methodHandle LinkResolver::linktime_resolve_special_method(const LinkInfo& link_ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { trace_method_resolution("invokespecial resolved method: caller-class:", current_klass, resolved_klass, resolved_method, true); } @@ -1137,7 +1137,7 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, sel_method->signature())); } - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { trace_method_resolution("invokespecial selected method: resolved-class:", resolved_klass, resolved_klass, sel_method, true); } @@ -1190,7 +1190,7 @@ methodHandle LinkResolver::linktime_resolve_virtual_method(const LinkInfo& link_ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { trace_method_resolution("invokevirtual resolved method: caller-class:", current_klass, resolved_klass, resolved_method, false); } @@ -1229,8 +1229,7 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, resolved_method); assert(vtable_index >= 0 , "we should have valid vtable index at this point"); - InstanceKlass* inst = InstanceKlass::cast(recv_klass()); - selected_method = methodHandle(THREAD, inst->method_at_vtable(vtable_index)); + selected_method = methodHandle(THREAD, recv_klass->method_at_vtable(vtable_index)); } else { // at this point we are sure that resolved_method is virtual and not // a default or miranda method; therefore, it must have a valid vtable index. @@ -1245,10 +1244,7 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, assert(resolved_method->can_be_statically_bound(), "cannot override this method"); selected_method = resolved_method; } else { - // recv_klass might be an arrayKlassOop but all vtables start at - // the same place. The cast is to avoid virtual call and assertion. - InstanceKlass* inst = (InstanceKlass*)recv_klass(); - selected_method = methodHandle(THREAD, inst->method_at_vtable(vtable_index)); + selected_method = methodHandle(THREAD, recv_klass->method_at_vtable(vtable_index)); } } @@ -1270,7 +1266,7 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, selected_method->signature())); } - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { trace_method_resolution("invokevirtual selected method: receiver-class:", recv_klass, resolved_klass, selected_method, false, vtable_index); @@ -1369,7 +1365,7 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, sel_method->signature())); } - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { trace_method_resolution("invokeinterface selected method: receiver-class", recv_klass, resolved_klass, sel_method, true); } diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index f2592ecb716..a444c909e9e 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -121,8 +121,8 @@ extern uint64_t jvmciHotSpotVMAddressEntryValueOffset; extern uint64_t jvmciHotSpotVMAddressEntryArrayStride; } -int CompilerToVM::Data::InstanceKlass_vtable_start_offset; -int CompilerToVM::Data::InstanceKlass_vtable_length_offset; +int CompilerToVM::Data::Klass_vtable_start_offset; +int CompilerToVM::Data::Klass_vtable_length_offset; int CompilerToVM::Data::Method_extra_stack_entries; @@ -153,8 +153,8 @@ int CompilerToVM::Data::cardtable_shift; int CompilerToVM::Data::vm_page_size; void CompilerToVM::Data::initialize() { - InstanceKlass_vtable_start_offset = InstanceKlass::vtable_start_offset(); - InstanceKlass_vtable_length_offset = InstanceKlass::vtable_length_offset() * HeapWordSize; + Klass_vtable_start_offset = in_bytes(Klass::vtable_start_offset()); + Klass_vtable_length_offset = in_bytes(Klass::vtable_length_offset()); Method_extra_stack_entries = Method::extra_stack_entries(); @@ -659,8 +659,7 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t vtable_index = LinkResolver::vtable_index_of_interface_method(holder_klass, resolved_method); assert(vtable_index >= 0 , "we should have valid vtable index at this point"); - InstanceKlass* inst = InstanceKlass::cast(recv_klass); - selected_method = inst->method_at_vtable(vtable_index); + selected_method = recv_klass->method_at_vtable(vtable_index); } else { // at this point we are sure that resolved_method is virtual and not // a miranda method; therefore, it must have a valid vtable index. @@ -675,10 +674,7 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t assert(resolved_method->can_be_statically_bound(), "cannot override this method"); selected_method = resolved_method(); } else { - // recv_klass might be an arrayKlassOop but all vtables start at - // the same place. The cast is to avoid virtual call and assertion. - InstanceKlass* inst = (InstanceKlass*)recv_klass; - selected_method = inst->method_at_vtable(vtable_index); + selected_method = recv_klass->method_at_vtable(vtable_index); } } oop result = CompilerToVM::get_jvmci_method(selected_method, CHECK_NULL); diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp index 9a6667a82ef..9ec78fd7358 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ class CompilerToVM { friend class JVMCIVMStructs; private: - static int InstanceKlass_vtable_start_offset; - static int InstanceKlass_vtable_length_offset; + static int Klass_vtable_start_offset; + static int Klass_vtable_length_offset; static int Method_extra_stack_entries; diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp index 2b58b4a35ba..20dc5c6eb5e 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,8 +45,8 @@ #define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \ - static_field(CompilerToVM::Data, InstanceKlass_vtable_start_offset, int) \ - static_field(CompilerToVM::Data, InstanceKlass_vtable_length_offset, int) \ + static_field(CompilerToVM::Data, Klass_vtable_start_offset, int) \ + static_field(CompilerToVM::Data, Klass_vtable_length_offset, int) \ \ static_field(CompilerToVM::Data, Method_extra_stack_entries, int) \ \ diff --git a/hotspot/src/share/vm/logging/log.cpp b/hotspot/src/share/vm/logging/log.cpp index 71ca3a3e22f..ad86c39d6f9 100644 --- a/hotspot/src/share/vm/logging/log.cpp +++ b/hotspot/src/share/vm/logging/log.cpp @@ -30,58 +30,61 @@ #include "logging/log.hpp" #include "logging/logConfiguration.hpp" +#include "logging/logOutput.hpp" #include "memory/resourceArea.hpp" void Test_log_length() { remove("loglengthoutput.txt"); // Write long message to output file - LogConfiguration::parse_log_arguments("loglengthoutput.txt", "logging=trace", - NULL, NULL, NULL); ResourceMark rm; - outputStream* logstream = LogHandle(logging)::trace_stream(); - logstream->print_cr("01:1234567890-" - "02:1234567890-" - "03:1234567890-" - "04:1234567890-" - "05:1234567890-" - "06:1234567890-" - "07:1234567890-" - "08:1234567890-" - "09:1234567890-" - "10:1234567890-" - "11:1234567890-" - "12:1234567890-" - "13:1234567890-" - "14:1234567890-" - "15:1234567890-" - "16:1234567890-" - "17:1234567890-" - "18:1234567890-" - "19:1234567890-" - "20:1234567890-" - "21:1234567890-" - "22:1234567890-" - "23:1234567890-" - "24:1234567890-" - "25:1234567890-" - "26:1234567890-" - "27:1234567890-" - "28:1234567890-" - "29:1234567890-" - "30:1234567890-" - "31:1234567890-" - "32:1234567890-" - "33:1234567890-" - "34:1234567890-" - "35:1234567890-" - "36:1234567890-" - "37:1234567890-"); + LogHandle(logging) log; + bool success = LogConfiguration::parse_log_arguments("loglengthoutput.txt", "logging=trace", + NULL, NULL, log.error_stream()); + assert(success, "test unable to configure logging"); + log.trace("01:1234567890-" + "02:1234567890-" + "03:1234567890-" + "04:1234567890-" + "05:1234567890-" + "06:1234567890-" + "07:1234567890-" + "08:1234567890-" + "09:1234567890-" + "10:1234567890-" + "11:1234567890-" + "12:1234567890-" + "13:1234567890-" + "14:1234567890-" + "15:1234567890-" + "16:1234567890-" + "17:1234567890-" + "18:1234567890-" + "19:1234567890-" + "20:1234567890-" + "21:1234567890-" + "22:1234567890-" + "23:1234567890-" + "24:1234567890-" + "25:1234567890-" + "26:1234567890-" + "27:1234567890-" + "28:1234567890-" + "29:1234567890-" + "30:1234567890-" + "31:1234567890-" + "32:1234567890-" + "33:1234567890-" + "34:1234567890-" + "35:1234567890-" + "36:1234567890-" + "37:1234567890-"); + LogConfiguration::parse_log_arguments("loglengthoutput.txt", "all=off", + NULL, NULL, log.error_stream()); // Look for end of message in output file - FILE* fp; - fp = fopen("loglengthoutput.txt", "r"); - assert (fp, "File read error"); + FILE* fp = fopen("loglengthoutput.txt", "r"); + assert(fp, "File read error"); char output[600]; if (fgets(output, 600, fp) != NULL) { assert(strstr(output, "37:1234567890-"), "logging print size error"); @@ -89,5 +92,48 @@ void Test_log_length() { fclose(fp); remove("loglengthoutput.txt"); } -#endif // PRODUCT +#define assert_str_eq(s1, s2) \ + assert(strcmp(s1, s2) == 0, "Expected '%s' to equal '%s'", s1, s2) + +#define assert_char_in(c, s) \ + assert(strchr(s, c) != NULL, "Expected '%s' to contain character '%c'", s, c) + +#define assert_char_not_in(c, s) \ + assert(strchr(s, c) == NULL, "Expected '%s' to *not* contain character '%c'", s, c) + +void Test_configure_stdout() { + ResourceMark rm; + LogHandle(logging) log; + LogOutput* stdoutput = LogOutput::Stdout; + + // Save current stdout config and clear it + char* saved_config = os::strdup_check_oom(stdoutput->config_string()); + LogConfiguration::parse_log_arguments("stdout", "all=off", NULL, NULL, log.error_stream()); + + // Enable 'logging=info', verifying it has been set + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(logging)); + assert_str_eq("logging=info,", stdoutput->config_string()); + assert(log_is_enabled(Info, logging), "logging was not properly enabled"); + + // Enable 'gc=debug' (no wildcard), verifying no other tags are enabled + LogConfiguration::configure_stdout(LogLevel::Debug, true, LOG_TAGS(gc)); + // No '+' character means only single tags are enabled, and no combinations + assert_char_not_in('+', stdoutput->config_string()); + assert(log_is_enabled(Debug, gc), "logging was not properly enabled"); + + // Enable 'gc*=trace' (with wildcard), verifying at least one tag combination is enabled (gc+...) + LogConfiguration::configure_stdout(LogLevel::Trace, false, LOG_TAGS(gc)); + assert_char_in('+', stdoutput->config_string()); + assert(log_is_enabled(Trace, gc), "logging was not properly enabled"); + + // Disable 'gc*' and 'logging', verifying all logging is properly disabled + LogConfiguration::configure_stdout(LogLevel::Off, false, LOG_TAGS(gc)); + LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(logging)); + assert_str_eq("all=off", stdoutput->config_string()); + + // Restore saved configuration + LogConfiguration::parse_log_arguments("stdout", saved_config, NULL, NULL, log.error_stream()); + os::free(saved_config); +} +#endif // PRODUCT diff --git a/hotspot/src/share/vm/logging/log.hpp b/hotspot/src/share/vm/logging/log.hpp index 8b65f0cd2dd..722b2d3af90 100644 --- a/hotspot/src/share/vm/logging/log.hpp +++ b/hotspot/src/share/vm/logging/log.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,13 +57,13 @@ #define log_develop_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : Log::write #define log_develop_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : Log::write #define log_develop_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : Log::write -#define develop_log_is_enabled(level, ...) log_is_enabled(level, __VA_ARGS__) +#define log_develop_is_enabled(level, ...) log_is_enabled(level, __VA_ARGS__) #else #define DUMMY_ARGUMENT_CONSUMER(...) #define log_develop_info(...) DUMMY_ARGUMENT_CONSUMER #define log_develop_debug(...) DUMMY_ARGUMENT_CONSUMER #define log_develop_trace(...) DUMMY_ARGUMENT_CONSUMER -#define develop_log_is_enabled(...) false +#define log_develop_is_enabled(...) false #endif // Convenience macro to test if the logging is enabled on the specified level for given tags. @@ -120,15 +120,17 @@ class Log VALUE_OBJ_CLASS_SPEC { ATTRIBUTE_PRINTF(1, 0) static void vwrite(const char* fmt, va_list args) { char buf[LogBufferSize]; + va_list saved_args; // For re-format on buf overflow. + va_copy(saved_args, args); size_t prefix_len = LogPrefix::prefix(buf, sizeof(buf)); // Check that string fits in buffer; resize buffer if necessary int ret = os::log_vsnprintf(buf + prefix_len, sizeof(buf) - prefix_len, fmt, args); assert(ret >= 0, "Log message buffer issue"); - if ((size_t)ret > sizeof(buf)) { + if ((size_t)ret >= sizeof(buf)) { size_t newbuf_len = prefix_len + ret + 1; char* newbuf = NEW_C_HEAP_ARRAY(char, newbuf_len, mtLogging); prefix_len = LogPrefix::prefix(newbuf, newbuf_len); - ret = os::log_vsnprintf(newbuf + prefix_len, newbuf_len - prefix_len, fmt, args); + ret = os::log_vsnprintf(newbuf + prefix_len, newbuf_len - prefix_len, fmt, saved_args); assert(ret >= 0, "Log message buffer issue"); puts(newbuf); FREE_C_HEAP_ARRAY(char, newbuf); diff --git a/hotspot/src/share/vm/logging/logFileStreamOutput.hpp b/hotspot/src/share/vm/logging/logFileStreamOutput.hpp index 757d644bf32..9c4ddf7b9c5 100644 --- a/hotspot/src/share/vm/logging/logFileStreamOutput.hpp +++ b/hotspot/src/share/vm/logging/logFileStreamOutput.hpp @@ -40,7 +40,6 @@ class LogFileStreamOutput : public LogOutput { for (size_t i = 0; i < LogDecorators::Count; i++) { _decorator_padding[i] = 0; } - _decorator_padding[LogDecorators::level_decorator] = 7; } public: diff --git a/hotspot/src/share/vm/logging/logPrefix.hpp b/hotspot/src/share/vm/logging/logPrefix.hpp index 2948e6cddce..039e5f44416 100644 --- a/hotspot/src/share/vm/logging/logPrefix.hpp +++ b/hotspot/src/share/vm/logging/logPrefix.hpp @@ -43,6 +43,7 @@ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, age)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, barrier)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, classhisto)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction, phases)) \ LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, cpu)) \ diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index aeedd0b2043..d4ff40bd0dd 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -39,7 +39,9 @@ LOG_TAG(classhisto) \ LOG_TAG(classresolve) \ LOG_TAG(classinit) \ - LOG_TAG(comp) \ + LOG_TAG(classload) /* Trace all classes loaded */ \ + LOG_TAG(classloaderdata) /* class loader loader_data lifetime */ \ + LOG_TAG(classunload) /* Trace unloading of classes */ \ LOG_TAG(compaction) \ LOG_TAG(cpu) \ LOG_TAG(cset) \ @@ -59,6 +61,7 @@ LOG_TAG(marking) \ LOG_TAG(metaspace) \ LOG_TAG(monitorinflation) \ + LOG_TAG(os) \ LOG_TAG(phases) \ LOG_TAG(plab) \ LOG_TAG(promotion) \ @@ -66,7 +69,6 @@ LOG_TAG(refine) \ LOG_TAG(region) \ LOG_TAG(remset) \ - LOG_TAG(rt) \ LOG_TAG(safepoint) \ LOG_TAG(scavenge) \ LOG_TAG(scrub) \ @@ -75,7 +77,6 @@ LOG_TAG(stats) \ LOG_TAG(stringdedup) \ LOG_TAG(survivor) \ - LOG_TAG(svc) \ LOG_TAG(sweep) \ LOG_TAG(task) \ LOG_TAG(tlab) \ diff --git a/hotspot/src/share/vm/logging/logTagLevelExpression.cpp b/hotspot/src/share/vm/logging/logTagLevelExpression.cpp index 2213ee3e70b..0770c38ba8d 100644 --- a/hotspot/src/share/vm/logging/logTagLevelExpression.cpp +++ b/hotspot/src/share/vm/logging/logTagLevelExpression.cpp @@ -29,21 +29,8 @@ const char* LogTagLevelExpression::DefaultExpressionString = "all"; -void LogTagLevelExpression::clear() { - _ntags = 0; - _ncombinations = 0; - for (size_t combination = 0; combination < MaxCombinations; combination++) { - _level[combination] = LogLevel::Invalid; - _allow_other_tags[combination] = false; - for (size_t tag = 0; tag < LogTag::MaxTags; tag++) { - _tags[combination][tag] = LogTag::__NO_TAG; - } - } -} - bool LogTagLevelExpression::parse(const char* str, outputStream* errstream) { bool success = true; - clear(); if (str == NULL || strcmp(str, "") == 0) { str = DefaultExpressionString; } diff --git a/hotspot/src/share/vm/logging/logTagLevelExpression.hpp b/hotspot/src/share/vm/logging/logTagLevelExpression.hpp index 34163222989..1eb27f07517 100644 --- a/hotspot/src/share/vm/logging/logTagLevelExpression.hpp +++ b/hotspot/src/share/vm/logging/logTagLevelExpression.hpp @@ -47,6 +47,11 @@ class LogTagLevelExpression : public StackObj { bool _allow_other_tags[MaxCombinations]; void new_combination() { + // Make sure either all tags are set or the last tag is __NO_TAG + if (_ntags < LogTag::MaxTags) { + _tags[_ncombinations][_ntags] = LogTag::__NO_TAG; + } + _ncombinations++; _ntags = 0; } @@ -64,10 +69,13 @@ class LogTagLevelExpression : public StackObj { _allow_other_tags[_ncombinations] = true; } - void clear(); - public: LogTagLevelExpression() : _ntags(0), _ncombinations(0) { + for (size_t combination = 0; combination < MaxCombinations; combination++) { + _level[combination] = LogLevel::Invalid; + _allow_other_tags[combination] = false; + _tags[combination][0] = LogTag::__NO_TAG; + } } bool parse(const char* str, outputStream* errstream = NULL); diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index 59c82277c07..2a82e60c063 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -208,7 +208,7 @@ void FileMapInfo::allocate_classpath_entry_table() { count ++; bytes += (int)entry_size; bytes += name_bytes; - if (TraceClassPaths || (TraceClassLoading && Verbose)) { + if (TraceClassPaths) { tty->print_cr("[Add main shared path (%s) %s]", (cpe->is_jar_file() ? "jar" : "dir"), name); } } else { @@ -275,7 +275,7 @@ bool FileMapInfo::validate_classpath_entry_table() { struct stat st; const char* name = ent->_name; bool ok = true; - if (TraceClassPaths || (TraceClassLoading && Verbose)) { + if (TraceClassPaths) { tty->print_cr("[Checking shared classpath entry: %s]", name); } if (os::stat(name, &st) != 0) { @@ -301,7 +301,7 @@ bool FileMapInfo::validate_classpath_entry_table() { } } if (ok) { - if (TraceClassPaths || (TraceClassLoading && Verbose)) { + if (TraceClassPaths) { tty->print_cr("[ok]"); } } else if (!PrintSharedArchiveAndExit) { diff --git a/hotspot/src/share/vm/memory/heapInspection.cpp b/hotspot/src/share/vm/memory/heapInspection.cpp index d120a45218f..2f8f40d3d71 100644 --- a/hotspot/src/share/vm/memory/heapInspection.cpp +++ b/hotspot/src/share/vm/memory/heapInspection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,6 +40,14 @@ // HeapInspection +int KlassSizeStats::count(oop x) { + return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0)); +} + +int KlassSizeStats::count_array(objArrayOop x) { + return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0)); +} + inline KlassInfoEntry::~KlassInfoEntry() { if (_subclasses != NULL) { delete _subclasses; @@ -218,9 +226,8 @@ int KlassInfoHisto::sort_helper(KlassInfoEntry** e1, KlassInfoEntry** e2) { return (*e1)->compare(*e1,*e2); } -KlassInfoHisto::KlassInfoHisto(KlassInfoTable* cit, const char* title) : - _cit(cit), - _title(title) { +KlassInfoHisto::KlassInfoHisto(KlassInfoTable* cit) : + _cit(cit) { _elements = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(_histo_initial_size, true); } @@ -640,7 +647,8 @@ void KlassInfoHisto::print_histo_on(outputStream* st, bool print_stats, if (print_stats) { print_class_stats(st, csv_format, columns); } else { - st->print_cr("%s",title()); + st->print_cr(" num #instances #bytes class name"); + st->print_cr("----------------------------------------------"); print_elements(st); } } @@ -721,10 +729,7 @@ void HeapInspection::heap_inspection(outputStream* st) { } // Sort and print klass instance info - const char *title = "\n" - " num #instances #bytes class name\n" - "----------------------------------------------"; - KlassInfoHisto histo(&cit, title); + KlassInfoHisto histo(&cit); HistoClosure hc(&histo); cit.iterate(&hc); diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp index 97197b1bc5e..1ab6baf3336 100644 --- a/hotspot/src/share/vm/memory/heapInspection.hpp +++ b/hotspot/src/share/vm/memory/heapInspection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -154,13 +154,9 @@ public: HEAP_INSPECTION_COLUMNS_DO(DECLARE_KLASS_SIZE_STATS_FIELD) - static int count(oop x) { - return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0)); - } + static int count(oop x); - static int count_array(objArrayOop x) { - return (HeapWordSize * (((x) != NULL) ? (x)->size() : 0)); - } + static int count_array(objArrayOop x); template static int count(T* x) { return (HeapWordSize * ((x) ? (x)->size() : 0)); @@ -285,8 +281,6 @@ class KlassInfoHisto : public StackObj { KlassInfoTable *_cit; GrowableArray* _elements; GrowableArray* elements() const { return _elements; } - const char* _title; - const char* title() const { return _title; } static int sort_helper(KlassInfoEntry** e1, KlassInfoEntry** e2); void print_elements(outputStream* st) const; void print_class_stats(outputStream* st, bool csv_format, const char *columns); @@ -344,7 +338,7 @@ class KlassInfoHisto : public StackObj { } public: - KlassInfoHisto(KlassInfoTable* cit, const char* title); + KlassInfoHisto(KlassInfoTable* cit); ~KlassInfoHisto(); void add(KlassInfoEntry* cie); void print_histo_on(outputStream* st, bool print_class_stats, bool csv_format, const char *columns); diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index f430b446c04..72ec52da3d1 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1234,7 +1234,7 @@ void VirtualSpaceList::link_vs(VirtualSpaceNode* new_entry) { #ifdef ASSERT new_entry->mangle(); #endif - if (develop_log_is_enabled(Trace, gc, metaspace)) { + if (log_is_enabled(Trace, gc, metaspace)) { LogHandle(gc, metaspace) log; VirtualSpaceNode* vsl = current_virtual_space(); ResourceMark rm; @@ -3051,7 +3051,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a initialize_class_space(metaspace_rs); - if (develop_log_is_enabled(Trace, gc, metaspace)) { + if (log_is_enabled(Trace, gc, metaspace)) { LogHandle(gc, metaspace) log; ResourceMark rm; print_compressed_class_space(log.trace_stream(), requested_addr); @@ -3474,7 +3474,7 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, } // Zero initialize. - Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); + Copy::fill_to_words((HeapWord*)result, word_size, 0); return result; } @@ -3513,7 +3513,7 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size, } // Zero initialize. - Copy::fill_to_aligned_words((HeapWord*)result, word_size, 0); + Copy::fill_to_words((HeapWord*)result, word_size, 0); return result; } @@ -3583,7 +3583,7 @@ const char* Metaspace::metadata_type_name(Metaspace::MetadataType mdtype) { void Metaspace::record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size) { assert(DumpSharedSpaces, "sanity"); - int byte_size = (int)word_size * HeapWordSize; + int byte_size = (int)word_size * wordSize; AllocRecord *rec = new AllocRecord((address)ptr, type, byte_size); if (_alloc_record_head == NULL) { @@ -3623,7 +3623,7 @@ void Metaspace::record_deallocation(void* ptr, size_t word_size) { for (AllocRecord *rec = _alloc_record_head; rec; rec = rec->_next) { if (rec->_ptr == ptr) { - assert(rec->_byte_size == (int)word_size * HeapWordSize, "sanity"); + assert(rec->_byte_size == (int)word_size * wordSize, "sanity"); rec->_type = MetaspaceObj::DeallocatedType; return; } diff --git a/hotspot/src/share/vm/memory/padded.inline.hpp b/hotspot/src/share/vm/memory/padded.inline.hpp index 53404f3909b..15dfb38fd24 100644 --- a/hotspot/src/share/vm/memory/padded.inline.hpp +++ b/hotspot/src/share/vm/memory/padded.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ PaddedEnd* PaddedArray::create_unfreeable(uint length) { void* chunk = AllocateHeap(length * sizeof(PaddedEnd) + alignment, flags); // Make the initial alignment. - PaddedEnd* aligned_padded_array = (PaddedEnd*)align_pointer_up(chunk, alignment); + PaddedEnd* aligned_padded_array = (PaddedEnd*)align_ptr_up(chunk, alignment); // Call the default constructor for each element. for (uint i = 0; i < length; i++) { @@ -65,7 +65,7 @@ T** Padded2DArray::create_unfreeable(uint rows, uint column // Clear the allocated memory. memset(chunk, 0, total_size); // Align the chunk of memory. - T** result = (T**)align_pointer_up(chunk, alignment); + T** result = (T**)align_ptr_up(chunk, alignment); void* data_start = (void*)((uintptr_t)result + table_size); // Fill in the row table. @@ -87,7 +87,7 @@ T* PaddedPrimitiveArray::create_unfreeable(size_t length) { memset(chunk, 0, length * sizeof(T) + alignment); - return (T*)align_pointer_up(chunk, alignment); + return (T*)align_ptr_up(chunk, alignment); } #endif // SHARE_VM_MEMORY_PADDED_INLINE_HPP diff --git a/hotspot/src/share/vm/memory/virtualspace.cpp b/hotspot/src/share/vm/memory/virtualspace.cpp index 433904eed00..76f45090ec2 100644 --- a/hotspot/src/share/vm/memory/virtualspace.cpp +++ b/hotspot/src/share/vm/memory/virtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -502,7 +502,7 @@ void ReservedHeapSpace::initialize_compressed_heap(const size_t size, size_t ali // Calc address range within we try to attach (range of possible start addresses). char* const highest_start = (char *)align_ptr_down((char *)UnscaledOopHeapMax - size, attach_point_alignment); - char* const lowest_start = (char *)align_ptr_up ( aligned_heap_base_min_address , attach_point_alignment); + char* const lowest_start = (char *)align_ptr_up(aligned_heap_base_min_address, attach_point_alignment); try_reserve_range(highest_start, lowest_start, attach_point_alignment, aligned_heap_base_min_address, (char *)UnscaledOopHeapMax, size, alignment, large); } diff --git a/hotspot/src/share/vm/oops/arrayKlass.cpp b/hotspot/src/share/vm/oops/arrayKlass.cpp index faa66411c35..e92df43076f 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.cpp +++ b/hotspot/src/share/vm/oops/arrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,12 +42,8 @@ int ArrayKlass::static_size(int header_size) { // If this assert fails, see comments in base_create_array_klass. header_size = InstanceKlass::header_size(); int vtable_len = Universe::base_vtable_size(); -#ifdef _LP64 - int size = header_size + align_object_offset(vtable_len); -#else int size = header_size + vtable_len; -#endif - return align_object_size(size); + return align_metadata_size(size); } @@ -85,10 +81,10 @@ Method* ArrayKlass::uncached_lookup_method(const Symbol* name, ArrayKlass::ArrayKlass(Symbol* name) : _dimension(1), _higher_dimension(NULL), - _lower_dimension(NULL), - // Arrays don't add any new methods, so their vtable is the same size as - // the vtable of klass Object. - _vtable_len(Universe::base_vtable_size()) { + _lower_dimension(NULL) { + // Arrays don't add any new methods, so their vtable is the same size as + // the vtable of klass Object. + set_vtable_length(Universe::base_vtable_size()); set_name(name); set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass()); set_layout_helper(Klass::_lh_neutral_value); @@ -121,19 +117,6 @@ bool ArrayKlass::compute_is_subtype_of(Klass* k) { || k == SystemDictionary::Serializable_klass(); } - -inline intptr_t* ArrayKlass::start_of_vtable() const { - // all vtables start at the same place, that's why we use InstanceKlass::header_size here - return ((intptr_t*)this) + InstanceKlass::header_size(); -} - - -klassVtable* ArrayKlass::vtable() const { - KlassHandle kh(Thread::current(), this); - return new klassVtable(kh, start_of_vtable(), vtable_length() / vtableEntry::size()); -} - - objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) { if (length < 0) { THROW_0(vmSymbols::java_lang_NegativeArraySizeException()); diff --git a/hotspot/src/share/vm/oops/arrayKlass.hpp b/hotspot/src/share/vm/oops/arrayKlass.hpp index ef3e21d9af4..b98a092f735 100644 --- a/hotspot/src/share/vm/oops/arrayKlass.hpp +++ b/hotspot/src/share/vm/oops/arrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ class ArrayKlass: public Klass { int _dimension; // This is n'th-dimensional array. Klass* volatile _higher_dimension; // Refers the (n+1)'th-dimensional array (if present). Klass* volatile _lower_dimension; // Refers the (n-1)'th-dimensional array (if present). - int _vtable_len; // size of vtable for this klass protected: // Constructors @@ -99,7 +98,6 @@ class ArrayKlass: public Klass { bool compute_is_subtype_of(Klass* k); // Sizing - static int header_size() { return sizeof(ArrayKlass)/HeapWordSize; } static int static_size(int header_size); #if INCLUDE_SERVICES @@ -110,15 +108,6 @@ class ArrayKlass: public Klass { } #endif - // Java vtable - klassVtable* vtable() const; // return new klassVtable - int vtable_length() const { return _vtable_len; } - static int base_vtable_length() { return Universe::base_vtable_size(); } - void set_vtable_length(int len) { assert(len == base_vtable_length(), "bad length"); _vtable_len = len; } - protected: - inline intptr_t* start_of_vtable() const; - - public: // Iterators void array_klasses_do(void f(Klass* k)); void array_klasses_do(void f(Klass* k, TRAPS), TRAPS); diff --git a/hotspot/src/share/vm/oops/constMethod.cpp b/hotspot/src/share/vm/oops/constMethod.cpp index ae3b1ae1076..3a5d5a7fb73 100644 --- a/hotspot/src/share/vm/oops/constMethod.cpp +++ b/hotspot/src/share/vm/oops/constMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -144,7 +144,7 @@ int ConstMethod::size(int code_size, int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord; assert(extra_words == extra_bytes/BytesPerWord, "should already be aligned"); - return align_object_size(header_size() + extra_words); + return align_metadata_size(header_size() + extra_words); } Method* ConstMethod::method() const { @@ -492,6 +492,6 @@ void ConstMethod::verify_on(outputStream* st) { uncompressed_table_start = (u2*) m_end; } int gap = (intptr_t) uncompressed_table_start - (intptr_t) compressed_table_end; - int max_gap = align_object_size(1)*BytesPerWord; + int max_gap = align_metadata_size(1)*BytesPerWord; guarantee(gap >= 0 && gap < max_gap, "invalid method layout"); } diff --git a/hotspot/src/share/vm/oops/constMethod.hpp b/hotspot/src/share/vm/oops/constMethod.hpp index 5bd135ebf17..7d959fb516b 100644 --- a/hotspot/src/share/vm/oops/constMethod.hpp +++ b/hotspot/src/share/vm/oops/constMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -328,9 +328,7 @@ public: } // Sizing - static int header_size() { - return sizeof(ConstMethod)/HeapWordSize; - } + static int header_size() { return sizeof(ConstMethod)/wordSize; } // Size needed static int size(int code_size, InlineTableSizes* sizes); diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index c50c8c57045..9ed795cb303 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -723,8 +723,8 @@ class ConstantPool : public Metadata { } // Sizing (in words) - static int header_size() { return sizeof(ConstantPool)/HeapWordSize; } - static int size(int length) { return align_object_size(header_size() + length); } + static int header_size() { return sizeof(ConstantPool)/wordSize; } + static int size(int length) { return align_metadata_size(header_size() + length); } int size() const { return size(length()); } #if INCLUDE_SERVICES void collect_statistics(KlassSizeStats *sz) const; diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index 2adcb1c21e9..1e9b0b649e9 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -396,9 +396,7 @@ Method* ConstantPoolCacheEntry::method_if_resolved(const constantPoolHandle& cpo int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index()); if (cpool->tag_at(holder_index).is_klass()) { Klass* klass = cpool->resolved_klass_at(holder_index); - if (!klass->is_instance_klass()) - klass = SystemDictionary::Object_klass(); - return InstanceKlass::cast(klass)->method_at_vtable(f2_as_index()); + return klass->method_at_vtable(f2_as_index()); } } break; diff --git a/hotspot/src/share/vm/oops/cpCache.hpp b/hotspot/src/share/vm/oops/cpCache.hpp index cf6731da613..33828d52f6a 100644 --- a/hotspot/src/share/vm/oops/cpCache.hpp +++ b/hotspot/src/share/vm/oops/cpCache.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -364,7 +364,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC { return (TosState)((_flags >> tos_state_shift) & tos_state_mask); } // Code generation support - static WordSize size() { return in_WordSize(sizeof(ConstantPoolCacheEntry) / HeapWordSize); } + static WordSize size() { return in_WordSize(sizeof(ConstantPoolCacheEntry) / wordSize); } static ByteSize size_in_bytes() { return in_ByteSize(sizeof(ConstantPoolCacheEntry)); } static ByteSize indices_offset() { return byte_offset_of(ConstantPoolCacheEntry, _indices); } static ByteSize f1_offset() { return byte_offset_of(ConstantPoolCacheEntry, _f1); } @@ -439,14 +439,14 @@ class ConstantPoolCache: public MetaspaceObj { private: void set_length(int length) { _length = length; } - static int header_size() { return sizeof(ConstantPoolCache) / HeapWordSize; } - static int size(int length) { return align_object_size(header_size() + length * in_words(ConstantPoolCacheEntry::size())); } + static int header_size() { return sizeof(ConstantPoolCache) / wordSize; } + static int size(int length) { return align_metadata_size(header_size() + length * in_words(ConstantPoolCacheEntry::size())); } public: int size() const { return size(length()); } private: // Helpers - ConstantPool** constant_pool_addr() { return &_constant_pool; } + ConstantPool** constant_pool_addr() { return &_constant_pool; } ConstantPoolCacheEntry* base() const { return (ConstantPoolCacheEntry*)((address)this + in_bytes(base_offset())); } friend class constantPoolCacheKlass; diff --git a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp index dde37892b09..89d6301e8d2 100644 --- a/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceClassLoaderKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,7 +55,7 @@ public: void oop_ps_push_contents( oop obj, PSPromotionManager* pm); // Parallel Compact void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); - void oop_pc_update_pointers(oop obj); + void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); #endif // Oop fields (and metadata) iterators diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 4c8986bdcec..0ae310bdaf6 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classFileParser.hpp" +#include "classfile/classFileStream.hpp" #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/verifier.hpp" @@ -35,6 +36,7 @@ #include "interpreter/oopMapCache.hpp" #include "interpreter/rewriter.hpp" #include "jvmtifiles/jvmti.h" +#include "logging/log.hpp" #include "memory/heapInspection.hpp" #include "memory/iterator.inline.hpp" #include "memory/metadataFactory.hpp" @@ -211,9 +213,9 @@ Array* InstanceKlass::create_new_default_vtable_indices(int len, TRAPS) { InstanceKlass::InstanceKlass(const ClassFileParser& parser, unsigned kind) : _static_field_size(parser.static_field_size()), _nonstatic_oop_map_size(nonstatic_oop_map_size(parser.total_oop_map_count())), - _vtable_len(parser.vtable_size()), _itable_len(parser.itable_size()), _reference_type(parser.reference_type()) { + set_vtable_length(parser.vtable_size()); set_kind(kind); set_access_flags(parser.access_flags()); set_is_anonymous(parser.is_anonymous()); @@ -364,10 +366,6 @@ bool InstanceKlass::should_be_initialized() const { return !is_initialized(); } -klassVtable* InstanceKlass::vtable() const { - return new klassVtable(this, start_of_vtable(), vtable_length() / vtableEntry::size()); -} - klassItable* InstanceKlass::itable() const { return new klassItable(instanceKlassHandle(this)); } @@ -2667,6 +2665,10 @@ static void print_vtable(intptr_t* start, int len, outputStream* st) { } } +static void print_vtable(vtableEntry* start, int len, outputStream* st) { + return print_vtable(reinterpret_cast(start), len, st); +} + void InstanceKlass::print_on(outputStream* st) const { assert(is_klass(), "must be klass"); Klass::print_on(st); @@ -2904,18 +2906,88 @@ const char* InstanceKlass::internal_name() const { return external_name(); } +void InstanceKlass::print_loading_log(LogLevel::type type, + ClassLoaderData* loader_data, + const ClassFileStream* cfs) const { + ResourceMark rm; + outputStream* log; + + assert(type == LogLevel::Info || type == LogLevel::Debug, "sanity"); + + if (type == LogLevel::Info) { + log = LogHandle(classload)::info_stream(); + } else { + assert(type == LogLevel::Debug, + "print_loading_log supports only Debug and Info levels"); + log = LogHandle(classload)::debug_stream(); + } + + // Name and class hierarchy info + log->print("%s", external_name()); + + // Source + if (cfs != NULL) { + if (cfs->source() != NULL) { + log->print(" source: %s", cfs->source()); + } else if (loader_data == ClassLoaderData::the_null_class_loader_data()) { + Thread* THREAD = Thread::current(); + Klass* caller = + THREAD->is_Java_thread() + ? ((JavaThread*)THREAD)->security_get_caller_class(1) + : NULL; + // caller can be NULL, for example, during a JVMTI VM_Init hook + if (caller != NULL) { + log->print(" source: instance of %s", caller->external_name()); + } else { + // source is unknown + } + } else { + Handle class_loader(loader_data->class_loader()); + log->print(" source: %s", class_loader->klass()->external_name()); + } + } else { + log->print(" source: shared objects file"); + } + + if (type == LogLevel::Debug) { + // Class hierarchy info + log->print(" klass: " INTPTR_FORMAT " super: " INTPTR_FORMAT, + p2i(this), p2i(superklass())); + + if (local_interfaces() != NULL && local_interfaces()->length() > 0) { + log->print(" interfaces:"); + int length = local_interfaces()->length(); + for (int i = 0; i < length; i++) { + log->print(" " INTPTR_FORMAT, + p2i(InstanceKlass::cast(local_interfaces()->at(i)))); + } + } + + // Class loader + log->print(" loader: ["); + loader_data->print_value_on(log); + log->print("]"); + + // Classfile checksum + if (cfs) { + log->print(" bytes: %d checksum: %08x", + cfs->length(), + ClassLoader::crc32(0, (const char*)cfs->buffer(), + cfs->length())); + } + } + log->cr(); +} + #if INCLUDE_SERVICES // Size Statistics void InstanceKlass::collect_statistics(KlassSizeStats *sz) const { Klass::collect_statistics(sz); - sz->_inst_size = HeapWordSize * size_helper(); - sz->_vtab_bytes = HeapWordSize * align_object_offset(vtable_length()); - sz->_itab_bytes = HeapWordSize * align_object_offset(itable_length()); - sz->_nonstatic_oopmap_bytes = HeapWordSize * - ((is_interface() || is_anonymous()) ? - align_object_offset(nonstatic_oop_map_size()) : - nonstatic_oop_map_size()); + sz->_inst_size = wordSize * size_helper(); + sz->_vtab_bytes = wordSize * vtable_length(); + sz->_itab_bytes = wordSize * itable_length(); + sz->_nonstatic_oopmap_bytes = wordSize * nonstatic_oop_map_size(); int n = 0; n += (sz->_methods_array_bytes = sz->count_array(methods())); diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 344ceb74eb8..f7a3a24800f 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -27,6 +27,7 @@ #include "classfile/classLoaderData.hpp" #include "gc/shared/specialized_oop_closures.hpp" +#include "logging/logLevel.hpp" #include "memory/referenceType.hpp" #include "oops/annotations.hpp" #include "oops/constMethod.hpp" @@ -94,10 +95,10 @@ class OopMapBlock VALUE_OBJ_CLASS_SPEC { uint count() const { return _count; } void set_count(uint count) { _count = count; } - // sizeof(OopMapBlock) in HeapWords. + // sizeof(OopMapBlock) in words. static const int size_in_words() { - return align_size_up(int(sizeof(OopMapBlock)), HeapWordSize) >> - LogHeapWordSize; + return align_size_up(int(sizeof(OopMapBlock)), wordSize) >> + LogBytesPerWord; } private: @@ -178,6 +179,7 @@ class InstanceKlass: public Klass { u2 _java_fields_count; // The number of declared Java fields int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks + int _itable_len; // length of Java itable (in words) // _is_marked_dependent can be set concurrently, thus cannot be part of the // _misc_flags. bool _is_marked_dependent; // used for marking during flushing and deoptimization @@ -211,8 +213,6 @@ class InstanceKlass: public Klass { u2 _minor_version; // minor version number of class file u2 _major_version; // major version number of class file Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) - int _vtable_len; // length of Java vtable (in words) - int _itable_len; // length of Java itable (in words) OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily) MemberNameTable* _member_names; // Member names JNIid* _jni_ids; // First JNI identifier for static fields in this class @@ -311,10 +311,6 @@ class InstanceKlass: public Klass { int static_oop_field_count() const { return (int)_static_oop_field_count; } void set_static_oop_field_count(u2 size) { _static_oop_field_count = size; } - // Java vtable - int vtable_length() const { return _vtable_len; } - void set_vtable_length(int len) { _vtable_len = len; } - // Java itable int itable_length() const { return _itable_len; } void set_itable_length(int len) { _itable_len = len; } @@ -927,19 +923,17 @@ public: } // Sizing (in words) - static int header_size() { return align_object_offset(sizeof(InstanceKlass)/HeapWordSize); } + static int header_size() { return sizeof(InstanceKlass)/wordSize; } static int size(int vtable_length, int itable_length, int nonstatic_oop_map_size, bool is_interface, bool is_anonymous) { - return align_object_size(header_size() + - align_object_offset(vtable_length) + - align_object_offset(itable_length) + - ((is_interface || is_anonymous) ? - align_object_offset(nonstatic_oop_map_size) : - nonstatic_oop_map_size) + - (is_interface ? (int)sizeof(Klass*)/HeapWordSize : 0) + - (is_anonymous ? (int)sizeof(Klass*)/HeapWordSize : 0)); + return align_metadata_size(header_size() + + vtable_length + + itable_length + + nonstatic_oop_map_size + + (is_interface ? (int)sizeof(Klass*)/wordSize : 0) + + (is_anonymous ? (int)sizeof(Klass*)/wordSize : 0)); } int size() const { return size(vtable_length(), itable_length(), @@ -951,19 +945,15 @@ public: virtual void collect_statistics(KlassSizeStats *sz) const; #endif - static int vtable_start_offset() { return header_size(); } - static int vtable_length_offset() { return offset_of(InstanceKlass, _vtable_len) / HeapWordSize; } + intptr_t* start_of_itable() const { return (intptr_t*)start_of_vtable() + vtable_length(); } + intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); } - intptr_t* start_of_vtable() const { return ((intptr_t*)this) + vtable_start_offset(); } - intptr_t* start_of_itable() const { return start_of_vtable() + align_object_offset(vtable_length()); } int itable_offset_in_words() const { return start_of_itable() - (intptr_t*)this; } - intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); } - address static_field_addr(int offset); OopMapBlock* start_of_nonstatic_oop_maps() const { - return (OopMapBlock*)(start_of_itable() + align_object_offset(itable_length())); + return (OopMapBlock*)(start_of_itable() + itable_length()); } Klass** end_of_nonstatic_oop_maps() const { @@ -1007,9 +997,7 @@ public: return !layout_helper_needs_slow_path(layout_helper()); } - // Java vtable/itable - klassVtable* vtable() const; // return new klassVtable wrapper - inline Method* method_at_vtable(int index); + // Java itable klassItable* itable() const; // return new klassItable wrapper Method* method_at_itable(Klass* holder, int index, TRAPS); @@ -1052,7 +1040,7 @@ public: void oop_ps_push_contents( oop obj, PSPromotionManager* pm); // Parallel Compact void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); - void oop_pc_update_pointers(oop obj); + void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); #endif // Oop fields (and metadata) iterators @@ -1257,18 +1245,10 @@ public: void verify_on(outputStream* st); void oop_verify_on(oop obj, outputStream* st); -}; -inline Method* InstanceKlass::method_at_vtable(int index) { -#ifndef PRODUCT - assert(index >= 0, "valid vtable index"); - if (DebugVtables) { - verify_vtable_index(index); - } -#endif - vtableEntry* ve = (vtableEntry*)start_of_vtable(); - return ve[index].method(); -} + // Logging + void print_loading_log(LogLevel::type type, ClassLoaderData* loader_data, const ClassFileStream* cfs) const; +}; // for adding methods // UNSET_IDNUM return means no more ids available diff --git a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp index 59db02c737e..48baee477d7 100644 --- a/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceMirrorKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ class InstanceMirrorKlass: public InstanceKlass { void oop_ps_push_contents( oop obj, PSPromotionManager* pm); // Parallel Compact void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); - void oop_pc_update_pointers(oop obj); + void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); #endif // Oop fields (and metadata) iterators diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.hpp index 13b7841d64c..4de86a4c7ff 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ class InstanceRefKlass: public InstanceKlass { void oop_ps_push_contents( oop obj, PSPromotionManager* pm); // Parallel Compact void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); - void oop_pc_update_pointers(oop obj); + void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); #endif // Oop fields (and metadata) iterators diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index 313130021d5..b391f222d6a 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -28,6 +28,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "gc/shared/collectedHeap.inline.hpp" +#include "logging/log.hpp" #include "memory/heapInspection.hpp" #include "memory/metadataFactory.hpp" #include "memory/oopFactory.hpp" @@ -400,9 +401,9 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive Klass* sub = current->subklass(); while (sub != NULL && !sub->is_loader_alive(is_alive)) { #ifndef PRODUCT - if (TraceClassUnloading && WizardMode) { + if (log_is_enabled(Trace, classunload)) { ResourceMark rm; - tty->print_cr("[Unlinking class (subclass) %s]", sub->external_name()); + log_trace(classunload)("unlinking class (subclass): %s", sub->external_name()); } #endif sub = sub->next_sibling(); @@ -415,9 +416,9 @@ void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool clean_alive // Find and set the first alive sibling Klass* sibling = current->next_sibling(); while (sibling != NULL && !sibling->is_loader_alive(is_alive)) { - if (TraceClassUnloading && WizardMode) { + if (log_is_enabled(Trace, classunload)) { ResourceMark rm; - tty->print_cr("[Unlinking class (sibling) %s]", sibling->external_name()); + log_trace(classunload)("[Unlinking class (sibling) %s]", sibling->external_name()); } sibling = sibling->next_sibling(); } @@ -673,6 +674,28 @@ void Klass::oop_verify_on(oop obj, outputStream* st) { guarantee(obj->klass()->is_klass(), "klass field is not a klass"); } +klassVtable* Klass::vtable() const { + return new klassVtable(this, start_of_vtable(), vtable_length() / vtableEntry::size()); +} + +vtableEntry* Klass::start_of_vtable() const { + return (vtableEntry*) ((address)this + in_bytes(vtable_start_offset())); +} + +Method* Klass::method_at_vtable(int index) { +#ifndef PRODUCT + assert(index >= 0, "valid vtable index"); + if (DebugVtables) { + verify_vtable_index(index); + } +#endif + return start_of_vtable()[index].method(); +} + +ByteSize Klass::vtable_start_offset() { + return in_ByteSize(InstanceKlass::header_size() * wordSize); +} + #ifndef PRODUCT bool Klass::verify_vtable_index(int i) { diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index fbb40c16188..00fe28d614b 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,6 +57,7 @@ class ParCompactionManager; class PSPromotionManager; class KlassSizeStats; class fieldDescriptor; +class vtableEntry; class Klass : public Metadata { friend class VMStructs; @@ -131,13 +132,16 @@ class Klass : public Metadata { jint _modifier_flags; // Processed access flags, for use by Class.getModifiers. AccessFlags _access_flags; // Access flags. The class/interface distinction is stored here. + TRACE_DEFINE_KLASS_TRACE_ID; + // Biased locking implementation and statistics // (the 64-bit chunk goes first, to avoid some fragmentation) jlong _last_biased_lock_bulk_revocation_time; markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type jint _biased_lock_revocation_count; - TRACE_DEFINE_KLASS_TRACE_ID; + // vtable length + int _vtable_len; // Remembered sets support for the oops in the klasses. jbyte _modified_oops; // Card Table Equivalent (YC/CMS support) @@ -352,13 +356,13 @@ protected: | (log2_esize << _lh_log2_element_size_shift); } static jint instance_layout_helper(jint size, bool slow_path_flag) { - return (size << LogHeapWordSize) + return (size << LogBytesPerWord) | (slow_path_flag ? _lh_instance_slow_path_bit : 0); } static int layout_helper_to_size_helper(jint lh) { assert(lh > (jint)_lh_neutral_value, "must be instance"); // Note that the following expression discards _lh_instance_slow_path_bit. - return lh >> LogHeapWordSize; + return lh >> LogBytesPerWord; } // Out-of-line version computes everything based on the etype: static jint array_layout_helper(BasicType etype); @@ -374,8 +378,8 @@ protected: #endif // vtables - virtual klassVtable* vtable() const = 0; - virtual int vtable_length() const = 0; + klassVtable* vtable() const; + int vtable_length() const { return _vtable_len; } // subclass check bool is_subclass_of(const Klass* k) const; @@ -438,7 +442,17 @@ protected: virtual Klass* array_klass_impl(bool or_null, int rank, TRAPS); virtual Klass* array_klass_impl(bool or_null, TRAPS); + void set_vtable_length(int len) { _vtable_len= len; } + + vtableEntry* start_of_vtable() const; public: + Method* method_at_vtable(int index); + + static ByteSize vtable_start_offset(); + static ByteSize vtable_length_offset() { + return byte_offset_of(Klass, _vtable_len); + } + // CDS support - remove and restore oops from metadata. Oops are not shared. virtual void remove_unshareable_info(); virtual void restore_unshareable_info(ClassLoaderData* loader_data, Handle protection_domain, TRAPS); @@ -579,7 +593,7 @@ protected: virtual void oop_ps_push_contents( oop obj, PSPromotionManager* pm) = 0; // Parallel Compact virtual void oop_pc_follow_contents(oop obj, ParCompactionManager* cm) = 0; - virtual void oop_pc_update_pointers(oop obj) = 0; + virtual void oop_pc_update_pointers(oop obj, ParCompactionManager* cm) = 0; #endif // Iterators specialized to particular subtypes diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index 164532185e9..13e6fbadfa9 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -135,7 +135,7 @@ int klassVtable::initialize_from_super(KlassHandle super) { superVtable->verify(tty, true); #endif superVtable->copy_vtable_to(table()); - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { ResourceMark rm; log_develop_trace(vtables)("copy vtable from %s to %s size %d", super->internal_name(), klass()->internal_name(), @@ -272,7 +272,7 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper assert(super_method->name() == name && super_method->signature() == signature, "vtable entry name/sig mismatch"); #endif if (supersuperklass->is_override(super_method, target_loader, target_classname, THREAD)) { - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { ResourceMark rm(THREAD); outputStream* logst = LogHandle(vtables)::trace_stream(); char* sig = target_method()->name_and_sig_as_C_string(); @@ -303,7 +303,7 @@ static void log_vtables(int i, bool overrides, methodHandle target_method, KlassHandle target_klass, Method* super_method, Thread* thread) { #ifndef PRODUCT - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { ResourceMark rm(thread); outputStream* logst = LogHandle(vtables)::trace_stream(); char* sig = target_method()->name_and_sig_as_C_string(); @@ -491,7 +491,7 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar } void klassVtable::put_method_at(Method* m, int index) { - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { ResourceMark rm; outputStream* logst = LogHandle(vtables)::trace_stream(); const char* sig = (m != NULL) ? m->name_and_sig_as_C_string() : ""; @@ -818,7 +818,7 @@ int klassVtable::fill_in_mirandas(int initialized) { get_mirandas(&mirandas, NULL, ik()->super(), ik()->methods(), ik()->default_methods(), ik()->local_interfaces()); for (int i = 0; i < mirandas.length(); i++) { - if (develop_log_is_enabled(Trace, vtables)) { + if (log_develop_is_enabled(Trace, vtables)) { Method* meth = mirandas.at(i); ResourceMark rm(Thread::current()); outputStream* logst = LogHandle(vtables)::trace_stream(); @@ -1043,7 +1043,7 @@ int klassItable::assign_itable_indices_for_interface(Klass* klass) { if (interface_method_needs_itable_index(m)) { assert(!m->is_final_method(), "no final interface methods"); // If m is already assigned a vtable index, do not disturb it. - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { ResourceMark rm; outputStream* logst = LogHandle(itables)::trace_stream(); assert(m != NULL, "methods can never be null"); @@ -1158,7 +1158,7 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass int ime_num = m->itable_index(); assert(ime_num < ime_count, "oob"); itableOffsetEntry::method_entry(_klass(), method_table_offset)[ime_num].initialize(target()); - if (develop_log_is_enabled(Trace, itables)) { + if (log_develop_is_enabled(Trace, itables)) { ResourceMark rm(THREAD); if (target() != NULL) { outputStream* logst = LogHandle(itables)::trace_stream(); @@ -1331,7 +1331,7 @@ int klassItable::compute_itable_size(Array* transitive_interfaces) { int itable_size = calc_itable_size(cic.nof_interfaces() + 1, cic.nof_methods()); // Statistics - update_stats(itable_size * HeapWordSize); + update_stats(itable_size * wordSize); return itable_size; } diff --git a/hotspot/src/share/vm/oops/klassVtable.hpp b/hotspot/src/share/vm/oops/klassVtable.hpp index d135b33ccd2..0b4e23fa22e 100644 --- a/hotspot/src/share/vm/oops/klassVtable.hpp +++ b/hotspot/src/share/vm/oops/klassVtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,9 +170,9 @@ class vtableEntry VALUE_OBJ_CLASS_SPEC { public: // size in words - static int size() { - return sizeof(vtableEntry) / sizeof(HeapWord); - } + static int size() { return sizeof(vtableEntry) / wordSize; } + static int size_in_bytes() { return sizeof(vtableEntry); } + static int method_offset_in_bytes() { return offset_of(vtableEntry, _method); } Method* method() const { return _method; } @@ -223,7 +223,7 @@ class itableOffsetEntry VALUE_OBJ_CLASS_SPEC { void initialize(Klass* interf, int offset) { _interface = interf; _offset = offset; } // Static size and offset accessors - static int size() { return sizeof(itableOffsetEntry) / HeapWordSize; } // size in words + static int size() { return sizeof(itableOffsetEntry) / wordSize; } // size in words static int interface_offset_in_bytes() { return offset_of(itableOffsetEntry, _interface); } static int offset_offset_in_bytes() { return offset_of(itableOffsetEntry, _offset); } @@ -243,7 +243,7 @@ class itableMethodEntry VALUE_OBJ_CLASS_SPEC { void initialize(Method* method); // Static size and offset accessors - static int size() { return sizeof(itableMethodEntry) / HeapWordSize; } // size in words + static int size() { return sizeof(itableMethodEntry) / wordSize; } // size in words static int method_offset_in_bytes() { return offset_of(itableMethodEntry, _method); } friend class klassItable; diff --git a/hotspot/src/share/vm/oops/markOop.inline.hpp b/hotspot/src/share/vm/oops/markOop.inline.hpp index 94ab6eb1848..77d2fee0ebb 100644 --- a/hotspot/src/share/vm/oops/markOop.inline.hpp +++ b/hotspot/src/share/vm/oops/markOop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "oops/klass.hpp" #include "oops/markOop.hpp" +#include "oops/oop.inline.hpp" #include "runtime/globals.hpp" // Should this header be preserved during GC (when biased locking is enabled)? diff --git a/hotspot/src/share/vm/oops/metadata.hpp b/hotspot/src/share/vm/oops/metadata.hpp index dc52c452ee3..c42997292e2 100644 --- a/hotspot/src/share/vm/oops/metadata.hpp +++ b/hotspot/src/share/vm/oops/metadata.hpp @@ -58,13 +58,13 @@ class Metadata : public MetaspaceObj { if (this == NULL) st->print("NULL"); else - print_on(tty); + print_on(st); } void print_value_on_maybe_null(outputStream* st) const { if (this == NULL) st->print("NULL"); else - print_value_on(tty); + print_value_on(st); } virtual void print_on(outputStream* st) const; // First level print diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 9db75b1966f..7620ea9f985 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -295,7 +295,7 @@ int Method::size(bool is_native) { // If native, then include pointers for native_function and signature_handler int extra_bytes = (is_native) ? 2*sizeof(address*) : 0; int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord; - return align_object_size(header_size() + extra_words); + return align_metadata_size(header_size() + extra_words); } @@ -2101,15 +2101,16 @@ bool Method::has_method_vptr(const void* ptr) { Method m; // This assumes that the vtbl pointer is the first word of a C++ object. // This assumption is also in universe.cpp patch_klass_vtble - void* vtbl2 = dereference_vptr((const void*)&m); - void* this_vtbl = dereference_vptr(ptr); - return vtbl2 == this_vtbl; + return dereference_vptr(&m) == dereference_vptr(ptr); } // Check that this pointer is valid by checking that the vtbl pointer matches bool Method::is_valid_method() const { if (this == NULL) { return false; + } else if ((intptr_t(this) & (wordSize-1)) != 0) { + // Quick sanity check on pointer. + return false; } else if (!is_metaspace_object()) { return false; } else { diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index 8bc3b7073fc..8fc7b133a16 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -622,7 +622,7 @@ class Method : public Metadata { bool has_compiled_code() const { return code() != NULL; } // sizing - static int header_size() { return sizeof(Method)/HeapWordSize; } + static int header_size() { return sizeof(Method)/wordSize; } static int size(bool is_native); int size() const { return method_size(); } #if INCLUDE_SERVICES diff --git a/hotspot/src/share/vm/oops/methodData.cpp b/hotspot/src/share/vm/oops/methodData.cpp index 5f278176275..319787a189a 100644 --- a/hotspot/src/share/vm/oops/methodData.cpp +++ b/hotspot/src/share/vm/oops/methodData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -934,7 +934,7 @@ int MethodData::compute_allocation_size_in_bytes(const methodHandle& method) { int MethodData::compute_allocation_size_in_words(const methodHandle& method) { int byte_size = compute_allocation_size_in_bytes(method); int word_size = align_size_up(byte_size, BytesPerWord) / BytesPerWord; - return align_object_size(word_size); + return align_metadata_size(word_size); } // Initialize an individual data segment. Returns the size of diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index c8d3d8fc247..59669602a38 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2334,7 +2334,7 @@ public: // My size int size_in_bytes() const { return _size; } - int size() const { return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); } + int size() const { return align_metadata_size(align_size_up(_size, BytesPerWord)/BytesPerWord); } #if INCLUDE_SERVICES void collect_statistics(KlassSizeStats *sz) const; #endif diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index 17d2b43e4ef..eabbec56c96 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 +101,7 @@ class ObjArrayKlass : public ArrayKlass { } // Sizing - static int header_size() { return sizeof(ObjArrayKlass)/HeapWordSize; } + static int header_size() { return sizeof(ObjArrayKlass)/wordSize; } int size() const { return ArrayKlass::static_size(header_size()); } // Initialization (virtual from Klass) @@ -116,7 +116,7 @@ class ObjArrayKlass : public ArrayKlass { void oop_ps_push_contents( oop obj, PSPromotionManager* pm); // Parallel Compact void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); - void oop_pc_update_pointers(oop obj); + void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); #endif // Oop fields (and metadata) iterators diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp index b30b1fd8007..dfa8b319fcb 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.hpp @@ -81,7 +81,7 @@ private: // Accessing oop obj_at(int index) const; - void /*inline*/ obj_at_put(int index, oop value); + void inline obj_at_put(int index, oop value); oop atomic_compare_exchange_oop(int index, oop exchange_value, oop compare_value); diff --git a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp index 5c9004de897..56f542da4f5 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp @@ -39,7 +39,7 @@ inline oop objArrayOopDesc::obj_at(int index) const { } } -inline void objArrayOopDesc::obj_at_put(int index, oop value) { +void objArrayOopDesc::obj_at_put(int index, oop value) { if (UseCompressedOops) { oop_store(obj_at_addr(index), value); } else { diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index 20e25261d5b..d154f966568 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -82,16 +82,16 @@ class oopDesc { // objects during a GC) -- requires a valid klass pointer inline void init_mark(); - /*inline*/ Klass* klass() const; + inline Klass* klass() const; inline Klass* klass_or_null() const volatile; inline Klass** klass_addr(); inline narrowKlass* compressed_klass_addr(); - /*inline*/ void set_klass(Klass* k); + inline void set_klass(Klass* k); // For klass field compression inline int klass_gap() const; - /*inline*/ void set_klass_gap(int z); + inline void set_klass_gap(int z); // For when the klass pointer is being used as a linked list "next" field. inline void set_klass_to_list_ptr(oop k); inline oop list_ptr_from_klass(); @@ -103,7 +103,7 @@ class oopDesc { inline bool is_a(Klass* k) const; // Returns the actual oop size of the object - /*inline*/ int size(); + inline int size(); // Sometimes (for complicated concurrency-related reasons), it is useful // to be able to figure out the size of an object knowing its klass. @@ -111,7 +111,7 @@ class oopDesc { // type test operations (inlined in oop.inline.hpp) inline bool is_instance() const; - /*inline*/ bool is_array() const; + inline bool is_array() const; inline bool is_objArray() const; inline bool is_typeArray() const; @@ -149,15 +149,15 @@ class oopDesc { // These are overloaded for oop and narrowOop as are the other functions // below so that they can be called in template functions. static inline oop decode_heap_oop_not_null(oop v) { return v; } - static /*inline*/ oop decode_heap_oop_not_null(narrowOop v); + static inline oop decode_heap_oop_not_null(narrowOop v); static inline oop decode_heap_oop(oop v) { return v; } - static /*inline*/ oop decode_heap_oop(narrowOop v); + static inline oop decode_heap_oop(narrowOop v); // Encode an oop pointer to a narrow oop. The or_null versions accept // null oop pointer, others do not in order to eliminate the // null checking branches. static inline narrowOop encode_heap_oop_not_null(oop v); - static /*inline*/ narrowOop encode_heap_oop(oop v); + static inline narrowOop encode_heap_oop(oop v); // Load an oop out of the Java heap as is without decoding. // Called by GC to check for null before decoding. @@ -284,8 +284,8 @@ class oopDesc { inline bool has_bias_pattern() const; // asserts - /*inline*/ bool is_oop(bool ignore_mark_word = false) const; - /*inline*/ bool is_oop_or_null(bool ignore_mark_word = false) const; + inline bool is_oop(bool ignore_mark_word = false) const; + inline bool is_oop_or_null(bool ignore_mark_word = false) const; #ifndef PRODUCT inline bool is_unlocked_oop() const; #endif @@ -312,7 +312,7 @@ class oopDesc { inline oop forwardee() const; // Age of object during scavenge - /*inline*/ uint age() const; + inline uint age() const; inline void incr_age(); // mark-sweep support @@ -330,8 +330,8 @@ class oopDesc { inline int ms_adjust_pointers(); #if INCLUDE_ALL_GCS // Parallel Compact - inline void pc_follow_contents(ParCompactionManager* pc); - inline void pc_update_contents(); + inline void pc_follow_contents(ParCompactionManager* cm); + inline void pc_update_contents(ParCompactionManager* cm); // Parallel Scavenge inline void ps_push_contents(PSPromotionManager* pm); #endif diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 32b87fa1edd..73c7142de60 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -100,7 +100,7 @@ void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); } -inline Klass* oopDesc::klass() const { +Klass* oopDesc::klass() const { if (UseCompressedClassPointers) { return Klass::decode_klass_not_null(_metadata._compressed_klass); } else { @@ -129,7 +129,7 @@ narrowKlass* oopDesc::compressed_klass_addr() { return &_metadata._compressed_klass; } -inline void oopDesc::set_klass(Klass* k) { +void oopDesc::set_klass(Klass* k) { // since klasses are promoted no store check is needed assert(Universe::is_bootstrapping() || k != NULL, "must be a real Klass*"); assert(Universe::is_bootstrapping() || k->is_klass(), "not a Klass*"); @@ -144,7 +144,7 @@ int oopDesc::klass_gap() const { return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()); } -inline void oopDesc::set_klass_gap(int v) { +void oopDesc::set_klass_gap(int v) { if (UseCompressedClassPointers) { *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v; } @@ -174,7 +174,7 @@ bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); } -inline int oopDesc::size() { +int oopDesc::size() { return size_given_klass(klass()); } @@ -264,7 +264,7 @@ int oopDesc::size_given_klass(Klass* klass) { } bool oopDesc::is_instance() const { return klass()->is_instance_klass(); } -inline bool oopDesc::is_array() const { return klass()->is_array_klass(); } +bool oopDesc::is_array() const { return klass()->is_array_klass(); } bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); } bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); } @@ -298,7 +298,7 @@ inline bool check_obj_alignment(oop obj) { return cast_from_oop(obj) % MinObjAlignmentInBytes == 0; } -inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { +oop oopDesc::decode_heap_oop_not_null(narrowOop v) { assert(!is_null(v), "narrow oop value can never be zero"); address base = Universe::narrow_oop_base(); int shift = Universe::narrow_oop_shift(); @@ -307,7 +307,7 @@ inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { return result; } -inline oop oopDesc::decode_heap_oop(narrowOop v) { +oop oopDesc::decode_heap_oop(narrowOop v) { return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); } @@ -325,7 +325,7 @@ narrowOop oopDesc::encode_heap_oop_not_null(oop v) { return (narrowOop)result; } -inline narrowOop oopDesc::encode_heap_oop(oop v) { +narrowOop oopDesc::encode_heap_oop(oop v) { return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); } @@ -516,7 +516,7 @@ bool oopDesc::has_bias_pattern() const { } // used only for asserts -inline bool oopDesc::is_oop(bool ignore_mark_word) const { +bool oopDesc::is_oop(bool ignore_mark_word) const { oop obj = (oop) this; if (!check_obj_alignment(obj)) return false; if (!Universe::heap()->is_in_reserved(obj)) return false; @@ -538,7 +538,7 @@ inline bool oopDesc::is_oop(bool ignore_mark_word) const { // used only for asserts -inline bool oopDesc::is_oop_or_null(bool ignore_mark_word) const { +bool oopDesc::is_oop_or_null(bool ignore_mark_word) const { return this == NULL ? true : is_oop(ignore_mark_word); } @@ -620,7 +620,7 @@ oop oopDesc::forwardee() const { } // The following method needs to be MT safe. -inline uint oopDesc::age() const { +uint oopDesc::age() const { assert(!is_forwarded(), "Attempt to read age from forwarded mark"); if (has_displaced_mark()) { return displaced_mark()->age(); @@ -650,11 +650,11 @@ void oopDesc::pc_follow_contents(ParCompactionManager* cm) { klass()->oop_pc_follow_contents(this, cm); } -void oopDesc::pc_update_contents() { +void oopDesc::pc_update_contents(ParCompactionManager* cm) { Klass* k = klass(); if (!k->is_typeArray_klass()) { // It might contain oops beyond the header, so take the virtual call. - k->oop_pc_update_pointers(this); + k->oop_pc_update_pointers(this, cm); } // Else skip it. The TypeArrayKlass in the header never needs scavenging. } diff --git a/hotspot/src/share/vm/oops/symbol.cpp b/hotspot/src/share/vm/oops/symbol.cpp index bbac298cbd3..be5901f3f6b 100644 --- a/hotspot/src/share/vm/oops/symbol.cpp +++ b/hotspot/src/share/vm/oops/symbol.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,20 +42,19 @@ Symbol::Symbol(const u1* name, int length, int refcount) { } void* Symbol::operator new(size_t sz, int len, TRAPS) throw() { - int alloc_size = size(len)*HeapWordSize; + int alloc_size = size(len)*wordSize; address res = (address) AllocateHeap(alloc_size, mtSymbol); return res; } void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) throw() { - int alloc_size = size(len)*HeapWordSize; - address res = (address)arena->Amalloc(alloc_size); + int alloc_size = size(len)*wordSize; + address res = (address)arena->Amalloc_4(alloc_size); return res; } void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) throw() { address res; - int alloc_size = size(len)*HeapWordSize; res = (address) Metaspace::allocate(loader_data, size(len), true, MetaspaceObj::SymbolType, CHECK_NULL); return res; diff --git a/hotspot/src/share/vm/oops/symbol.hpp b/hotspot/src/share/vm/oops/symbol.hpp index 074ee879e70..f4241d3ad8d 100644 --- a/hotspot/src/share/vm/oops/symbol.hpp +++ b/hotspot/src/share/vm/oops/symbol.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,8 +125,8 @@ class Symbol : public MetaspaceObj { }; static int size(int length) { - size_t sz = heap_word_size(sizeof(Symbol) + (length > 2 ? length - 2 : 0)); - return align_object_size(sz); + // minimum number of natural words needed to hold these bits (no non-heap version) + return (int)heap_word_size(sizeof(Symbol) + (length > 2 ? length - 2 : 0)); } void byte_at_put(int index, int value) { diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.hpp b/hotspot/src/share/vm/oops/typeArrayKlass.hpp index e357717e476..7f07e4fb482 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ class TypeArrayKlass : public ArrayKlass { void oop_ps_push_contents( oop obj, PSPromotionManager* pm); // Parallel Compact void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); - void oop_pc_update_pointers(oop obj); + void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); #endif // Oop iterators. Since there are no oops in TypeArrayKlasses, @@ -133,7 +133,7 @@ class TypeArrayKlass : public ArrayKlass { static const char* external_name(BasicType type); // Sizing - static int header_size() { return sizeof(TypeArrayKlass)/HeapWordSize; } + static int header_size() { return sizeof(TypeArrayKlass)/wordSize; } int size() const { return ArrayKlass::static_size(header_size()); } // Initialization (virtual from Klass) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 0ab8dbb540f..753612c206f 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -3822,8 +3822,8 @@ Node* LibraryCallKit::generate_virtual_guard(Node* obj_klass, assert(vtable_index >= 0 || vtable_index == Method::nonvirtual_vtable_index, "bad index %d", vtable_index); // Get the Method* out of the appropriate vtable entry. - int entry_offset = (InstanceKlass::vtable_start_offset() + - vtable_index*vtableEntry::size()) * wordSize + + int entry_offset = in_bytes(Klass::vtable_start_offset()) + + vtable_index*vtableEntry::size_in_bytes() + vtableEntry::method_offset_in_bytes(); Node* entry_addr = basic_plus_adr(obj_klass, entry_offset); Node* target_call = make_load(NULL, entry_addr, TypePtr::NOTNULL, T_ADDRESS, MemNode::unordered); diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index e3251d14e56..d4808682944 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1131,11 +1131,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive assert(m->valid_vtable_index(), "no valid vtable index"); int vtbl_index = m->vtable_index(); if (vtbl_index != Method::nonvirtual_vtable_index) { - Klass* k = h_recv->klass(); - // k might be an arrayKlassOop but all vtables start at - // the same place. The cast is to avoid virtual call and assertion. - InstanceKlass *ik = (InstanceKlass*)k; - selected_method = ik->method_at_vtable(vtbl_index); + selected_method = h_recv->klass()->method_at_vtable(vtbl_index); } else { // final method selected_method = m; diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index a699b79ed95..c2b5289a21d 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include "interpreter/bytecodeStream.hpp" #include "interpreter/interpreter.hpp" #include "jvmtifiles/jvmtiEnv.hpp" +#include "logging/log.hpp" #include "logging/logConfiguration.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" @@ -473,9 +474,7 @@ JvmtiEnv::AddToBootstrapClassLoaderSearch(const char* segment) { ObjectLocker ol(loader_lock, thread); // add the jar file to the bootclasspath - if (TraceClassLoading) { - tty->print_cr("[Opened %s]", zip_entry->name()); - } + log_info(classload)("opened: %s", zip_entry->name()); ClassLoaderExt::append_boot_classpath(zip_entry); return JVMTI_ERROR_NONE; } else { @@ -625,8 +624,13 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { // ignore break; case JVMTI_VERBOSE_CLASS: - TraceClassLoading = value != 0; - TraceClassUnloading = value != 0; + if (value == 0) { + LogConfiguration::parse_log_arguments("stdout", "classunload=off", NULL, NULL, NULL); + LogConfiguration::parse_log_arguments("stdout", "classload=off", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "classload=info", NULL, NULL, NULL); + LogConfiguration::parse_log_arguments("stdout", "classunload=info", NULL, NULL, NULL); + } break; case JVMTI_VERBOSE_GC: if (value == 0) { diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 9e993f7afad..51750b8338e 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,9 +51,9 @@ #include "utilities/exceptions.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS -#include "gc/g1/concurrentMark.hpp" #include "gc/g1/concurrentMarkThread.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" +#include "gc/g1/g1ConcurrentMark.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/parallel/parallelScavengeHeap.inline.hpp" #include "gc/parallel/adjoiningGenerations.hpp" @@ -1410,7 +1410,7 @@ int WhiteBox::offset_for_field(const char* field_name, oop object, if (res == NULL) { tty->print_cr("Invalid layout of %s at %s", ik->external_name(), name_symbol->as_C_string()); - vm_exit_during_initialization("Invalid layout of preloaded class: use -XX:+TraceClassLoading to see the origin of the problem class"); + vm_exit_during_initialization("Invalid layout of preloaded class: use -Xlog:classload=info to see the origin of the problem class"); } //fetch the field at the offset we've found diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 365013e152d..2d41950f305 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -83,6 +83,7 @@ char** Arguments::_jvm_args_array = NULL; int Arguments::_num_jvm_args = 0; char* Arguments::_java_command = NULL; SystemProperty* Arguments::_system_properties = NULL; +const char* Arguments::_gc_log_filename = NULL; bool Arguments::_has_profile = false; size_t Arguments::_conservative_max_heap_alignment = 0; size_t Arguments::_min_heap_size = 0; @@ -401,10 +402,12 @@ static AliasedFlag const aliased_jvm_flags[] = { }; static AliasedLoggingFlag const aliased_logging_flags[] = { - { "TraceClassResolution", LogLevel::Info, true, LogTag::_classresolve }, - { "TraceExceptions", LogLevel::Info, true, LogTag::_exceptions }, - { "TraceMonitorInflation", LogLevel::Debug, true, LogTag::_monitorinflation }, - { NULL, LogLevel::Off, false, LogTag::__NO_TAG } + { "TraceClassLoading", LogLevel::Info, true, LogTag::_classload }, + { "TraceClassUnloading", LogLevel::Info, true, LogTag::_classunload }, + { "TraceClassResolution", LogLevel::Info, true, LogTag::_classresolve }, + { "TraceExceptions", LogLevel::Info, true, LogTag::_exceptions }, + { "TraceMonitorInflation", LogLevel::Debug, true, LogTag::_monitorinflation }, + { NULL, LogLevel::Off, false, LogTag::__NO_TAG } }; // Return true if "v" is less than "other", where "other" may be "undefined". @@ -2652,12 +2655,8 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, // -verbose:[class/gc/jni] if (match_option(option, "-verbose", &tail)) { if (!strcmp(tail, ":class") || !strcmp(tail, "")) { - if (FLAG_SET_CMDLINE(bool, TraceClassLoading, true) != Flag::SUCCESS) { - return JNI_EINVAL; - } - if (FLAG_SET_CMDLINE(bool, TraceClassUnloading, true) != Flag::SUCCESS) { - return JNI_EINVAL; - } + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(classload)); + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(classunload)); } else if (!strcmp(tail, ":gc")) { LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } else if (!strcmp(tail, ":jni")) { @@ -3090,6 +3089,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, // -Xnoagent } else if (match_option(option, "-Xnoagent")) { // For compatibility with classic. HotSpot refuses to load the old style agent.dll. + } else if (match_option(option, "-Xloggc:", &tail)) { + // Deprecated flag to redirect GC output to a file. -Xloggc: + log_warning(gc)("-Xloggc is deprecated. Will use -Xlog:gc:%s instead.", tail); + _gc_log_filename = os::strdup_check_oom(tail); } else if (match_option(option, "-Xlog", &tail)) { bool ret = false; if (strcmp(tail, ":help") == 0) { @@ -3999,6 +4002,24 @@ static void print_options(const JavaVMInitArgs *args) { } } +bool Arguments::handle_deprecated_print_gc_flags() { + if (PrintGC) { + log_warning(gc)("-XX:+PrintGC is deprecated. Will use -Xlog:gc instead."); + } + if (PrintGCDetails) { + log_warning(gc)("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); + } + + if (_gc_log_filename != NULL) { + // -Xloggc was used to specify a filename + const char* gc_conf = PrintGCDetails ? "gc*" : "gc"; + return LogConfiguration::parse_log_arguments(_gc_log_filename, gc_conf, NULL, NULL, NULL); + } else if (PrintGC || PrintGCDetails) { + LogConfiguration::configure_stdout(LogLevel::Info, !PrintGCDetails, LOG_TAGS(gc)); + } + return true; +} + // Parse entry point called from JNI_CreateJavaVM jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { @@ -4147,6 +4168,10 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { ScavengeRootsInCode = 1; } + if (!handle_deprecated_print_gc_flags()) { + return JNI_EINVAL; + } + // Set object alignment values. set_object_alignment(); diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index a6918fde8e7..e7ce4f30cab 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -294,6 +294,7 @@ class Arguments : AllStatic { // Option flags static bool _has_profile; + static const char* _gc_log_filename; // Value of the conservative maximum heap alignment needed static size_t _conservative_max_heap_alignment; @@ -400,6 +401,8 @@ class Arguments : AllStatic { static jint match_special_option_and_act(const JavaVMInitArgs* args, ScopedVMInitArgs* args_out); + static bool handle_deprecated_print_gc_flags(); + static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, const JavaVMInitArgs *java_options_args, const JavaVMInitArgs *cmd_line_args); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index fd6e47518c5..d16732ef065 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -2388,6 +2388,14 @@ public: "will sleep while yielding before giving up and resuming GC") \ range(0, max_juint) \ \ + product(bool, PrintGC, false, \ + "Print message at garbage collection. " \ + "Deprecated, use -Xlog:gc instead.") \ + \ + product(bool, PrintGCDetails, false, \ + "Print more details at garbage collection. " \ + "Deprecated, use -Xlog:gc* instead.") \ + \ develop(intx, ConcGCYieldTimeout, 0, \ "If non-zero, assert that GC threads yield within this " \ "number of milliseconds") \ @@ -2405,21 +2413,12 @@ public: product(bool, TraceClassPaths, false, \ "Trace processing of class paths") \ \ - product_rw(bool, TraceClassLoading, false, \ - "Trace all classes loaded") \ - \ product(bool, TraceClassLoadingPreorder, false, \ "Trace all classes loaded in order referenced (not loaded)") \ \ - product_rw(bool, TraceClassUnloading, false, \ - "Trace unloading of classes") \ - \ product_rw(bool, TraceLoaderConstraints, false, \ "Trace loader constraints") \ \ - develop(bool, TraceClassLoaderData, false, \ - "Trace class loader loader_data lifetime") \ - \ product(size_t, InitialBootClassLoaderMetaspaceSize, \ NOT_LP64(2200*K) LP64_ONLY(4*M), \ "Initial size of the boot class loader data metaspace") \ @@ -3249,7 +3248,7 @@ public: \ product(size_t, MinTLABSize, 2*K, \ "Minimum allowed TLAB size (in bytes)") \ - range(1, max_uintx) \ + range(1, max_uintx/2) \ constraint(MinTLABSizeConstraintFunc,AfterMemoryInit) \ \ product(size_t, TLABSize, 0, \ @@ -3392,10 +3391,10 @@ public: "also has a smaller default value; see arguments.cpp.") \ range(0, 100) \ \ - product(uintx, MarkSweepAlwaysCompactCount, 4, \ + product(uint, MarkSweepAlwaysCompactCount, 4, \ "How often should we fully compact the heap (ignoring the dead " \ "space parameters)") \ - range(1, max_uintx) \ + range(1, max_juint) \ \ develop(uintx, GCExpandToAllocateDelayMillis, 0, \ "Delay between expansion and allocation (in milliseconds)") \ @@ -3948,7 +3947,7 @@ public: product(bool, PerfDisableSharedMem, false, \ "Store performance data in standard memory") \ \ - product(intx, PerfDataMemorySize, 64*K, \ + product(intx, PerfDataMemorySize, 32*K, \ "Size of performance data memory region. Will be rounded " \ "up to a multiple of the native os page size.") \ range(128, 32*64*K) \ diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 9df11977229..84235d8803f 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -421,7 +421,10 @@ void before_exit(JavaThread* thread) { assert(_before_exit_status == BEFORE_EXIT_DONE, "invalid state"); return; case BEFORE_EXIT_DONE: - return; + // need block to avoid SS compiler bug + { + return; + } } } diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 699914032ff..5aedae5bf57 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -1490,7 +1490,7 @@ bool os::is_server_class_machine() { if (logical_processors > 1) { const unsigned int physical_packages = os::active_processor_count() / logical_processors; - if (physical_packages > server_processors) { + if (physical_packages >= server_processors) { result = true; } } else { diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index 5c12e122566..7eda3c51393 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -939,10 +939,7 @@ static oop invoke(instanceKlassHandle klass, int index = reflected_method->vtable_index(); method = reflected_method; if (index != Method::nonvirtual_vtable_index) { - // target_klass might be an arrayKlassOop but all vtables start at - // the same place. The cast is to avoid virtual call and assertion. - InstanceKlass* inst = (InstanceKlass*)target_klass(); - method = methodHandle(THREAD, inst->method_at_vtable(index)); + method = methodHandle(THREAD, target_klass->method_at_vtable(index)); } if (!method.is_null()) { // Check for abstract methods as well diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 971012fbb11..7203ff9fbe7 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -42,6 +42,8 @@ #include "runtime/synchronizer.hpp" #include "runtime/thread.inline.hpp" #include "runtime/vframe.hpp" +#include "trace/traceMacros.hpp" +#include "trace/tracing.hpp" #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/preserveException.hpp" @@ -130,6 +132,10 @@ static volatile intptr_t gListLock = 0; // protects global monitor lists static volatile int gMonitorFreeCount = 0; // # on gFreeList static volatile int gMonitorPopulation = 0; // # Extant -- in circulation +static void post_monitor_inflate_event(EventJavaMonitorInflate&, + const oop, + const ObjectSynchronizer::InflateCause); + #define CHAINMARKER (cast_to_oop(-1)) @@ -304,7 +310,9 @@ void ObjectSynchronizer::fast_exit(oop object, BasicLock* lock, TRAPS) { } } - ObjectSynchronizer::inflate(THREAD, object)->exit(true, THREAD); + ObjectSynchronizer::inflate(THREAD, + object, + inflate_cause_vm_internal)->exit(true, THREAD); } // ----------------------------------------------------------------------------- @@ -338,7 +346,9 @@ void ObjectSynchronizer::slow_enter(Handle obj, BasicLock* lock, TRAPS) { // must be non-zero to avoid looking like a re-entrant lock, // and must not look locked either. lock->set_displaced_header(markOopDesc::unused_mark()); - ObjectSynchronizer::inflate(THREAD, obj())->enter(THREAD); + ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_monitor_enter)->enter(THREAD); } // This routine is used to handle interpreter/compiler slow case @@ -368,7 +378,9 @@ intptr_t ObjectSynchronizer::complete_exit(Handle obj, TRAPS) { assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj()); + ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_vm_internal); return monitor->complete_exit(THREAD); } @@ -381,7 +393,9 @@ void ObjectSynchronizer::reenter(Handle obj, intptr_t recursion, TRAPS) { assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj()); + ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_vm_internal); monitor->reenter(recursion, THREAD); } @@ -396,7 +410,7 @@ void ObjectSynchronizer::jni_enter(Handle obj, TRAPS) { assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } THREAD->set_current_pending_monitor_is_from_java(false); - ObjectSynchronizer::inflate(THREAD, obj())->enter(THREAD); + ObjectSynchronizer::inflate(THREAD, obj(), inflate_cause_jni_enter)->enter(THREAD); THREAD->set_current_pending_monitor_is_from_java(true); } @@ -410,7 +424,9 @@ void ObjectSynchronizer::jni_exit(oop obj, Thread* THREAD) { } assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj); + ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, + obj, + inflate_cause_jni_exit); // If this thread has locked the object, exit the monitor. Note: can't use // monitor->check(CHECK); must exit even if an exception is pending. if (monitor->check(THREAD)) { @@ -453,7 +469,10 @@ int ObjectSynchronizer::wait(Handle obj, jlong millis, TRAPS) { TEVENT(wait - throw IAX); THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } - ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj()); + ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_wait); + DTRACE_MONITOR_WAIT_PROBE(monitor, obj(), THREAD, millis); monitor->wait(millis, true, THREAD); @@ -473,7 +492,9 @@ void ObjectSynchronizer::waitUninterruptibly(Handle obj, jlong millis, TRAPS) { TEVENT(wait - throw IAX); THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } - ObjectSynchronizer::inflate(THREAD, obj()) -> wait(millis, false, THREAD); + ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_wait)->wait(millis, false, THREAD); } void ObjectSynchronizer::notify(Handle obj, TRAPS) { @@ -486,7 +507,9 @@ void ObjectSynchronizer::notify(Handle obj, TRAPS) { if (mark->has_locker() && THREAD->is_lock_owned((address)mark->locker())) { return; } - ObjectSynchronizer::inflate(THREAD, obj())->notify(THREAD); + ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_notify)->notify(THREAD); } // NOTE: see comment of notify() @@ -500,7 +523,9 @@ void ObjectSynchronizer::notifyall(Handle obj, TRAPS) { if (mark->has_locker() && THREAD->is_lock_owned((address)mark->locker())) { return; } - ObjectSynchronizer::inflate(THREAD, obj())->notifyAll(THREAD); + ObjectSynchronizer::inflate(THREAD, + obj(), + inflate_cause_notify)->notifyAll(THREAD); } // ----------------------------------------------------------------------------- @@ -749,7 +774,7 @@ intptr_t ObjectSynchronizer::FastHashCode(Thread * Self, oop obj) { } // Inflate the monitor to set hash code - monitor = ObjectSynchronizer::inflate(Self, obj); + monitor = ObjectSynchronizer::inflate(Self, obj, inflate_cause_hash_code); // Load displaced header and check it has hash code mark = monitor->header(); assert(mark->is_neutral(), "invariant"); @@ -1283,17 +1308,22 @@ ObjectMonitor* ObjectSynchronizer::inflate_helper(oop obj) { assert(mark->monitor()->header()->is_neutral(), "monitor must record a good object header"); return mark->monitor(); } - return ObjectSynchronizer::inflate(Thread::current(), obj); + return ObjectSynchronizer::inflate(Thread::current(), + obj, + inflate_cause_vm_internal); } - ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, - oop object) { + oop object, + const InflateCause cause) { + // Inflate mutates the heap ... // Relaxing assertion for bug 6320749. assert(Universe::verify_in_progress() || !SafepointSynchronize::is_at_safepoint(), "invariant"); + EventJavaMonitorInflate event; + for (;;) { const markOop mark = object->mark(); assert(!mark->has_bias_pattern(), "invariant"); @@ -1311,6 +1341,7 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, assert(inf->header()->is_neutral(), "invariant"); assert(inf->object() == object, "invariant"); assert(ObjectSynchronizer::verify_objmon_isinpool(inf), "monitor is invalid"); + event.cancel(); // let's not post an inflation event, unless we did the deed ourselves return inf; } @@ -1423,6 +1454,9 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, object->klass()->external_name()); } } + if (event.should_commit()) { + post_monitor_inflate_event(event, object, cause); + } return m; } @@ -1471,6 +1505,9 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, object->klass()->external_name()); } } + if (event.should_commit()) { + post_monitor_inflate_event(event, object, cause); + } return m; } } @@ -1742,6 +1779,33 @@ void ObjectSynchronizer::release_monitors_owned_by_thread(TRAPS) { THREAD->clear_pending_exception(); } +const char* ObjectSynchronizer::inflate_cause_name(const InflateCause cause) { + switch (cause) { + case inflate_cause_vm_internal: return "VM Internal"; + case inflate_cause_monitor_enter: return "Monitor Enter"; + case inflate_cause_wait: return "Monitor Wait"; + case inflate_cause_notify: return "Monitor Notify"; + case inflate_cause_hash_code: return "Monitor Hash Code"; + case inflate_cause_jni_enter: return "JNI Monitor Enter"; + case inflate_cause_jni_exit: return "JNI Monitor Exit"; + default: + ShouldNotReachHere(); + } + return "Unknown"; +} + +static void post_monitor_inflate_event(EventJavaMonitorInflate& event, + const oop obj, + const ObjectSynchronizer::InflateCause cause) { +#if INCLUDE_TRACE + assert(event.should_commit(), "check outside"); + event.set_klass(obj->klass()); + event.set_address((TYPE_ADDRESS)(uintptr_t)(void*)obj); + event.set_cause((u1)cause); + event.commit(); +#endif +} + //------------------------------------------------------------------------------ // Debugging code diff --git a/hotspot/src/share/vm/runtime/synchronizer.hpp b/hotspot/src/share/vm/runtime/synchronizer.hpp index 0d577bf3303..ab3d145842c 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.hpp +++ b/hotspot/src/share/vm/runtime/synchronizer.hpp @@ -42,6 +42,18 @@ class ObjectSynchronizer : AllStatic { owner_none, owner_other } LockOwnership; + + typedef enum { + inflate_cause_vm_internal = 0, + inflate_cause_monitor_enter = 1, + inflate_cause_wait = 2, + inflate_cause_notify = 3, + inflate_cause_hash_code = 4, + inflate_cause_jni_enter = 5, + inflate_cause_jni_exit = 6, + inflate_cause_nof = 7 // Number of causes + } InflateCause; + // exit must be implemented non-blocking, since the compiler cannot easily handle // deoptimization at monitor exit. Hence, it does not take a Handle argument. @@ -94,9 +106,10 @@ class ObjectSynchronizer : AllStatic { static void omFlush(Thread * Self); // Inflate light weight monitor to heavy weight monitor - static ObjectMonitor* inflate(Thread * Self, oop obj); + static ObjectMonitor* inflate(Thread * Self, oop obj, const InflateCause cause); // This version is only for internal use static ObjectMonitor* inflate_helper(oop obj); + static const char* inflate_cause_name(const InflateCause cause); // Returns the identity hash value for an oop // NOTE: It may cause monitor inflation diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index b3db7ef26da..c6519c03600 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -298,7 +298,6 @@ typedef CompactHashtable SymbolCompactHashTable; nonstatic_field(ArrayKlass, _dimension, int) \ volatile_nonstatic_field(ArrayKlass, _higher_dimension, Klass*) \ volatile_nonstatic_field(ArrayKlass, _lower_dimension, Klass*) \ - nonstatic_field(ArrayKlass, _vtable_len, int) \ nonstatic_field(CompiledICHolder, _holder_method, Method*) \ nonstatic_field(CompiledICHolder, _holder_klass, Klass*) \ nonstatic_field(ConstantPool, _tags, Array*) \ @@ -332,7 +331,6 @@ typedef CompactHashtable SymbolCompactHashTable; nonstatic_field(InstanceKlass, _major_version, u2) \ nonstatic_field(InstanceKlass, _init_state, u1) \ nonstatic_field(InstanceKlass, _init_thread, Thread*) \ - nonstatic_field(InstanceKlass, _vtable_len, int) \ nonstatic_field(InstanceKlass, _itable_len, int) \ nonstatic_field(InstanceKlass, _reference_type, u1) \ volatile_nonstatic_field(InstanceKlass, _oop_map_cache, OopMapCache*) \ @@ -358,6 +356,7 @@ typedef CompactHashtable SymbolCompactHashTable; nonstatic_field(Klass, _access_flags, AccessFlags) \ nonstatic_field(Klass, _prototype_header, markOop) \ nonstatic_field(Klass, _next_sibling, Klass*) \ + nonstatic_field(Klass, _vtable_len, int) \ nonstatic_field(vtableEntry, _method, Method*) \ nonstatic_field(MethodData, _size, int) \ nonstatic_field(MethodData, _method, Method*) \ diff --git a/hotspot/src/share/vm/services/classLoadingService.cpp b/hotspot/src/share/vm/services/classLoadingService.cpp index 24c76e5d172..4acb22502ce 100644 --- a/hotspot/src/share/vm/services/classLoadingService.cpp +++ b/hotspot/src/share/vm/services/classLoadingService.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ #include "utilities/dtrace.hpp" #include "utilities/macros.hpp" #include "utilities/defaultStream.hpp" +#include "logging/log.hpp" +#include "logging/logConfiguration.hpp" #ifdef DTRACE_ENABLED @@ -135,9 +137,9 @@ void ClassLoadingService::notify_class_unloaded(InstanceKlass* k) { } } - if (TraceClassUnloading) { + if (log_is_enabled(Info, classunload)) { ResourceMark rm; - tty->print_cr("[Unloading class %s " INTPTR_FORMAT "]", k->external_name(), p2i(k)); + log_info(classunload)("unloading class %s " INTPTR_FORMAT , k->external_name(), p2i(k)); } } @@ -179,12 +181,13 @@ size_t ClassLoadingService::compute_class_size(InstanceKlass* k) { bool ClassLoadingService::set_verbose(bool verbose) { MutexLocker m(Management_lock); - // verbose will be set to the previous value - Flag::Error error = CommandLineFlags::boolAtPut("TraceClassLoading", &verbose, Flag::MANAGEMENT); - assert(error==Flag::SUCCESS, "Setting TraceClassLoading flag failed with error %s", Flag::flag_error_str(error)); + if (verbose) { + LogConfiguration::parse_log_arguments("stdout", "classload=info", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "classload=off", NULL, NULL, NULL); + } reset_trace_class_unloading(); - return verbose; } @@ -192,8 +195,11 @@ bool ClassLoadingService::set_verbose(bool verbose) { void ClassLoadingService::reset_trace_class_unloading() { assert(Management_lock->owned_by_self(), "Must own the Management_lock"); bool value = MemoryService::get_verbose() || ClassLoadingService::get_verbose(); - Flag::Error error = CommandLineFlags::boolAtPut("TraceClassUnloading", &value, Flag::MANAGEMENT); - assert(error==Flag::SUCCESS, "Setting TraceClassUnLoading flag failed with error %s", Flag::flag_error_str(error)); + if (value) { + LogConfiguration::parse_log_arguments("stdout", "classunload=info", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "classunload=off", NULL, NULL, NULL); + } } GrowableArray* LoadedClassesEnumerator::_loaded_classes = NULL; diff --git a/hotspot/src/share/vm/services/classLoadingService.hpp b/hotspot/src/share/vm/services/classLoadingService.hpp index 9d85c92d5f7..16ff40fd4be 100644 --- a/hotspot/src/share/vm/services/classLoadingService.hpp +++ b/hotspot/src/share/vm/services/classLoadingService.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ #ifndef SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP #define SHARE_VM_SERVICES_CLASSLOADINGSERVICE_HPP +#include "logging/log.hpp" #include "runtime/handles.hpp" #include "runtime/perfData.hpp" #include "utilities/growableArray.hpp" @@ -54,7 +55,7 @@ private: public: static void init(); - static bool get_verbose() { return TraceClassLoading; } + static bool get_verbose() { return log_is_enabled(Info, classload); } static bool set_verbose(bool verbose); static void reset_trace_class_unloading() NOT_MANAGEMENT_RETURN; diff --git a/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp b/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp index 243183c077e..2d274673b51 100644 --- a/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp +++ b/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1143,8 +1143,8 @@ Value *SharkTopLevelBlock::get_virtual_callee(SharkValue* receiver, builder()->CreateArrayAddress( klass, SharkType::Method_type(), - vtableEntry::size() * wordSize, - in_ByteSize(InstanceKlass::vtable_start_offset() * wordSize), + vtableEntry::size_in_bytes(), + Klass::vtable_start_offset(), LLVMValue::intptr_constant(vtable_index)), "callee"); } @@ -1166,12 +1166,12 @@ Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, Value *vtable_start = builder()->CreateAdd( builder()->CreatePtrToInt(object_klass, SharkType::intptr_type()), LLVMValue::intptr_constant( - InstanceKlass::vtable_start_offset() * HeapWordSize), + in_bytes(Klass::vtable_start_offset())), "vtable_start"); Value *vtable_length = builder()->CreateValueOfStructEntry( object_klass, - in_ByteSize(InstanceKlass::vtable_length_offset() * HeapWordSize), + Klass::vtable_length_offset(), SharkType::jint_type(), "vtable_length"); vtable_length = @@ -1182,7 +1182,7 @@ Value* SharkTopLevelBlock::get_interface_callee(SharkValue *receiver, vtable_start, builder()->CreateShl( vtable_length, - LLVMValue::intptr_constant(exact_log2(vtableEntry::size() * wordSize))), + LLVMValue::intptr_constant(exact_log2(vtableEntry::size_in_bytes()))), needs_aligning ? "" : "itable_start"); if (needs_aligning) { itable_start = builder()->CreateAnd( diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index fdaaaa78b9b..55774fedceb 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -109,6 +109,13 @@ Declares a structure type that can be used in other events. + + + + + + diff --git a/hotspot/src/share/vm/trace/traceEventClasses.xsl b/hotspot/src/share/vm/trace/traceEventClasses.xsl index f7c90ad758f..41d3a446a9e 100644 --- a/hotspot/src/share/vm/trace/traceEventClasses.xsl +++ b/hotspot/src/share/vm/trace/traceEventClasses.xsl @@ -56,7 +56,8 @@ public: void set_endtime(const Ticks& time) {} bool should_commit() const { return false; } static bool is_enabled() { return false; } - void commit() const {} + void commit() {} + void cancel() {} }; diff --git a/hotspot/src/share/vm/trace/tracetypes.xml b/hotspot/src/share/vm/trace/tracetypes.xml index c29831f064c..83b8c7a4acc 100644 --- a/hotspot/src/share/vm/trace/tracetypes.xml +++ b/hotspot/src/share/vm/trace/tracetypes.xml @@ -170,12 +170,16 @@ Now we can use the content + data type in declaring event fields. type="U1" jvm_type="FLAGVALUEORIGIN"> - + + + + @@ -381,5 +385,8 @@ Now we can use the content + data type in declaring event fields. + + diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index fa9a27dacc4..8d6a9398764 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -461,7 +461,7 @@ extern "C" void blob(CodeBlob* cb) { extern "C" void dump_vtable(address p) { Command c("dump_vtable"); Klass* k = (Klass*)p; - InstanceKlass::cast(k)->vtable()->print(); + k->vtable()->print(); } diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.cpp b/hotspot/src/share/vm/utilities/globalDefinitions.cpp index 1491be7091e..24dedf470f2 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.cpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,8 @@ void basic_types_init() { assert( 1 == sizeof( u1), "wrong size for basic type"); assert( 2 == sizeof( u2), "wrong size for basic type"); assert( 4 == sizeof( u4), "wrong size for basic type"); + assert(wordSize == BytesPerWord, "should be the same since they're used interchangeably"); + assert(wordSize == HeapWordSize, "should be the same since they're also used interchangeably"); int num_type_chars = 0; for (int i = 0; i < 99; i++) { diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index d5c2f20cfad..6cdb8c8ab57 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -157,7 +157,6 @@ class HeapWord { // Analogous opaque struct for metadata allocated from // metaspaces. class MetaWord { - friend class VMStructs; private: char* i; }; @@ -486,7 +485,7 @@ inline intptr_t align_size_down(intptr_t size, intptr_t alignment) { #define is_size_aligned_(size, alignment) ((size) == (align_size_up_(size, alignment))) -inline void* align_ptr_up(void* ptr, size_t alignment) { +inline void* align_ptr_up(const void* ptr, size_t alignment) { return (void*)align_size_up((intptr_t)ptr, (intptr_t)alignment); } @@ -494,10 +493,15 @@ inline void* align_ptr_down(void* ptr, size_t alignment) { return (void*)align_size_down((intptr_t)ptr, (intptr_t)alignment); } -// Align objects by rounding up their size, in HeapWord units. +// Align metaspace objects by rounding up to natural word boundary -#define align_object_size_(size) align_size_up_(size, MinObjAlignment) +inline intptr_t align_metadata_size(intptr_t size) { + return align_size_up(size, 1); +} +// Align objects in the Java Heap by rounding up their size, in HeapWord units. +// Since the size is given in words this is somewhat of a nop, but +// distinguishes it from align_object_size. inline intptr_t align_object_size(intptr_t size) { return align_size_up(size, MinObjAlignment); } @@ -512,10 +516,6 @@ inline intptr_t align_object_offset(intptr_t offset) { return align_size_up(offset, HeapWordsPerLong); } -inline void* align_pointer_up(const void* addr, size_t size) { - return (void*) align_size_up_((uintptr_t)addr, size); -} - // Align down with a lower bound. If the aligning results in 0, return 'alignment'. inline size_t align_size_down_bounded(size_t size, size_t alignment) { diff --git a/hotspot/src/share/vm/utilities/growableArray.hpp b/hotspot/src/share/vm/utilities/growableArray.hpp index e4a414a0cdc..933cf339661 100644 --- a/hotspot/src/share/vm/utilities/growableArray.hpp +++ b/hotspot/src/share/vm/utilities/growableArray.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -169,7 +169,9 @@ template class GrowableArray : public GenericGrowableArray { : GenericGrowableArray(initial_size, 0, C_heap, F) { _data = (E*)raw_allocate(sizeof(E)); // Needed for Visual Studio 2012 and older +#ifdef _MSC_VER #pragma warning(suppress: 4345) +#endif for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E(); } @@ -422,7 +424,9 @@ template void GrowableArray::grow(int j) { int i = 0; for ( ; i < _len; i++) ::new ((void*)&newData[i]) E(_data[i]); // Needed for Visual Studio 2012 and older +#ifdef _MSC_VER #pragma warning(suppress: 4345) +#endif for ( ; i < _max; i++) ::new ((void*)&newData[i]) E(); for (i = 0; i < old_max; i++) _data[i].~E(); if (on_C_heap() && _data != NULL) { diff --git a/hotspot/src/share/vm/utilities/internalVMTests.cpp b/hotspot/src/share/vm/utilities/internalVMTests.cpp index 9b7395e3514..7b20c0b6e09 100644 --- a/hotspot/src/share/vm/utilities/internalVMTests.cpp +++ b/hotspot/src/share/vm/utilities/internalVMTests.cpp @@ -30,103 +30,62 @@ #include "utilities/macros.hpp" #include "utilities/ostream.hpp" -#define run_unit_test(unit_test_function_call) \ - tty->print_cr("Running test: " #unit_test_function_call); \ - unit_test_function_call +#define run_unit_test(unit_test_function_call) \ + void unit_test_function_call(); \ + run_test(#unit_test_function_call, unit_test_function_call); -// Forward declaration -void TestDependencyContext_test(); -void test_semaphore(); -void TestOS_test(); -void TestReservedSpace_test(); -void TestReserveMemorySpecial_test(); -void TestVirtualSpace_test(); -void TestMetaspaceAux_test(); -void TestMetachunk_test(); -void TestVirtualSpaceNode_test(); -void TestNewSize_test(); -void TestOldSize_test(); -void TestKlass_test(); -void TestBitMap_test(); -void TestAsUtf8(); -void Test_linked_list(); -void TestResourcehash_test(); -void TestChunkedList_test(); -void Test_log_length(); -void Test_TempNewSymbol(); -void GlobalDefinitions_test(); -void GCTimer_test(); -void arrayOopDesc_test(); -void CollectedHeap_test(); -void QuickSort_test(); -void GuardedMemory_test(); -void AltHashing_test(); -void ObjectMonitor_test(); -void JSON_test(); -void DirectivesParser_test(); - -#if INCLUDE_VM_STRUCTS -void VMStructs_test(); -#endif - -#if INCLUDE_ALL_GCS -void TestOldFreeSpaceCalculation_test(); -void TestG1BiasedArray_test(); -void TestBufferingOopClosure_test(); -void TestCodeCacheRemSet_test(); -void FreeRegionList_test(); -void IHOP_test(); -void test_memset_with_concurrent_readers(); -void TestPredictions_test(); -void WorkerDataArray_test(); -#endif +void InternalVMTests::run_test(const char* name, void (*test)()) { + tty->print_cr("Running test: %s", name); + test(); +} void InternalVMTests::run() { tty->print_cr("Running internal VM tests"); - run_unit_test(TestDependencyContext_test()); - run_unit_test(test_semaphore()); - run_unit_test(TestOS_test()); - run_unit_test(TestReservedSpace_test()); - run_unit_test(TestReserveMemorySpecial_test()); - run_unit_test(TestVirtualSpace_test()); - run_unit_test(TestMetaspaceAux_test()); - run_unit_test(TestMetachunk_test()); - run_unit_test(TestVirtualSpaceNode_test()); - run_unit_test(GlobalDefinitions_test()); - run_unit_test(GCTimer_test()); - run_unit_test(arrayOopDesc_test()); - run_unit_test(CollectedHeap_test()); - run_unit_test(QuickSort_test()); - run_unit_test(GuardedMemory_test()); - run_unit_test(AltHashing_test()); - run_unit_test(TestNewSize_test()); - run_unit_test(TestOldSize_test()); - run_unit_test(TestKlass_test()); - run_unit_test(TestBitMap_test()); - run_unit_test(TestAsUtf8()); - run_unit_test(TestResourcehash_test()); - run_unit_test(ObjectMonitor_test()); - run_unit_test(Test_linked_list()); - run_unit_test(TestChunkedList_test()); - run_unit_test(JSON_test()); - run_unit_test(Test_log_length()); - run_unit_test(DirectivesParser_test()); - run_unit_test(Test_TempNewSymbol()); + run_unit_test(TestDependencyContext_test); + run_unit_test(test_semaphore); + run_unit_test(TestOS_test); + run_unit_test(TestReservedSpace_test); + run_unit_test(TestReserveMemorySpecial_test); + run_unit_test(TestVirtualSpace_test); + run_unit_test(TestMetaspaceAux_test); + run_unit_test(TestMetachunk_test); + run_unit_test(TestVirtualSpaceNode_test); + run_unit_test(GlobalDefinitions_test); + run_unit_test(GCTimer_test); + run_unit_test(arrayOopDesc_test); + run_unit_test(CollectedHeap_test); + run_unit_test(QuickSort_test); + run_unit_test(GuardedMemory_test); + run_unit_test(AltHashing_test); + run_unit_test(TestNewSize_test); + run_unit_test(TestOldSize_test); + run_unit_test(TestKlass_test); + run_unit_test(TestBitMap_test); + run_unit_test(TestAsUtf8); + run_unit_test(TestResourcehash_test); + run_unit_test(ObjectMonitor_test); + run_unit_test(Test_linked_list); + run_unit_test(TestChunkedList_test); + run_unit_test(JSON_test); + run_unit_test(Test_log_length); + run_unit_test(Test_configure_stdout); + run_unit_test(DirectivesParser_test); + run_unit_test(Test_TempNewSymbol); #if INCLUDE_VM_STRUCTS - run_unit_test(VMStructs_test()); + run_unit_test(VMStructs_test); #endif #if INCLUDE_ALL_GCS - run_unit_test(TestOldFreeSpaceCalculation_test()); - run_unit_test(TestG1BiasedArray_test()); - run_unit_test(TestBufferingOopClosure_test()); - run_unit_test(TestCodeCacheRemSet_test()); + run_unit_test(TestOldFreeSpaceCalculation_test); + run_unit_test(TestG1BiasedArray_test); + run_unit_test(TestBufferingOopClosure_test); + run_unit_test(TestCodeCacheRemSet_test); if (UseG1GC) { - run_unit_test(FreeRegionList_test()); - run_unit_test(IHOP_test()); + run_unit_test(FreeRegionList_test); + run_unit_test(IHOP_test); } - run_unit_test(test_memset_with_concurrent_readers()); - run_unit_test(TestPredictions_test()); - run_unit_test(WorkerDataArray_test()); + run_unit_test(test_memset_with_concurrent_readers); + run_unit_test(TestPredictions_test); + run_unit_test(WorkerDataArray_test); #endif tty->print_cr("All internal VM tests passed"); } diff --git a/hotspot/src/share/vm/utilities/internalVMTests.hpp b/hotspot/src/share/vm/utilities/internalVMTests.hpp index 93bc3309abe..f12a1685802 100644 --- a/hotspot/src/share/vm/utilities/internalVMTests.hpp +++ b/hotspot/src/share/vm/utilities/internalVMTests.hpp @@ -30,6 +30,7 @@ #include "memory/allocation.hpp" class InternalVMTests : public AllStatic { + static void run_test(const char* name, void (*test)()); public: static void run(); }; diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index d3583a006ff..3bafaec300a 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +44,8 @@ outputStream::outputStream(int width) { _newlines = 0; _precount = 0; _indentation = 0; + _scratch = NULL; + _scratch_len = 0; } outputStream::outputStream(int width, bool has_time_stamps) { @@ -52,6 +54,8 @@ outputStream::outputStream(int width, bool has_time_stamps) { _newlines = 0; _precount = 0; _indentation = 0; + _scratch = NULL; + _scratch_len = 0; if (has_time_stamps) _stamp.update(); } @@ -119,38 +123,47 @@ const char* outputStream::do_vsnprintf(char* buffer, size_t buflen, return result; } -void outputStream::print(const char* format, ...) { +void outputStream::do_vsnprintf_and_write_with_automatic_buffer(const char* format, va_list ap, bool add_cr) { char buffer[O_BUFLEN]; + size_t len; + const char* str = do_vsnprintf(buffer, sizeof(buffer), format, ap, add_cr, len); + write(str, len); +} + +void outputStream::do_vsnprintf_and_write_with_scratch_buffer(const char* format, va_list ap, bool add_cr) { + size_t len; + const char* str = do_vsnprintf(_scratch, _scratch_len, format, ap, add_cr, len); + write(str, len); +} + +void outputStream::do_vsnprintf_and_write(const char* format, va_list ap, bool add_cr) { + if (_scratch) { + do_vsnprintf_and_write_with_scratch_buffer(format, ap, add_cr); + } else { + do_vsnprintf_and_write_with_automatic_buffer(format, ap, add_cr); + } +} + +void outputStream::print(const char* format, ...) { va_list ap; va_start(ap, format); - size_t len; - const char* str = do_vsnprintf(buffer, O_BUFLEN, format, ap, false, len); - write(str, len); + do_vsnprintf_and_write(format, ap, false); va_end(ap); } void outputStream::print_cr(const char* format, ...) { - char buffer[O_BUFLEN]; va_list ap; va_start(ap, format); - size_t len; - const char* str = do_vsnprintf(buffer, O_BUFLEN, format, ap, true, len); - write(str, len); + do_vsnprintf_and_write(format, ap, true); va_end(ap); } void outputStream::vprint(const char *format, va_list argptr) { - char buffer[O_BUFLEN]; - size_t len; - const char* str = do_vsnprintf(buffer, O_BUFLEN, format, argptr, false, len); - write(str, len); + do_vsnprintf_and_write(format, argptr, false); } void outputStream::vprint_cr(const char* format, va_list argptr) { - char buffer[O_BUFLEN]; - size_t len; - const char* str = do_vsnprintf(buffer, O_BUFLEN, format, argptr, true, len); - write(str, len); + do_vsnprintf_and_write(format, argptr, true); } void outputStream::fill_to(int col) { @@ -367,7 +380,7 @@ extern Mutex* tty_lock; char* get_datetime_string(char *buf, size_t len) { os::local_time_string(buf, len); int i = (int)strlen(buf); - while (i-- >= 0) { + while (--i >= 0) { if (buf[i] == ' ') buf[i] = '_'; else if (buf[i] == ':') buf[i] = '-'; } @@ -958,53 +971,6 @@ void ostream_abort() { } } -staticBufferStream::staticBufferStream(char* buffer, size_t buflen, - outputStream *outer_stream) { - _buffer = buffer; - _buflen = buflen; - _outer_stream = outer_stream; - // compile task prints time stamp relative to VM start - _stamp.update_to(1); -} - -void staticBufferStream::write(const char* c, size_t len) { - _outer_stream->print_raw(c, (int)len); -} - -void staticBufferStream::flush() { - _outer_stream->flush(); -} - -void staticBufferStream::print(const char* format, ...) { - va_list ap; - va_start(ap, format); - size_t len; - const char* str = do_vsnprintf(_buffer, _buflen, format, ap, false, len); - write(str, len); - va_end(ap); -} - -void staticBufferStream::print_cr(const char* format, ...) { - va_list ap; - va_start(ap, format); - size_t len; - const char* str = do_vsnprintf(_buffer, _buflen, format, ap, true, len); - write(str, len); - va_end(ap); -} - -void staticBufferStream::vprint(const char *format, va_list argptr) { - size_t len; - const char* str = do_vsnprintf(_buffer, _buflen, format, argptr, false, len); - write(str, len); -} - -void staticBufferStream::vprint_cr(const char* format, va_list argptr) { - size_t len; - const char* str = do_vsnprintf(_buffer, _buflen, format, argptr, true, len); - write(str, len); -} - bufferedStream::bufferedStream(size_t initial_size, size_t bufmax) : outputStream() { buffer_length = initial_size; buffer = NEW_C_HEAP_ARRAY(char, buffer_length, mtInternal); @@ -1133,7 +1099,7 @@ bool networkStream::connect(const char *ip, short port) { void logStream::write(const char* s, size_t len) { if (len > 0 && s[len - 1] == '\n') { _current_line.write(s, len - 1); - _log_func(_current_line.as_string()); + _log_func("%s", _current_line.as_string()); _current_line.reset(); } else { _current_line.write(s, len); diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp index 627ba90fb92..9c2b6979879 100644 --- a/hotspot/src/share/vm/utilities/ostream.hpp +++ b/hotspot/src/share/vm/utilities/ostream.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "memory/allocation.hpp" #include "runtime/timer.hpp" +#include "utilities/globalDefinitions.hpp" class GCId; DEBUG_ONLY(class ResourceMark;) @@ -49,6 +50,8 @@ class outputStream : public ResourceObj { int _newlines; // number of '\n' output so far julong _precount; // number of chars output, less _position TimeStamp _stamp; // for time stamps + char* _scratch; // internal scratch buffer for printf + size_t _scratch_len; // size of internal scratch buffer void update_position(const char* s, size_t len); static const char* do_vsnprintf(char* buffer, size_t buflen, @@ -56,6 +59,13 @@ class outputStream : public ResourceObj { bool add_cr, size_t& result_len) ATTRIBUTE_PRINTF(3, 0); + // calls do_vsnprintf and writes output to stream; uses an on-stack buffer. + void do_vsnprintf_and_write_with_automatic_buffer(const char* format, va_list ap, bool add_cr) ATTRIBUTE_PRINTF(2, 0); + // calls do_vsnprintf and writes output to stream; uses the user-provided buffer; + void do_vsnprintf_and_write_with_scratch_buffer(const char* format, va_list ap, bool add_cr) ATTRIBUTE_PRINTF(2, 0); + // calls do_vsnprintf, then writes output to stream. + void do_vsnprintf_and_write(const char* format, va_list ap, bool add_cr) ATTRIBUTE_PRINTF(2, 0); + public: // creation outputStream(int width = 80); @@ -119,6 +129,10 @@ class outputStream : public ResourceObj { virtual void rotate_log(bool force, outputStream* out = NULL) {} // GC log rotation virtual ~outputStream() {} // close properly on deletion + // Caller may specify their own scratch buffer to use for printing; otherwise, + // an automatic buffer on the stack (with O_BUFLEN len) is used. + void set_scratch_buffer(char* p, size_t len) { _scratch = p; _scratch_len = len; } + void dec_cr() { dec(); cr(); } void inc_cr() { inc(); cr(); } }; @@ -236,7 +250,7 @@ class fdStream : public outputStream { class logStream : public outputStream { private: stringStream _current_line; - void (*_log_func)(const char* fmt, ...); + void (*_log_func)(const char* fmt, ...) ATTRIBUTE_PRINTF(1, 2); public: void write(const char* s, size_t len); logStream(void (*log_func)(const char* fmt, ...)) : _log_func(log_func) {} @@ -250,26 +264,6 @@ void ostream_init_log(); void ostream_exit(); void ostream_abort(); -// staticBufferStream uses a user-supplied buffer for all formatting. -// Used for safe formatting during fatal error handling. Not MT safe. -// Do not share the stream between multiple threads. -class staticBufferStream : public outputStream { - private: - char* _buffer; - size_t _buflen; - outputStream* _outer_stream; - public: - staticBufferStream(char* buffer, size_t buflen, - outputStream *outer_stream); - ~staticBufferStream() {}; - virtual void write(const char* c, size_t len); - void flush(); - void print(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); - void print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3); - void vprint(const char *format, va_list argptr) ATTRIBUTE_PRINTF(2, 0); - void vprint_cr(const char* format, va_list argptr) ATTRIBUTE_PRINTF(2, 0); -}; - // In the non-fixed buffer case an underlying buffer will be created and // managed in C heap. Not MT-safe. class bufferedStream : public outputStream { diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 4ad914ef4e5..ee6ad0e5ddb 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -987,10 +987,12 @@ void VMError::print_vm_info(outputStream* st) { volatile intptr_t VMError::first_error_tid = -1; // An error could happen before tty is initialized or after it has been -// destroyed. Here we use a very simple unbuffered fdStream for printing. -// Only out.print_raw() and out.print_raw_cr() should be used, as other -// printing methods need to allocate large buffer on stack. To format a -// string, use jio_snprintf() with a static buffer or use staticBufferStream. +// destroyed. +// Please note: to prevent large stack allocations, the log- and +// output-stream use a global scratch buffer for format printing. +// (see VmError::report_and_die(). Access to those streams is synchronized +// in VmError::report_and_die() - there is only one reporting thread at +// any given time. fdStream VMError::out(defaultStream::output_fd()); fdStream VMError::log; // error log used by VMError::report_and_die() @@ -1100,6 +1102,8 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt { // Don't allocate large buffer on stack static char buffer[O_BUFLEN]; + out.set_scratch_buffer(buffer, sizeof(buffer)); + log.set_scratch_buffer(buffer, sizeof(buffer)); // How many errors occurred in error handler when reporting first_error. static int recursive_error_count; @@ -1186,8 +1190,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt // print to screen if (!out_done) { - staticBufferStream sbs(buffer, sizeof(buffer), &out); - report(&sbs, false); + report(&out, false); out_done = true; @@ -1215,8 +1218,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt } } - staticBufferStream sbs(buffer, O_BUFLEN, &log); - report(&sbs, true); + report(&log, true); _current_step = 0; _current_step_info = ""; diff --git a/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java b/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java index d65bf424228..e650aa558c1 100644 --- a/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java +++ b/hotspot/test/compiler/jsr292/CallSiteDepContextTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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 * @bug 8057967 - * @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+TraceClassUnloading + * @run main/bootclasspath -Xbatch -XX:+IgnoreUnrecognizedVMOptions -Xlog:classunload * -XX:+PrintCompilation -XX:+TraceDependencies -XX:+TraceReferenceGC * -verbose:gc java.lang.invoke.CallSiteDepContextTest */ diff --git a/hotspot/test/gc/arguments/TestSelectDefaultGC.java b/hotspot/test/gc/arguments/TestSelectDefaultGC.java index c3c043ce7e3..be8ffbcb304 100644 --- a/hotspot/test/gc/arguments/TestSelectDefaultGC.java +++ b/hotspot/test/gc/arguments/TestSelectDefaultGC.java @@ -29,6 +29,7 @@ * @library /testlibrary * @modules java.base/sun.misc * java.management + * @ignore 8148239 * @run driver TestSelectDefaultGC */ diff --git a/hotspot/test/gc/cms/TestBubbleUpRef.java b/hotspot/test/gc/cms/TestBubbleUpRef.java new file mode 100644 index 00000000000..58fdd710ebf --- /dev/null +++ b/hotspot/test/gc/cms/TestBubbleUpRef.java @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * 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.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import java.util.LinkedList; +import java.util.ListIterator; + +/* + * @test + * @requires vm.gc=="ConcMarkSweep" | vm.gc == "null" + * @key cte_test + * @bug 4950157 + * @summary Stress the behavior of ergonomics when the heap is nearly full and + * stays nearly full. + * @run main/othervm + * -XX:+UseConcMarkSweepGC -XX:-CMSYield -XX:-CMSPrecleanRefLists1 + * -XX:CMSInitiatingOccupancyFraction=0 -Xmx8m TestBubbleUpRef 16000 50 10000 + */ + +/** + * Test program to stress the behavior of ergonomics when the + * heap is nearly full and stays nearly full. + * This is a test to catch references that have been discovered + * during concurrent marking and whose referents have been + * cleared by the mutator. + * Allocate objects with weak references until the heap is full + * Free the objects. + * Do work so that concurrent marking has a chance to work + * Clear the referents out of the weak references + * System.gc() in the hopes that it will acquire the collection + * Free the weak references + * Do it again. + * + * Use the following VM options + * -Xmx8m -XX:-CMSYield [-XX:+UseConcMarkSweepGC] -XX:-CMSPrecleanRefLists1 + * -XX:CMSInitiatingOccupancyFraction=0 + * + * Use parameter: + * args[0] - array size (16000) + * args[1] - iterations (50) + * args[2] - work (10000) + */ +class MyList extends LinkedList { + + int[] a; + + MyList(int size) { + a = new int[size]; + } +} + +class MyRefList extends LinkedList { + + WeakReference ref; + + MyRefList(Object o, ReferenceQueue rq) { + ref = new WeakReference(o, rq); + } + + void clearReferent() { + ref.clear(); + } +} + +public class TestBubbleUpRef { + + MyList list; + MyRefList refList; + ReferenceQueue rq; + int refListLen; + int arraySize; + int iterations; + int workUnits; + + TestBubbleUpRef(int as, int cnt, int wk) { + arraySize = as; + iterations = cnt; + workUnits = wk; + list = new MyList(arraySize); + refList = new MyRefList(list, rq); + } + + public void fill() { + System.out.println("fill() " + iterations + " times"); + int count = 0; + while (true) { + try { + // Allocations + MyList next = new MyList(arraySize); + list.add(next); + MyRefList nextRef = new MyRefList(next, rq); + refList.add(nextRef); + } catch (OutOfMemoryError e) { + // When the heap is full + try { + if (count++ > iterations) { + return; + } + System.out.println("Freeing list"); + while (!list.isEmpty()) { + list.removeFirst(); + } + System.out.println("Doing work"); + int j = 0; + for (int i = 1; i < workUnits; i++) { + j = j + i; + } + System.out.println("Clearing refs"); + ListIterator listIt = refList.listIterator(); + while (listIt.hasNext()) { + MyRefList next = (MyRefList) listIt.next(); + next.clearReferent(); + } + System.gc(); + System.out.println("Freeing refs"); + while (!refList.isEmpty()) { + refList.removeFirst(); + } + } catch (OutOfMemoryError e2) { + System.err.println("Out of Memory - 2 "); + continue; + } + } catch (Exception e) { + System.err.println("Unexpected exception: " + e); + return; + } + } + } + + /** + * Test entry point. + * args[0] - array size (is the size of the int array in a list item) + * args[1] - iterations (is the number of out-of-memory exceptions before exit) + * args[2] - work (is the work done between allocations) + * @param args + */ + public static void main(String[] args) { + // Get the input parameters. + if (args.length != 3) { + throw new IllegalArgumentException("Wrong number of input argumets"); + } + + int as = Integer.parseInt(args[0]); + int cnt = Integer.parseInt(args[1]); + int work = Integer.parseInt(args[2]); + + System.out.println(" " + as + "\n" + + " " + cnt + "\n" + + " " + work + "\n"); + + // Initialization + TestBubbleUpRef b = new TestBubbleUpRef(as, cnt, work); + + // Run the test + try { + b.fill(); + } catch (OutOfMemoryError e) { + b = null; // Free memory before trying to print anything + System.err.println("Out of Memory - exiting "); + } catch (Exception e) { + System.err.println("Exiting "); + } + } +} + diff --git a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java index 6ce8613468e..a4a17be430c 100644 --- a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java +++ b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * 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,34 +38,6 @@ import java.util.LinkedList; public class TestG1TraceEagerReclaimHumongousObjects { public static void main(String[] args) throws Exception { - testGCLogs(); - testHumongousObjectGCLogs(); - } - - private static void testGCLogs() throws Exception { - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-Xms128M", - "-Xmx128M", - "-Xmn16M", - "-XX:G1HeapRegionSize=1M", - "-Xlog:gc+phases=trace", - "-XX:+UnlockExperimentalVMOptions", - GCTest.class.getName()); - - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - - // As G1EagerReclaimHumongousObjects is set(default), below logs should be displayed. - // And GCTest doesn't have humongous objects, so values should be zero. - output.shouldContain("Humongous Reclaim"); - output.shouldContain("Humongous Total: 0"); - output.shouldContain("Humongous Candidate: 0"); - output.shouldContain("Humongous Reclaimed: 0"); - - output.shouldHaveExitValue(0); - } - - private static void testHumongousObjectGCLogs() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-Xms128M", "-Xmx128M", @@ -90,19 +62,6 @@ public class TestG1TraceEagerReclaimHumongousObjects { output.shouldHaveExitValue(0); } - static class GCTest { - private static byte[] garbage; - - public static void main(String [] args) { - System.out.println("Creating garbage"); - // create 128MB of garbage. This should result in at least one GC - for (int i = 0; i < 1024; i++) { - garbage = new byte[128 * 1024]; - } - System.out.println("Done"); - } - } - static class GCWithHumongousObjectTest { public static final int M = 1024*1024; diff --git a/hotspot/test/gc/g1/TestRemsetLoggingTools.java b/hotspot/test/gc/g1/TestRemsetLoggingTools.java index 905d572ba15..e58eb9e8b14 100644 --- a/hotspot/test/gc/g1/TestRemsetLoggingTools.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingTools.java @@ -96,7 +96,7 @@ public class TestRemsetLoggingTools { public static void expectPerRegionRSetSummaries(String result, int expectedCumulative, int expectedPeriodic) throws Exception { expectRSetSummaries(result, expectedCumulative, expectedPeriodic); int actualYoung = result.split("Young regions").length - 1; - int actualHumonguous = result.split("Humonguous regions").length - 1; + int actualHumongous = result.split("Humongous regions").length - 1; int actualFree = result.split("Free regions").length - 1; int actualOther = result.split("Old regions").length - 1; @@ -104,7 +104,7 @@ public class TestRemsetLoggingTools { int expectedPerRegionTypeInfo = (expectedCumulative + expectedPeriodic) * 4; checkCounts(expectedPerRegionTypeInfo, actualYoung, "Young"); - checkCounts(expectedPerRegionTypeInfo, actualHumonguous, "Humonguous"); + checkCounts(expectedPerRegionTypeInfo, actualHumongous, "Humongous"); checkCounts(expectedPerRegionTypeInfo, actualFree, "Free"); checkCounts(expectedPerRegionTypeInfo, actualOther, "Old"); } diff --git a/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java b/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java new file mode 100644 index 00000000000..d843d35dff4 --- /dev/null +++ b/hotspot/test/gc/g1/humongousObjects/TestHeapCounters.java @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package gc.g1.humongousObjects; + +import gc.testlibrary.Helpers; +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @test TestHeapCounters + * @summary Checks that heap counters work as expected after humongous allocations/deallocations + * @requires vm.gc=="G1" | vm.gc=="null" + * @library /testlibrary /test/lib / + * @modules java.management + * @build sun.hotspot.WhiteBox + * gc.testlibrary.Helpers + * gc.g1.humongousObjects.TestHeapCounters + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xmx128m -Xms128m + * -XX:G1HeapRegionSize=1M -XX:InitiatingHeapOccupancyPercent=100 -XX:-G1UseAdaptiveIHOP + * -Xlog:gc -Xlog:gc:file=TestHeapCountersRuntime.gc.log + * gc.g1.humongousObjects.TestHeapCounters RUNTIME_COUNTER + * + * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xmx128m -Xms128m + * -XX:G1HeapRegionSize=1M -XX:InitiatingHeapOccupancyPercent=100 -XX:-G1UseAdaptiveIHOP + * -Xlog:gc -Xlog:gc:file=TestHeapCountersMXBean.gc.log + * gc.g1.humongousObjects.TestHeapCounters MX_BEAN_COUNTER + */ +public class TestHeapCounters { + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + private static final int G1_REGION_SIZE = WHITE_BOX.g1RegionSize(); + private static final int HALF_G1_REGION_SIZE = G1_REGION_SIZE / 2; + + // Since during deallocation GC could free (very unlikely) some non-humongous data this value relaxes amount of + // memory we expect to be freed. + private static final double ALLOCATION_SIZE_TOLERANCE_FACTOR = 0.85D; + + private enum MemoryCounter { + MX_BEAN_COUNTER { + @Override + public long getUsedMemory() { + return ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed(); + } + }, + RUNTIME_COUNTER { + @Override + public long getUsedMemory() { + return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + } + }; + + public abstract long getUsedMemory(); + } + + private static class Allocation { + private byte[] allocation; + public final long expectedSize; + + public Allocation(int allocationSize, long allocationExpectedSize) { + allocation = new byte[allocationSize]; + expectedSize = allocationExpectedSize; + + System.out.println(String.format("Object size is %d; Object is %shumongous", + WHITE_BOX.getObjectSize(allocation), + (WHITE_BOX.g1IsHumongous(allocation) ? "" : "non-"))); + + selfTest(); + } + + private void selfTest() { + boolean isHumongous = WHITE_BOX.getObjectSize(allocation) > HALF_G1_REGION_SIZE; + boolean shouldBeHumongous = WHITE_BOX.g1IsHumongous(allocation); + + // Sanity check + Asserts.assertEquals(isHumongous, shouldBeHumongous, + String.format("Test Bug: Object of size %d is expected to be %shumongous but it is not", + WHITE_BOX.getObjectSize(allocation), (shouldBeHumongous ? "" : "non-"))); + } + + public void forgetAllocation() { + allocation = null; + } + } + + public static void main(String[] args) { + + if (args.length != 1) { + throw new Error("Expected memory counter name wasn't provided as command line argument"); + } + MemoryCounter memoryCounter = MemoryCounter.valueOf(args[0].toUpperCase()); + + int byteArrayMemoryOverhead = Helpers.detectByteArrayAllocationOverhead(); + + // Largest non-humongous byte[] + int maxByteArrayNonHumongousSize = HALF_G1_REGION_SIZE - byteArrayMemoryOverhead; + + // Maximum byte[] that takes one region + int maxByteArrayOneRegionSize = G1_REGION_SIZE - byteArrayMemoryOverhead; + + List allocationSizes = Arrays.asList( + (int) maxByteArrayNonHumongousSize + 1, + (int) (0.8f * maxByteArrayOneRegionSize), + (int) (maxByteArrayOneRegionSize), + (int) (1.2f * maxByteArrayOneRegionSize), + (int) (1.5f * maxByteArrayOneRegionSize), + (int) (1.7f * maxByteArrayOneRegionSize), + (int) (2.0f * maxByteArrayOneRegionSize), + (int) (2.5f * maxByteArrayOneRegionSize) + ); + + List allocations = new ArrayList<>(); + List gcBeans = + ManagementFactory.getGarbageCollectorMXBeans(); + + long gcCountBefore = gcBeans.stream().mapToLong(GarbageCollectorMXBean::getCollectionCount).sum(); + + + System.out.println("Starting allocations - no GC should happen until we finish them"); + + for (int allocationSize : allocationSizes) { + + long usedMemoryBefore = memoryCounter.getUsedMemory(); + long expectedAllocationSize = (long) Math.ceil((double) allocationSize / G1_REGION_SIZE) * G1_REGION_SIZE; + allocations.add(new Allocation(allocationSize, expectedAllocationSize)); + long usedMemoryAfter = memoryCounter.getUsedMemory(); + + System.out.format("Expected allocation size: %d\nUsed memory before allocation: %d\n" + + "Used memory after allocation: %d\n", + expectedAllocationSize, usedMemoryBefore, usedMemoryAfter); + + long gcCountNow = gcBeans.stream().mapToLong(GarbageCollectorMXBean::getCollectionCount).sum(); + + if (gcCountNow == gcCountBefore) { + // We should allocate at least allocation.expectedSize + Asserts.assertGreaterThanOrEqual(usedMemoryAfter - usedMemoryBefore, expectedAllocationSize, + "Counter of type " + memoryCounter.getClass().getSimpleName() + + " returned wrong allocation size"); + } else { + System.out.println("GC happened during allocation so the check is skipped"); + gcCountBefore = gcCountNow; + } + } + + System.out.println("Finished allocations - no GC should have happened before this line"); + + + allocations.stream().forEach(allocation -> { + long usedMemoryBefore = memoryCounter.getUsedMemory(); + allocation.forgetAllocation(); + + WHITE_BOX.fullGC(); + + long usedMemoryAfter = memoryCounter.getUsedMemory(); + + // We should free at least allocation.expectedSize * ALLOCATION_SIZE_TOLERANCE_FACTOR + Asserts.assertGreaterThanOrEqual(usedMemoryBefore - usedMemoryAfter, + (long) (allocation.expectedSize * ALLOCATION_SIZE_TOLERANCE_FACTOR), + "Counter of type " + memoryCounter.getClass().getSimpleName() + " returned wrong allocation size"); + }); + } +} diff --git a/hotspot/test/gc/g1/plab/TestPLABPromotion.java b/hotspot/test/gc/g1/plab/TestPLABPromotion.java new file mode 100644 index 00000000000..54a56bb5092 --- /dev/null +++ b/hotspot/test/gc/g1/plab/TestPLABPromotion.java @@ -0,0 +1,351 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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 TestPLABPromotion + * @bug 8141278 + * @summary Test PLAB promotion + * @requires vm.gc=="G1" | vm.gc=="null" + * @requires vm.opt.FlightRecorder != true + * @library /testlibrary /../../test/lib / + * @modules java.management + * @build ClassFileInstaller + * sun.hotspot.WhiteBox + * gc.g1.plab.lib.MemoryConsumer + * gc.g1.plab.lib.LogParser + * gc.g1.plab.lib.AppPLABPromotion + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/timeout=240 gc.g1.plab.TestPLABPromotion + */ +package gc.g1.plab; + +import java.util.List; +import java.util.Map; +import java.util.Arrays; +import java.io.PrintStream; + +import gc.g1.plab.lib.AppPLABPromotion; +import gc.g1.plab.lib.LogParser; +import gc.g1.plab.lib.PLABUtils; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; +import jdk.test.lib.Platform; + +/** + * Test checks PLAB promotion of different size objects. + */ +public class TestPLABPromotion { + + // GC ID with survivor PLAB statistics + private final static long GC_ID_SURVIVOR_STATS = 1l; + // GC ID with old PLAB statistics + private final static long GC_ID_OLD_STATS = 2l; + + // Allowable difference for memory consumption (percentage) + private final static long MEM_DIFFERENCE_PCT = 5; + + private static final int PLAB_SIZE_SMALL = 1024; + private static final int PLAB_SIZE_MEDIUM = 4096; + private static final int PLAB_SIZE_HIGH = 65536; + private static final int OBJECT_SIZE_SMALL = 10; + private static final int OBJECT_SIZE_MEDIUM = 100; + private static final int OBJECT_SIZE_HIGH = 1000; + private static final int GC_NUM_SMALL = 1; + private static final int GC_NUM_MEDIUM = 3; + private static final int GC_NUM_HIGH = 7; + private static final int WASTE_PCT_SMALL = 10; + private static final int WASTE_PCT_MEDIUM = 20; + private static final int WASTE_PCT_HIGH = 30; + private static final int YOUNG_SIZE_LOW = 16; + private static final int YOUNG_SIZE_HIGH = 64; + private static final boolean PLAB_FIXED = true; + private static final boolean PLAB_DYNAMIC = false; + + private final static TestCase[] TEST_CASES = { + // Test cases for unreachable object, PLAB size is fixed + new TestCase(WASTE_PCT_SMALL, PLAB_SIZE_SMALL, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, YOUNG_SIZE_LOW, PLAB_FIXED, false, false), + new TestCase(WASTE_PCT_HIGH, PLAB_SIZE_MEDIUM, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_HIGH, PLAB_FIXED, false, false), + // Test cases for reachable objects, PLAB size is fixed + new TestCase(WASTE_PCT_SMALL, PLAB_SIZE_SMALL, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_HIGH, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_SMALL, PLAB_SIZE_MEDIUM, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, YOUNG_SIZE_LOW, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_SMALL, PLAB_SIZE_SMALL, OBJECT_SIZE_HIGH, GC_NUM_MEDIUM, YOUNG_SIZE_LOW, PLAB_FIXED, true, false), + new TestCase(WASTE_PCT_MEDIUM, PLAB_SIZE_HIGH, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_HIGH, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_MEDIUM, PLAB_SIZE_SMALL, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, YOUNG_SIZE_LOW, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_MEDIUM, PLAB_SIZE_MEDIUM, OBJECT_SIZE_HIGH, GC_NUM_MEDIUM, YOUNG_SIZE_LOW, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_HIGH, PLAB_SIZE_SMALL, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_HIGH, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_HIGH, PLAB_SIZE_HIGH, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, YOUNG_SIZE_LOW, PLAB_FIXED, true, true), + new TestCase(WASTE_PCT_HIGH, PLAB_SIZE_SMALL, OBJECT_SIZE_HIGH, GC_NUM_MEDIUM, YOUNG_SIZE_HIGH, PLAB_FIXED, true, false), + // Test cases for unreachable object, PLAB size is not fixed + new TestCase(WASTE_PCT_MEDIUM, PLAB_SIZE_MEDIUM, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_LOW, PLAB_DYNAMIC, false, false), + // Test cases for reachable objects, PLAB size is not fixed + new TestCase(WASTE_PCT_SMALL, PLAB_SIZE_HIGH, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_HIGH, PLAB_DYNAMIC, true, true), + new TestCase(WASTE_PCT_MEDIUM, PLAB_SIZE_MEDIUM, OBJECT_SIZE_SMALL, GC_NUM_SMALL, YOUNG_SIZE_LOW, PLAB_DYNAMIC, true, true), + new TestCase(WASTE_PCT_SMALL, PLAB_SIZE_MEDIUM, OBJECT_SIZE_HIGH, GC_NUM_HIGH, YOUNG_SIZE_HIGH, PLAB_DYNAMIC, true, false), + new TestCase(WASTE_PCT_MEDIUM, PLAB_SIZE_SMALL, OBJECT_SIZE_MEDIUM, GC_NUM_MEDIUM, YOUNG_SIZE_LOW, PLAB_DYNAMIC, true, true), + new TestCase(WASTE_PCT_HIGH, PLAB_SIZE_HIGH, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, YOUNG_SIZE_HIGH, PLAB_DYNAMIC, true, true), + new TestCase(WASTE_PCT_HIGH, PLAB_SIZE_HIGH, OBJECT_SIZE_SMALL, GC_NUM_HIGH, YOUNG_SIZE_LOW, PLAB_DYNAMIC, true, true) + }; + + public static void main(String[] args) throws Throwable { + + for (TestCase testCase : TEST_CASES) { + // What we going to check. + testCase.print(System.out); + List options = PLABUtils.prepareOptions(testCase.toOptions()); + options.add(AppPLABPromotion.class.getName()); + OutputAnalyzer out = ProcessTools.executeTestJvm(options.toArray(new String[options.size()])); + if (out.getExitValue() != 0) { + System.out.println(out.getOutput()); + throw new RuntimeException("Expect exit code 0."); + } + checkResults(out.getOutput(), testCase); + } + } + + private static void checkResults(String output, TestCase testCase) { + long plabAllocatedSurvivor; + long directAllocatedSurvivor; + long plabAllocatedOld; + long directAllocatedOld; + long memAllocated = testCase.getMemToFill(); + long wordSize = Platform.is32bit() ? 4l : 8l; + LogParser logParser = new LogParser(output); + + Map survivorStats = getPlabStats(logParser, LogParser.ReportType.SURVIVOR_STATS, GC_ID_SURVIVOR_STATS); + Map oldStats = getPlabStats(logParser, LogParser.ReportType.OLD_STATS, GC_ID_OLD_STATS); + + plabAllocatedSurvivor = wordSize * survivorStats.get("used"); + directAllocatedSurvivor = wordSize * survivorStats.get("direct_allocated"); + plabAllocatedOld = wordSize * oldStats.get("used"); + directAllocatedOld = wordSize * oldStats.get("direct_allocated"); + + System.out.printf("Survivor PLAB allocated:%17d Direct allocated: %17d Mem consumed:%17d%n", plabAllocatedSurvivor, directAllocatedSurvivor, memAllocated); + System.out.printf("Old PLAB allocated:%17d Direct allocated: %17d Mem consumed:%17d%n", plabAllocatedOld, directAllocatedOld, memAllocated); + + // Unreachable objects case + if (testCase.isDeadObjectCase()) { + // No dead objects should be promoted + if (!(checkRatio(plabAllocatedSurvivor, memAllocated) && checkRatio(directAllocatedSurvivor, memAllocated))) { + System.out.println(output); + throw new RuntimeException("Unreachable objects should not be allocated using PLAB or direct allocated to Survivor"); + } + if (!(checkRatio(plabAllocatedOld, memAllocated) && checkRatio(directAllocatedOld, memAllocated))) { + System.out.println(output); + throw new RuntimeException("Unreachable objects should not be allocated using PLAB or direct allocated to Old"); + } + } else { + // Live objects case + if (testCase.isPromotedByPLAB()) { + // All live small objects should be promoted using PLAB + if (!checkDifferenceRatio(plabAllocatedSurvivor, memAllocated)) { + System.out.println(output); + throw new RuntimeException("Expect that Survivor PLAB allocation are similar to all mem consumed"); + } + if (!checkDifferenceRatio(plabAllocatedOld, memAllocated)) { + System.out.println(output); + throw new RuntimeException("Expect that Old PLAB allocation are similar to all mem consumed"); + } + } else { + // All big objects should be directly allocated + if (!checkDifferenceRatio(directAllocatedSurvivor, memAllocated)) { + System.out.println(output); + throw new RuntimeException("Test fails. Expect that Survivor direct allocation are similar to all mem consumed"); + } + if (!checkDifferenceRatio(directAllocatedOld, memAllocated)) { + System.out.println(output); + throw new RuntimeException("Test fails. Expect that Old direct allocation are similar to all mem consumed"); + } + } + + // All promoted objects size should be similar to all consumed memory + if (!checkDifferenceRatio(plabAllocatedSurvivor + directAllocatedSurvivor, memAllocated)) { + System.out.println(output); + throw new RuntimeException("Test fails. Expect that Survivor gen total allocation are similar to all mem consumed"); + } + if (!checkDifferenceRatio(plabAllocatedOld + directAllocatedOld, memAllocated)) { + System.out.println(output); + throw new RuntimeException("Test fails. Expect that Old gen total allocation are similar to all mem consumed"); + } + } + System.out.println("Test passed!"); + } + + /** + * Returns true if checkedValue is less than MEM_DIFFERENCE_PCT percent of controlValue. + * + * @param checkedValue - checked value + * @param controlValue - referent value + * @return true if checkedValue is less than MEM_DIFFERENCE_PCT percent of controlValue + */ + private static boolean checkRatio(long checkedValue, long controlValue) { + return (Math.abs(checkedValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT; + } + + /** + * Returns true if difference of checkedValue and controlValue is less than + * MEM_DIFFERENCE_PCT percent of controlValue. + * + * @param checkedValue - checked value + * @param controlValue - referent value + * @return true if difference of checkedValue and controlValue is less than + * MEM_DIFFERENCE_PCT percent of controlValue + */ + private static boolean checkDifferenceRatio(long checkedValue, long controlValue) { + return (Math.abs(checkedValue - controlValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT; + } + + private static Map getPlabStats(LogParser logParser, LogParser.ReportType type, long gc_id) { + + Map survivorStats = logParser.getEntries() + .get(gc_id) + .get(type); + return survivorStats; + } + + /** + * Description of one test case. + */ + private static class TestCase { + + private final int wastePct; + private final int plabSize; + private final int chunkSize; + private final int parGCThreads; + private final int edenSize; + private final boolean plabIsFixed; + private final boolean objectsAreReachable; + private final boolean promotedByPLAB; + + /** + * @param wastePct + * ParallelGCBufferWastePct + * @param plabSize + * -XX:OldPLABSize and -XX:YoungPLABSize + * @param chunkSize + * requested object size for memory consumption + * @param parGCThreads + * -XX:ParallelGCThreads + * @param edenSize + * NewSize and MaxNewSize + * @param plabIsFixed + * Use dynamic PLAB or fixed size PLAB + * @param objectsAreReachable + * true - allocate live objects + * false - allocate unreachable objects + * @param promotedByPLAB + * true - we expect to see PLAB allocation during promotion + * false - objects will be directly allocated during promotion + */ + public TestCase(int wastePct, + int plabSize, + int chunkSize, + int parGCThreads, + int edenSize, + boolean plabIsFixed, + boolean objectsAreReachable, + boolean promotedByPLAB + ) { + if (wastePct == 0 || plabSize == 0 || chunkSize == 0 || parGCThreads == 0 || edenSize == 0) { + throw new IllegalArgumentException("Parameters should not be 0"); + } + this.wastePct = wastePct; + this.plabSize = plabSize; + this.chunkSize = chunkSize; + this.parGCThreads = parGCThreads; + this.edenSize = edenSize; + this.plabIsFixed = plabIsFixed; + this.objectsAreReachable = objectsAreReachable; + this.promotedByPLAB = promotedByPLAB; + } + + /** + * Convert current TestCase to List of options. + * Assume test will fill half of existed eden. + * + * @return + * List of options + */ + public List toOptions() { + return Arrays.asList("-XX:ParallelGCThreads=" + parGCThreads, + "-XX:ParallelGCBufferWastePct=" + wastePct, + "-XX:OldPLABSize=" + plabSize, + "-XX:YoungPLABSize=" + plabSize, + "-XX:" + (plabIsFixed ? "-" : "+") + "ResizePLAB", + "-Dchunk.size=" + chunkSize, + "-Dreachable=" + objectsAreReachable, + "-XX:NewSize=" + edenSize + "m", + "-XX:MaxNewSize=" + edenSize + "m", + "-Dmem.to.fill=" + getMemToFill() + ); + } + + /** + * Print details about test case. + */ + public void print(PrintStream out) { + boolean expectPLABAllocation = promotedByPLAB && objectsAreReachable; + boolean expectDirectAllocation = (!promotedByPLAB) && objectsAreReachable; + + out.println("Test case details:"); + out.println(" Young gen size : " + edenSize + "M"); + out.println(" Predefined PLAB size : " + plabSize); + out.println(" Parallel GC buffer waste pct : " + wastePct); + out.println(" Chunk size : " + chunkSize); + out.println(" Parallel GC threads : " + parGCThreads); + out.println(" Objects are created : " + (objectsAreReachable ? "reachable" : "unreachable")); + out.println(" PLAB size is fixed: " + (plabIsFixed ? "yes" : "no")); + out.println("Test expectations:"); + out.println(" PLAB allocation : " + (expectPLABAllocation ? "expected" : "unexpected")); + out.println(" Direct allocation : " + (expectDirectAllocation ? "expected" : "unexpected")); + } + + /** + * @return + * true if we expect PLAB allocation + * false if no + */ + public boolean isPromotedByPLAB() { + return promotedByPLAB; + } + + /** + * @return + * true if it is test case for unreachable objects + * false for live objects + */ + public boolean isDeadObjectCase() { + return !objectsAreReachable; + } + + /** + * Returns amount of memory to fill + * + * @return amount of memory + */ + public long getMemToFill() { + return (long) (edenSize) * 1024l * 1024l / 2; + } + } +} diff --git a/hotspot/test/gc/g1/plab/TestPLABResize.java b/hotspot/test/gc/g1/plab/TestPLABResize.java new file mode 100644 index 00000000000..07a05ce90c3 --- /dev/null +++ b/hotspot/test/gc/g1/plab/TestPLABResize.java @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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 TestPLABResize + * @bug 8141278 + * @summary Test for PLAB resizing + * @requires vm.gc=="G1" | vm.gc=="null" + * @requires vm.opt.FlightRecorder != true + * @library /testlibrary /../../test/lib / + * @modules java.management + * @build ClassFileInstaller + * sun.hotspot.WhiteBox + * gc.g1.plab.lib.LogParser + * gc.g1.plab.lib.MemoryConsumer + * gc.g1.plab.lib.PLABUtils + * gc.g1.plab.lib.AppPLABResize + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main gc.g1.plab.TestPLABResize + */ +package gc.g1.plab; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.PrintStream; + +import gc.g1.plab.lib.LogParser; +import gc.g1.plab.lib.PLABUtils; +import gc.g1.plab.lib.AppPLABResize; + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +/** + * Test for PLAB resizing. + */ +public class TestPLABResize { + + private static final int OBJECT_SIZE_SMALL = 10; + private static final int OBJECT_SIZE_MEDIUM = 70; + private static final int OBJECT_SIZE_HIGH = 150; + private static final int GC_NUM_SMALL = 1; + private static final int GC_NUM_MEDIUM = 3; + private static final int GC_NUM_HIGH = 7; + private static final int WASTE_PCT_SMALL = 10; + private static final int WASTE_PCT_MEDIUM = 20; + private static final int WASTE_PCT_HIGH = 30; + + private static final int ITERATIONS_SMALL = 3; + private static final int ITERATIONS_MEDIUM = 5; + private static final int ITERATIONS_HIGH = 8; + + private final static TestCase[] TEST_CASES = { + new TestCase(WASTE_PCT_SMALL, OBJECT_SIZE_SMALL, GC_NUM_SMALL, ITERATIONS_MEDIUM), + new TestCase(WASTE_PCT_SMALL, OBJECT_SIZE_MEDIUM, GC_NUM_HIGH, ITERATIONS_SMALL), + new TestCase(WASTE_PCT_SMALL, OBJECT_SIZE_HIGH, GC_NUM_MEDIUM, ITERATIONS_HIGH), + new TestCase(WASTE_PCT_MEDIUM, OBJECT_SIZE_SMALL, GC_NUM_HIGH, ITERATIONS_MEDIUM), + new TestCase(WASTE_PCT_MEDIUM, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, ITERATIONS_SMALL), + new TestCase(WASTE_PCT_MEDIUM, OBJECT_SIZE_HIGH, GC_NUM_MEDIUM, ITERATIONS_HIGH), + new TestCase(WASTE_PCT_HIGH, OBJECT_SIZE_SMALL, GC_NUM_HIGH, ITERATIONS_MEDIUM), + new TestCase(WASTE_PCT_HIGH, OBJECT_SIZE_MEDIUM, GC_NUM_SMALL, ITERATIONS_SMALL), + new TestCase(WASTE_PCT_HIGH, OBJECT_SIZE_HIGH, GC_NUM_MEDIUM, ITERATIONS_HIGH) + }; + + public static void main(String[] args) throws Throwable { + for (TestCase testCase : TEST_CASES) { + testCase.print(System.out); + List options = PLABUtils.prepareOptions(testCase.toOptions()); + options.add(AppPLABResize.class.getName()); + OutputAnalyzer out = ProcessTools.executeTestJvm(options.toArray(new String[options.size()])); + if (out.getExitValue() != 0) { + System.out.println(out.getOutput()); + throw new RuntimeException("Exit code is not 0"); + } + checkResults(out.getOutput(), testCase); + } + } + + /** + * Checks testing results. + * Expected results - desired PLAB size is decreased and increased during promotion to Survivor. + * + * @param output - VM output + * @param testCase + */ + private static void checkResults(String output, TestCase testCase) { + final LogParser log = new LogParser(output); + final Map>> entries = log.getEntries(); + + final ArrayList plabSizes = entries.entrySet() + .stream() + .map(item -> { + return item.getValue() + .get(LogParser.ReportType.SURVIVOR_STATS) + .get("desired_plab_sz"); + }) + .collect(Collectors.toCollection(ArrayList::new)); + + // Check that desired plab size was changed during iterations. + // It should decrease during first half of iterations + // and increase after. + List decreasedPlabs = plabSizes.subList(testCase.getIterations(), testCase.getIterations() * 2); + List increasedPlabs = plabSizes.subList(testCase.getIterations() * 2, testCase.getIterations() * 3); + + Long prev = decreasedPlabs.get(0); + for (int index = 1; index < decreasedPlabs.size(); ++index) { + Long current = decreasedPlabs.get(index); + if (prev < current) { + System.out.println(output); + throw new RuntimeException("Test failed! Expect that previous PLAB size should be greater than current. Prev.size: " + prev + " Current size:" + current); + } + prev = current; + } + + prev = increasedPlabs.get(0); + for (int index = 1; index < increasedPlabs.size(); ++index) { + Long current = increasedPlabs.get(index); + if (prev > current) { + System.out.println(output); + throw new RuntimeException("Test failed! Expect that previous PLAB size should be less than current. Prev.size: " + prev + " Current size:" + current); + } + prev = current; + } + + System.out.println("Test passed!"); + } + + /** + * Description of one test case. + */ + private static class TestCase { + + private final int wastePct; + private final int chunkSize; + private final int parGCThreads; + private final int iterations; + + /** + * @param wastePct + * ParallelGCBufferWastePct + * @param chunkSize + * requested object size for memory consumption + * @param parGCThreads + * -XX:ParallelGCThreads + * @param iterations + * + */ + public TestCase(int wastePct, + int chunkSize, + int parGCThreads, + int iterations + ) { + if (wastePct == 0 || chunkSize == 0 || parGCThreads == 0 || iterations == 0) { + throw new IllegalArgumentException("Parameters should not be 0"); + } + this.wastePct = wastePct; + + this.chunkSize = chunkSize; + this.parGCThreads = parGCThreads; + this.iterations = iterations; + } + + /** + * Convert current TestCase to List of options. + * + * @return + * List of options + */ + public List toOptions() { + return Arrays.asList("-XX:ParallelGCThreads=" + parGCThreads, + "-XX:ParallelGCBufferWastePct=" + wastePct, + "-XX:+ResizePLAB", + "-Dthreads=" + parGCThreads, + "-Dchunk.size=" + chunkSize, + "-Diterations=" + iterations, + "-XX:NewSize=16m", + "-XX:MaxNewSize=16m" + ); + } + + /** + * Print details about test case. + */ + public void print(PrintStream out) { + out.println("Test case details:"); + out.println(" Parallel GC buffer waste pct : " + wastePct); + out.println(" Chunk size : " + chunkSize); + out.println(" Parallel GC threads : " + parGCThreads); + out.println(" Iterations: " + iterations); + } + + /** + * @return iterations + */ + public int getIterations() { + return iterations; + } + } +} diff --git a/hotspot/test/gc/g1/plab/lib/AppPLABPromotion.java b/hotspot/test/gc/g1/plab/lib/AppPLABPromotion.java new file mode 100644 index 00000000000..55fe053f368 --- /dev/null +++ b/hotspot/test/gc/g1/plab/lib/AppPLABPromotion.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package gc.g1.plab.lib; + +import sun.hotspot.WhiteBox; + +/** + * This application is part of PLAB promotion test. + * The application fills a part of young gen with a number of small objects. + * Then it calls young GC twice to promote objects from eden to survivor, and from survivor to old. + * The test which running the application is responsible to set up test parameters + * and VM flags including flags turning GC logging on. The test will then check the produced log. + */ +final public class AppPLABPromotion { + + private final static WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + /** + * AppPLABPromotion is used for testing PLAB promotion. + * Expects the following properties to be set: + * - chunk.size - size of one object (byte array) + * - mem.to.fill - amount of memory to be consumed + * - reachable - memory should be consumed by live or dead objects + * + * @param args + */ + public static void main(String[] args) { + long chunkSize = Long.getLong("chunk.size"); + long memToFill = Long.getLong("mem.to.fill"); + boolean reachable = Boolean.getBoolean("reachable"); + if (chunkSize == 0) { + throw new IllegalArgumentException("Chunk size must be not 0"); + } + if (memToFill <= 0) { + throw new IllegalArgumentException("mem.to.fill property should be above 0"); + } + // Fill requested amount of memory + allocate(reachable, memToFill, chunkSize); + // Promote all allocated objects from Eden to Survivor + WHITE_BOX.youngGC(); + // Promote all allocated objects from Survivor to Old + WHITE_BOX.youngGC(); + } + + /** + * + * @param reachable - should allocate reachable object + * @param memSize - Memory to fill + * @param chunkSize - requested bytes per objects. + * Actual size of bytes per object will be greater + */ + private static void allocate(boolean reachable, long memSize, long chunkSize) { + long realSize = WHITE_BOX.getObjectSize(new byte[(int) chunkSize]); + int items = (int) ((memSize - 1) / (realSize)) + 1; + MemoryConsumer storage; + if (reachable) { + storage = new MemoryConsumer(items, (int) chunkSize); + } else { + storage = new MemoryConsumer(1, (int) chunkSize); + } + // Make all young gen available. + WHITE_BOX.fullGC(); + storage.consume(items * chunkSize); + } +} diff --git a/hotspot/test/gc/g1/plab/lib/AppPLABResize.java b/hotspot/test/gc/g1/plab/lib/AppPLABResize.java new file mode 100644 index 00000000000..58bbe5c8a25 --- /dev/null +++ b/hotspot/test/gc/g1/plab/lib/AppPLABResize.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package gc.g1.plab.lib; + +import jdk.test.lib.Platform; +import sun.hotspot.WhiteBox; + +/** + * This application is part of PLAB Resize test. + * The application allocates objects in 3 iterations: + * 1. Objects of fixed size + * 2. Objects of decreasing size + * 3. Objects of increasing size + * The application doesn't have any assumptions about expected behavior. + * It's supposed to be executed by a test which should set up test parameters (object sizes, number of allocations, etc) + * and VM flags including flags turning GC logging on. The test will then check the produced log. + * + * Expects the following properties to be set: + * - iterations - amount of iteration per cycle. + * - chunk.size - size of objects to be allocated + * - threads - number of gc threads (-XX:ParallelGCThreads) to calculate PLAB sizes. + */ +final public class AppPLABResize { + + // Memory to be promoted by PLAB for one thread. + private static final long MEM_ALLOC_WORDS = 32768; + // Defined by properties. + private static final int ITERATIONS = Integer.getInteger("iterations"); + private static final long CHUNK = Long.getLong("chunk.size"); + private static final int GC_THREADS = Integer.getInteger("threads"); + + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + /** + * Main method for AppPLABResizing. Application expect for next properties: + * iterations, chunk.size and threads. + * + * @param args + */ + public static void main(String[] args) { + + if (ITERATIONS == 0 || CHUNK == 0 || GC_THREADS == 0) { + throw new IllegalArgumentException("Properties should be set"); + } + + long wordSize = Platform.is32bit() ? 4l : 8l; + // PLAB size is shared between threads. + long initialMemorySize = wordSize * GC_THREADS * MEM_ALLOC_WORDS; + + // Expect changing memory to half during all iterations. + long memChangeStep = initialMemorySize / 2 / ITERATIONS; + + WHITE_BOX.fullGC(); + + // Warm the PLAB. Fill memory ITERATIONS times without changing memory size. + iterateAllocation(initialMemorySize, 0); + // Fill memory ITERATIONS times. + // Initial size is initialMemorySize and step is -memChangeStep + iterateAllocation(initialMemorySize, -memChangeStep); + // Fill memory ITERATIONS times. + // Initial size is memoryAfterChanging, step is memChangeStep. + // Memory size at start should be greater then last size on previous step. + // Last size on previous step is initialMemorySize - memChangeStep*(ITERATIONS - 1) + long memoryAfterChanging = initialMemorySize - memChangeStep * (ITERATIONS - 2); + iterateAllocation(memoryAfterChanging, memChangeStep); + } + + private static void iterateAllocation(long memoryToFill, long change) { + int items; + if (change > 0) { + items = (int) ((memoryToFill + change * ITERATIONS) / CHUNK) + 1; + } else { + items = (int) (memoryToFill / CHUNK) + 1; + } + + long currentMemToFill = memoryToFill; + for (int iteration = 0; iteration < ITERATIONS; ++iteration) { + MemoryConsumer storage = new MemoryConsumer(items, (int) CHUNK); + storage.consume(currentMemToFill); + // Promote all objects to survivor + WHITE_BOX.youngGC(); + storage.clear(); + currentMemToFill += change; + } + } +} diff --git a/hotspot/test/gc/g1/plab/lib/LogParser.java b/hotspot/test/gc/g1/plab/lib/LogParser.java new file mode 100644 index 00000000000..ce2f94ef6e6 --- /dev/null +++ b/hotspot/test/gc/g1/plab/lib/LogParser.java @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package gc.g1.plab.lib; + +import java.util.EnumMap; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.Scanner; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * LogParser class parses VM output to get PLAB and ConsumptionStats values. + * + * Typical GC log with PLAB statistics (options - -Xlog:gc=debug,gc+plab=debug) looks like: + * + * [2,244s][info ][gc ] GC(30) Concurrent Mark abort + * [2,245s][debug ][gc,plab] GC(33) (allocated = 1 wasted = 0 unused = 0 used = 1 undo_waste = 0 region_end_waste = 0 regions filled = 0 direct_allocated = 0 failure_used = 0 failure_waste = 0) (plab_sz = 0 desired_plab_sz = 258) + * [2,245s][debug ][gc,plab] GC(33) (allocated = 1 wasted = 0 unused = 0 used = 1 undo_waste = 0 region_end_waste = 0 regions filled = 0 direct_allocated = 0 failure_used = 0 failure_waste = 0) (plab_sz = 0 desired_plab_sz = 258) + * [2,245s][info ][gc ] GC(33) Pause Young (G1 Evacuation Pause) 127M->127M(128M) (2,244s, 2,245s) 0,899ms + * [2,246s][debug ][gc,plab] GC(34) (allocated = 1 wasted = 0 unused = 0 used = 1 undo_waste = 0 region_end_waste = 0 regions filled = 0 direct_allocated = 0 failure_used = 0 failure_waste = 0) (plab_sz = 0 desired_plab_sz = 258) + * [2,246s][debug ][gc,plab] GC(34) (allocated = 1 wasted = 0 unused = 0 used = 1 undo_waste = 0 region_end_waste = 0 regions filled = 0 direct_allocated = 0 failure_used = 0 failure_waste = 0) (plab_sz = 0 desired_plab_sz = 258) + * [2,246s][info ][gc ] GC(34) Pause Initial Mark (G1 Evacuation Pause) 127M->127M(128M) (2,245s, 2,246s) 0,907ms + + */ +final public class LogParser { + + // Name for GC ID field in report. + public final static String GC_ID = "gc_id"; + + /** + * Type of parsed log element. + */ + public static enum ReportType { + + SURVIVOR_STATS, + OLD_STATS + } + + private final String log; + + private final Map>> reportHolder; + + // GC ID + private static final Pattern GC_ID_PATTERN = Pattern.compile("\\[gc,plab\\s*\\] GC\\((\\d+)\\)"); + // Pattern for extraction pair = + private static final Pattern PAIRS_PATTERN = Pattern.compile("\\w+\\s+=\\s+\\d+"); + + /** + * Construct LogParser Object + * + * @param log - VM Output + */ + public LogParser(String log) { + if (log == null) { + throw new IllegalArgumentException("Parameter log should not be null."); + } + this.log = log; + reportHolder = parseLines(); + } + + /** + * @return log which is being processed + */ + public String getLog() { + return log; + } + + /** + * Returns list of log entries. + * + * @return list of Pair with ReportType and Map of parameters/values. + */ + public Map>> getEntries() { + return reportHolder; + } + + private Map>> parseLines() throws NumberFormatException { + Scanner lineScanner = new Scanner(log); + Map>> allocationStatistics = new HashMap<>(); + Optional gc_id; + while (lineScanner.hasNextLine()) { + String line = lineScanner.nextLine(); + gc_id = getGcId(line); + if ( gc_id.isPresent() ) { + Matcher matcher = PAIRS_PATTERN.matcher(line); + if (matcher.find()) { + Map> oneReportItem; + ReportType reportType; + // Second line in log is statistics for Old PLAB allocation + if ( !allocationStatistics.containsKey(gc_id.get()) ) { + oneReportItem = new EnumMap<>(ReportType.class); + reportType = ReportType.SURVIVOR_STATS; + allocationStatistics.put(gc_id.get(), oneReportItem); + } else { + oneReportItem = allocationStatistics.get(gc_id.get()); + reportType = ReportType.OLD_STATS; + } + + // Extract all pairs from log. + HashMap plabStats = new HashMap<>(); + do { + String pair = matcher.group(); + String[] nameValue = pair.replaceAll(" ", "").split("="); + plabStats.put(nameValue[0], Long.parseLong(nameValue[1])); + } while (matcher.find()); + oneReportItem.put(reportType,plabStats); + } + } + } + return allocationStatistics; + } + + private Optional getGcId(String line) { + Matcher number = GC_ID_PATTERN.matcher(line); + if (number.find()) { + return Optional.of(Long.parseLong(number.group(1))); + } + return Optional.empty(); + } +} diff --git a/hotspot/test/gc/g1/plab/lib/MemoryConsumer.java b/hotspot/test/gc/g1/plab/lib/MemoryConsumer.java new file mode 100644 index 00000000000..1ac78da4f52 --- /dev/null +++ b/hotspot/test/gc/g1/plab/lib/MemoryConsumer.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package gc.g1.plab.lib; + +/** + * The MemoryConsumer is used for consuming different amount of memory. + * Class will store not more than 'capacity' number of objects with 'chunk' size. + * If we exceed capacity, object will be stored at existing entries, + * all previously added objects will be overwritten. + * If capacity=1, only last object will be saved. + */ +public class MemoryConsumer { + + private int capacity; + private int chunk; + + private Object[] array; + private int index; + + /** + * Create MemoryConsumer object with defined capacity + * + * @param capacity + * @param chunk + */ + public MemoryConsumer(int capacity, int chunk) { + if (capacity <= 0) { + throw new IllegalArgumentException("Items number should be greater than 0."); + } + if (chunk <= 0) { + throw new IllegalArgumentException("Chunk size should be greater than 0."); + } + this.capacity = capacity; + this.chunk = chunk; + index = 0; + array = new Object[this.capacity]; + } + + /** + * Store object into MemoryConsumer. + * + * @param o - Object to store + */ + private void store(Object o) { + if (array == null) { + throw new RuntimeException("Capacity should be set before storing"); + } + array[index % capacity] = o; + ++index; + } + + public void consume(long memoryToFill) { + long allocated = 0; + while (allocated < memoryToFill) { + store(new byte[chunk]); + allocated += chunk; + } + } + + /** + * Clear all stored objects. + */ + public void clear() { + array = null; + } +} diff --git a/hotspot/test/gc/g1/plab/lib/PLABUtils.java b/hotspot/test/gc/g1/plab/lib/PLABUtils.java new file mode 100644 index 00000000000..ee13f0a2fa2 --- /dev/null +++ b/hotspot/test/gc/g1/plab/lib/PLABUtils.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package gc.g1.plab.lib; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import jdk.test.lib.Utils; + +/** + * Utilities for PLAB testing. + */ +public class PLABUtils { + + /** + * PLAB tests default options list + */ + private final static String[] GC_TUNE_OPTIONS = { + "-XX:+UseG1GC", + "-XX:G1HeapRegionSize=1m", + "-XX:OldSize=64m", + "-XX:-UseAdaptiveSizePolicy", + "-XX:MaxTenuringThreshold=1", + "-XX:-UseTLAB", + "-XX:SurvivorRatio=1" + }; + + /** + * GC logging options list. + */ + private final static String G1_PLAB_LOGGING_OPTIONS[] = { + "-Xlog:gc=debug,gc+plab=debug" + }; + + /** + * List of options required to use WhiteBox. + */ + private final static String WB_DIAGNOSTIC_OPTIONS[] = { + "-Xbootclasspath/a:.", + "-XX:+UnlockDiagnosticVMOptions", + "-XX:+WhiteBoxAPI" + }; + + /** + * Prepares options for testing. + * + * @param options - additional options for testing + * @return List of options + */ + public static List prepareOptions(List options) { + if (options == null) { + throw new IllegalArgumentException("Options cannot be null"); + } + List executionOtions = new ArrayList<>( + Arrays.asList(Utils.getTestJavaOpts()) + ); + Collections.addAll(executionOtions, WB_DIAGNOSTIC_OPTIONS); + Collections.addAll(executionOtions, G1_PLAB_LOGGING_OPTIONS); + Collections.addAll(executionOtions, GC_TUNE_OPTIONS); + executionOtions.addAll(options); + return executionOtions; + } +} diff --git a/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java b/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java new file mode 100644 index 00000000000..aaf4d5cff8d --- /dev/null +++ b/hotspot/test/gc/logging/TestDeprecatedPrintFlags.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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 TestDeprecatedPrintFlags + * @bug 8145180 + * @summary Verify PrintGC, PrintGCDetails and -Xloggc + * @key gc + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + */ + +import jdk.test.lib.*; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.stream.Collectors; + +public class TestDeprecatedPrintFlags { + + public static void testPrintGC() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGC", "DoGC"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("-XX:+PrintGC is deprecated. Will use -Xlog:gc instead."); + output.shouldNotContain("PrintGCDetails"); + output.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]"); + output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,"); + output.shouldHaveExitValue(0); + } + + public static void testPrintGCDetails() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "DoGC"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); + output.shouldNotContain("PrintGC is deprecated"); + output.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]"); + output.stdoutShouldMatch("\\[info.*\\]\\[gc\\,"); + output.shouldHaveExitValue(0); + } + + public static void testXloggc() throws Exception { + String fileName = "gc-test.log"; + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xloggc:" + fileName, "DoGC"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead."); + output.shouldNotContain("PrintGCDetails"); + output.shouldNotContain("PrintGC"); + output.stdoutShouldNotMatch("\\[info.*\\]\\[gc *\\]"); + output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,"); + output.shouldHaveExitValue(0); + String lines = Files.lines(Paths.get(fileName)).collect(Collectors.joining()); + System.out.println("lines: " + lines); + OutputAnalyzer outputLog = new OutputAnalyzer(lines, ""); + outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]"); + outputLog.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,"); + } + + public static void testXloggcWithPrintGCDetails() throws Exception { + String fileName = "gc-test.log"; + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-Xloggc:" + fileName, "DoGC"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead."); + output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead."); + output.shouldNotContain("PrintGC is deprecated"); + output.stdoutShouldNotMatch("\\[info.*\\]\\[gc *\\]"); + output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,"); + output.shouldHaveExitValue(0); + String lines = Files.lines(Paths.get(fileName)).collect(Collectors.joining()); + OutputAnalyzer outputLog = new OutputAnalyzer(lines, ""); + outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]"); + outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc\\,"); + } + + public static void main(String[] args) throws Exception { + testPrintGC(); + testPrintGCDetails(); + testXloggc(); + testXloggcWithPrintGCDetails(); + } +} + +class DoGC { + public static void main(String[] args) { + System.gc(); + } +} diff --git a/hotspot/test/runtime/Unsafe/AllocateMemory.java b/hotspot/test/runtime/Unsafe/AllocateMemory.java index a86c463137b..0bc26727b51 100644 --- a/hotspot/test/runtime/Unsafe/AllocateMemory.java +++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +23,7 @@ /* * @test + * @requires vm.compMode != "Xcomp" * @summary Verifies behaviour of Unsafe.allocateMemory * @library /testlibrary * @modules java.base/sun.misc diff --git a/hotspot/test/runtime/Unsafe/Reallocate.java b/hotspot/test/runtime/Unsafe/Reallocate.java index 606845f2e42..4f441586486 100644 --- a/hotspot/test/runtime/Unsafe/Reallocate.java +++ b/hotspot/test/runtime/Unsafe/Reallocate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +23,7 @@ /* * @test + * @requires vm.compMode != "Xcomp" * @bug 8058897 * @library /testlibrary * @modules java.base/sun.misc diff --git a/jdk/test/sun/misc/Cleaner/ExitOnThrow.java b/hotspot/test/runtime/classFileParserBug/Class53.jasm similarity index 64% rename from jdk/test/sun/misc/Cleaner/ExitOnThrow.java rename to hotspot/test/runtime/classFileParserBug/Class53.jasm index 5fdca20670d..fa052b48c66 100644 --- a/jdk/test/sun/misc/Cleaner/ExitOnThrow.java +++ b/hotspot/test/runtime/classFileParserBug/Class53.jasm @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * 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,24 +21,23 @@ * questions. */ -// +/* + * @test + * @bug 8148785 + * @summary Check that the JVM accepts class files with version 53 + * @run main Class53 + */ -import sun.misc.*; +super public class Class53 version 53:0 { - -public class ExitOnThrow { - - public static void main(String[] args) throws Exception { - Cleaner.create(new Object(), - new Runnable() { - public void run() { - throw new RuntimeException("Foo!"); - } - }); - while (true) { - System.gc(); - Thread.sleep(100); - } + public Method "":"()V" stack 1 locals 1 { + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; } -} + public static Method main:"([Ljava/lang/String;)V" stack 0 locals 1 { + return; + } + +} // end Class Class53 diff --git a/hotspot/test/runtime/logging/ClassB.java b/hotspot/test/runtime/logging/ClassB.java index 0642e13c572..c6cb4a613e9 100644 --- a/hotspot/test/runtime/logging/ClassB.java +++ b/hotspot/test/runtime/logging/ClassB.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/test/runtime/logging/ClassInitializationTest.java b/hotspot/test/runtime/logging/ClassInitializationTest.java index eb0583d4386..3a5c4e3f9ba 100644 --- a/hotspot/test/runtime/logging/ClassInitializationTest.java +++ b/hotspot/test/runtime/logging/ClassInitializationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,10 @@ public class ClassInitializationTest { public static void main(String... args) throws Exception { // (1) - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=info", "-Xverify:all", "-Xmx64m", "BadMap50"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=info", + "-Xverify:all", + "-Xmx64m", + "BadMap50"); OutputAnalyzer out = new OutputAnalyzer(pb.start()); out.shouldContain("Start class verification for:"); out.shouldContain("End class verification for:"); @@ -50,16 +53,29 @@ public class ClassInitializationTest { // (2) if (Platform.isDebugBuild()) { - pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=info", "-Xverify:all", "-XX:+EagerInitialization", "-Xmx64m", "-version"); - out = new OutputAnalyzer(pb.start()); - out.shouldContain("[Initialized").shouldContain("without side effects]"); - out.shouldHaveExitValue(0); + pb = ProcessTools.createJavaProcessBuilder("-Xlog:classinit=info", + "-Xverify:all", + "-XX:+EagerInitialization", + "-Xmx64m", + InnerClass.class.getName()); + out = new OutputAnalyzer(pb.start()); + out.shouldContain("[Initialized").shouldContain("without side effects]"); + out.shouldHaveExitValue(0); } // (3) Ensure that VerboseVerification still triggers appropriate messages. - pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+VerboseVerification", "-Xverify:all", "-Xmx64m", "BadMap50"); + pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", + "-XX:+VerboseVerification", + "-Xverify:all", + "-Xmx64m", + "BadMap50"); out = new OutputAnalyzer(pb.start()); out.shouldContain("End class verification for:"); out.shouldContain("Verification for BadMap50 failed"); out.shouldContain("Fail over class verification to old verifier for: BadMap50"); } + public static class InnerClass { + public static void main(String[] args) throws Exception { + System.out.println("Inner Class"); + } + } } diff --git a/hotspot/test/runtime/logging/ClassLoadUnloadTest.java b/hotspot/test/runtime/logging/ClassLoadUnloadTest.java new file mode 100644 index 00000000000..85cf5cb2284 --- /dev/null +++ b/hotspot/test/runtime/logging/ClassLoadUnloadTest.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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 ClassLoadUnloadTest + * @bug 8142506 + * @library /testlibrary /runtime/testlibrary + * @library classes + * @build ClassUnloadCommon test.Empty jdk.test.lib.* jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @run driver ClassLoadUnloadTest + */ + +import jdk.test.lib.*; +import java.lang.ref.WeakReference; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ClassLoadUnloadTest { + private static OutputAnalyzer out; + private static ProcessBuilder pb; + private static class ClassUnloadTestMain { + public static void main(String... args) throws Exception { + String className = "test.Empty"; + ClassLoader cl = ClassUnloadCommon.newClassLoader(); + Class c = cl.loadClass(className); + cl = null; c = null; + ClassUnloadCommon.triggerUnloading(); + } + } + + static void checkFor(String... outputStrings) throws Exception { + out = new OutputAnalyzer(pb.start()); + for (String s: outputStrings) { + out.shouldContain(s); + } + out.shouldHaveExitValue(0); + } + + static void checkAbsent(String... outputStrings) throws Exception { + out = new OutputAnalyzer(pb.start()); + for (String s: outputStrings) { + out.shouldNotContain(s); + } + out.shouldHaveExitValue(0); + } + + // Use the same command-line heap size setting as ../ClassUnload/UnloadTest.java + static ProcessBuilder exec(String... args) throws Exception { + List argsList = new ArrayList<>(); + Collections.addAll(argsList, args); + Collections.addAll(argsList, "-Xmn8m"); + Collections.addAll(argsList, "-Dtest.classes=" + System.getProperty("test.classes",".")); + Collections.addAll(argsList, ClassUnloadTestMain.class.getName()); + return ProcessTools.createJavaProcessBuilder(argsList.toArray(new String[argsList.size()])); + } + + public static void main(String... args) throws Exception { + + // -Xlog:classunload=info + pb = exec("-Xlog:classunload=info"); + checkFor("[classunload]", "unloading class"); + + // -Xlog:classunload=off + pb = exec("-Xlog:classunload=off"); + checkAbsent("[classunload]"); + + // -XX:+TraceClassUnloading + pb = exec("-XX:+TraceClassUnloading"); + checkFor("[classunload]", "unloading class"); + + // -XX:-TraceClassUnloading + pb = exec("-XX:-TraceClassUnloading"); + checkAbsent("[classunload]"); + + // -Xlog:classload=info + pb = exec("-Xlog:classload=info"); + checkFor("[classload]", "java.lang.Object", "source:"); + + // -Xlog:classload=debug + pb = exec("-Xlog:classload=debug"); + checkFor("[classload]", "java.lang.Object", "source:", "klass:", "super:", "loader:", "bytes:"); + + // -Xlog:classload=off + pb = exec("-Xlog:classload=off"); + checkAbsent("[classload]"); + + // -XX:+TraceClassLoading + pb = exec("-XX:+TraceClassLoading"); + checkFor("[classload]", "java.lang.Object", "source:"); + + // -XX:-TraceClassLoading + pb = exec("-XX:-TraceClassLoading"); + checkAbsent("[classload]"); + + // -verbose:class + pb = exec("-verbose:class"); + checkFor("[classload]", "java.lang.Object", "source:"); + checkFor("[classunload]", "unloading class"); + + // -Xlog:classloaderdata=trace + pb = exec("-Xlog:classloaderdata=trace"); + checkFor("[classloaderdata]", "create class loader data"); + + } +} diff --git a/hotspot/test/runtime/logging/ClassResolutionTest.java b/hotspot/test/runtime/logging/ClassResolutionTest.java index 84d06c4eebb..2a98f5ac68c 100644 --- a/hotspot/test/runtime/logging/ClassResolutionTest.java +++ b/hotspot/test/runtime/logging/ClassResolutionTest.java @@ -58,26 +58,28 @@ public class ClassResolutionTest { public static void main(String... args) throws Exception { // (1) classresolve should turn on. - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:classresolve=info", ClassResolutionTestMain.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=info", + ClassResolutionTestMain.class.getName()); OutputAnalyzer o = new OutputAnalyzer(pb.start()); o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); // (2) classresolve should turn off. - pb = ProcessTools.createJavaProcessBuilder( - "-Xlog", "-Xlog:classresolve=off", ClassResolutionTestMain.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-Xlog", + "-Xlog:classresolve=off", + ClassResolutionTestMain.class.getName()); o = new OutputAnalyzer(pb.start()); o.shouldNotContain("[classresolve]"); // (3) TraceClassResolution should turn on. - pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceClassResolution", ClassResolutionTestMain.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceClassResolution", + ClassResolutionTestMain.class.getName()); o = new OutputAnalyzer(pb.start()); o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); // (4) TraceClassResolution should turn off. - pb = ProcessTools.createJavaProcessBuilder( - "-Xlog", "-XX:-TraceClassResolution", ClassResolutionTestMain.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-Xlog", + "-XX:-TraceClassResolution", + ClassResolutionTestMain.class.getName()); o = new OutputAnalyzer(pb.start()); o.shouldNotContain("[classresolve]"); diff --git a/hotspot/test/runtime/logging/DefaultMethodsTest.java b/hotspot/test/runtime/logging/DefaultMethodsTest.java index 9e08ba72a35..c1ac868906e 100644 --- a/hotspot/test/runtime/logging/DefaultMethodsTest.java +++ b/hotspot/test/runtime/logging/DefaultMethodsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * @bug 8139564 * @summary defaultmethods=debug should have logging from each of the statements in the code * @library /testlibrary - * @ignore 8146435 * @modules java.base/sun.misc * java.management * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools @@ -38,8 +37,8 @@ import jdk.test.lib.ProcessTools; public class DefaultMethodsTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:defaultmethods=debug", "-version"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:defaultmethods=debug", + InnerClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Slots that need filling:"); output.shouldContain("requires default method processing"); @@ -51,5 +50,11 @@ public class DefaultMethodsTest { output.shouldContain("default methods"); output.shouldHaveExitValue(0); } + + public static class InnerClass { + public static void main(String[] args) throws Exception { + System.out.println("Inner Class"); + } + } } diff --git a/hotspot/test/runtime/logging/ExceptionsTest.java b/hotspot/test/runtime/logging/ExceptionsTest.java index bac3dd0cdb0..3dfaec82d1e 100644 --- a/hotspot/test/runtime/logging/ExceptionsTest.java +++ b/hotspot/test/runtime/logging/ExceptionsTest.java @@ -23,8 +23,8 @@ /* * @test - * @bug 8141211 - * @summary exceptions=info output should have an exception message for both interpreter and compiled methods + * @bug 8141211 8147477 + * @summary exceptions=info output should have an exception message for interpreter methods * @library /testlibrary * @modules java.base/sun.misc * java.management @@ -32,16 +32,21 @@ * @run driver ExceptionsTest */ +import java.io.File; +import java.util.Map; import jdk.test.lib.OutputAnalyzer; import jdk.test.lib.ProcessTools; public class ExceptionsTest { + static void updateEnvironment(ProcessBuilder pb, String environmentVariable, String value) { + Map env = pb.environment(); + env.put(environmentVariable, value); + } + static void analyzeOutputOn(ProcessBuilder pb) throws Exception { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); output.shouldContain(" thrown in interpreter method "); - output.shouldContain(" thrown in compiled method "); - output.shouldContain("Exception 2 caught."); output.shouldHaveExitValue(0); } @@ -52,47 +57,43 @@ public class ExceptionsTest { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:exceptions=info", "-Xcomp", - "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=info", + InternalClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceExceptions", "-Xcomp", - "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", - InternalClass.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceExceptions", + InternalClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:exceptions=off", "-Xcomp", - "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", - InternalClass.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-Xlog:exceptions=off", + InternalClass.class.getName()); analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder( - "-XX:-TraceExceptions", "-Xcomp", - "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", - InternalClass.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-XX:-TraceExceptions", + InternalClass.class.getName()); analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName()); + updateEnvironment(pb, "_JAVA_OPTIONS", "-XX:+TraceExceptions"); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder(InternalClass.class.getName()); + updateEnvironment(pb, "JAVA_TOOL_OPTIONS", "-Xlog:exceptions=info -XX:-TraceExceptions"); + analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder("-XX:VMOptionsFile=" + System.getProperty("test.src", ".") + + File.separator + "ExceptionsTest_options_file", + InternalClass.class.getName()); + analyzeOutputOn(pb); } public static class InternalClass { - public static void compileMe() throws Exception { - try { - throw new RuntimeException("Test exception 2 for logging"); - } catch (Exception e) { - System.out.println("Exception 2 caught."); - } - } - public static void main(String[] args) throws Exception { try { throw new RuntimeException("Test exception 1 for logging"); } catch (Exception e) { System.out.println("Exception 1 caught."); } - compileMe(); } } } diff --git a/hotspot/test/runtime/logging/ExceptionsTest_options_file b/hotspot/test/runtime/logging/ExceptionsTest_options_file new file mode 100644 index 00000000000..b5f0532f96c --- /dev/null +++ b/hotspot/test/runtime/logging/ExceptionsTest_options_file @@ -0,0 +1 @@ +-XX:+TraceExceptions diff --git a/hotspot/test/runtime/logging/ItablesTest.java b/hotspot/test/runtime/logging/ItablesTest.java index 4cad4392bad..c1cfd33d865 100644 --- a/hotspot/test/runtime/logging/ItablesTest.java +++ b/hotspot/test/runtime/logging/ItablesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @summary itables=trace should have logging from each of the statements * in the code * @library /testlibrary - * @ignore 8146435 * @compile ClassB.java + * ItablesVtableTest.java * @modules java.base/sun.misc * java.management * @run driver ItablesTest @@ -39,12 +39,10 @@ import jdk.test.lib.*; public class ItablesTest { public static void main(String[] args) throws Exception { if (Platform.isDebugBuild()) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:itables=trace", "ClassB"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:itables=trace", "ClassB"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(": Initializing itables for ClassB"); output.shouldContain(": Initializing itable indices for interface "); - output.shouldContain("vtable index "); output.shouldContain("itable index "); output.shouldContain("target: ClassB.Method1()V, method_holder: ClassB target_method flags: public"); output.shouldContain("invokeinterface resolved method: caller-class"); @@ -53,6 +51,11 @@ public class ItablesTest { output.shouldContain("invokeinterface selected method: receiver-class"); output.shouldContain("Resolving: klass: "); output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder("-Xlog:itables=trace", "ItablesVtableTest"); + output = new OutputAnalyzer(pb.start()); + output.shouldContain("vtable index "); + output.shouldHaveExitValue(0); } } } diff --git a/hotspot/test/runtime/logging/ItablesVtableTest.java b/hotspot/test/runtime/logging/ItablesVtableTest.java new file mode 100644 index 00000000000..fb07a9be545 --- /dev/null +++ b/hotspot/test/runtime/logging/ItablesVtableTest.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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. + */ + +interface Interface1 { + public void foo(); + public int hashCode(); +} + +public class ItablesVtableTest implements Interface1 { + public void foo() { + System.out.println("ItablesVtableTest foo"); + } + public int hashCode() { + return 55; + } + + public static void main(String[] unused) { + ItablesVtableTest c = new ItablesVtableTest(); + c.foo(); + System.out.println("Interface1 hashCode " + c.hashCode()); + } +} diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java index 7399ea6dce9..781ee83c6cd 100644 --- a/hotspot/test/runtime/logging/MonitorInflationTest.java +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,20 +51,20 @@ public class MonitorInflationTest { } public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:monitorinflation=debug", InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=debug", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceMonitorInflation", InnerClass.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceMonitorInflation", + InnerClass.class.getName()); analyzeOutputOn(pb); - pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:monitorinflation=off", InnerClass.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-Xlog:monitorinflation=off", + InnerClass.class.getName()); analyzeOutputOff(pb); - pb = ProcessTools.createJavaProcessBuilder( - "-XX:-TraceMonitorInflation", InnerClass.class.getName()); + pb = ProcessTools.createJavaProcessBuilder("-XX:-TraceMonitorInflation", + InnerClass.class.getName()); analyzeOutputOff(pb); } diff --git a/hotspot/test/runtime/logging/SafepointTest.java b/hotspot/test/runtime/logging/SafepointTest.java index 100edfad9e9..a57eaa811a5 100644 --- a/hotspot/test/runtime/logging/SafepointTest.java +++ b/hotspot/test/runtime/logging/SafepointTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ import jdk.test.lib.ProcessTools; public class SafepointTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:safepoint=trace", InnerClass.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:safepoint=trace", + InnerClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Safepoint synchronization initiated. ("); output.shouldContain("Entering safepoint region: "); diff --git a/hotspot/test/runtime/logging/VMOperationTest.java b/hotspot/test/runtime/logging/VMOperationTest.java index 8b8c9c3e210..13570d6af6d 100644 --- a/hotspot/test/runtime/logging/VMOperationTest.java +++ b/hotspot/test/runtime/logging/VMOperationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,9 +38,10 @@ import jdk.test.lib.ProcessTools; public class VMOperationTest { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:vmoperation=debug", "-Xmx64m", "-Xms64m", - InternalClass.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vmoperation=debug", + "-Xmx64m", + "-Xms64m", + InternalClass.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("VM_Operation ("); output.shouldHaveExitValue(0); diff --git a/hotspot/test/runtime/logging/VtablesTest.java b/hotspot/test/runtime/logging/VtablesTest.java index e31d4cde2fc..9df4c595069 100644 --- a/hotspot/test/runtime/logging/VtablesTest.java +++ b/hotspot/test/runtime/logging/VtablesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ import jdk.test.lib.*; public class VtablesTest { public static void main(String[] args) throws Exception { if (Platform.isDebugBuild()) { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:vtables=trace", "ClassB"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "ClassB"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("copy vtable from ClassA to ClassB"); output.shouldContain("Initializing: ClassB"); diff --git a/hotspot/test/runtime/logging/classes/test/Empty.java b/hotspot/test/runtime/logging/classes/test/Empty.java new file mode 100644 index 00000000000..cf3e5f5199d --- /dev/null +++ b/hotspot/test/runtime/logging/classes/test/Empty.java @@ -0,0 +1,5 @@ +package test; + +public class Empty { +public String toString() { return "nothing"; } +} diff --git a/hotspot/test/runtime/os/AvailableProcessors.java b/hotspot/test/runtime/os/AvailableProcessors.java new file mode 100644 index 00000000000..529f2a0889b --- /dev/null +++ b/hotspot/test/runtime/os/AvailableProcessors.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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.io.File; +import jdk.test.lib.ProcessTools; +import jdk.test.lib.OutputAnalyzer; +import java.util.ArrayList; + +/* + * @test + * @bug 6515172 8148766 + * @summary Check that availableProcessors reports the correct value when running in a cpuset on linux + * @requires os.family == "linux" + * @library /testlibrary + * @build jdk.test.lib.* + * @run driver AvailableProcessors + */ +public class AvailableProcessors { + + static final String SUCCESS_STRING = "Found expected processors: "; + + public static void main(String[] args) throws Exception { + if (args.length > 0) + checkProcessors(Integer.parseInt(args[0])); + else { + // run ourselves under different cpu configurations + // using the taskset command + String taskset; + final String taskset1 = "/bin/taskset"; + final String taskset2 = "/usr/bin/taskset"; + if (new File(taskset1).exists()) + taskset = taskset1; + else if (new File(taskset2).exists()) + taskset = taskset2; + else { + System.out.println("Skipping test: could not find taskset command"); + return; + } + + int available = Runtime.getRuntime().availableProcessors(); + + if (available == 1) { + System.out.println("Skipping test: only one processor available"); + return; + } + + // Get the java command we want to execute + // Enable logging for easier failure diagnosis + ProcessBuilder master = + ProcessTools.createJavaProcessBuilder(false, + "-Xlog:os=trace", + "AvailableProcessors"); + + int[] expected = new int[] { 1, available/2, available-1, available }; + + for (int i : expected) { + System.out.println("Testing for " + i + " processors ..."); + int max = i - 1; + ArrayList cmdline = new ArrayList<>(master.command()); + // prepend taskset command + cmdline.add(0, "0-" + max); + cmdline.add(0, "-c"); + cmdline.add(0, taskset); + // append expected processor count + cmdline.add(String.valueOf(i)); + ProcessBuilder pb = new ProcessBuilder(cmdline); + System.out.println("Final command line: " + + ProcessTools.getCommandLine(pb)); + OutputAnalyzer output = ProcessTools.executeProcess(pb); + output.shouldContain(SUCCESS_STRING); + } + } + } + + static void checkProcessors(int expected) { + int available = Runtime.getRuntime().availableProcessors(); + // available can dynamically drop below expected due to aggressive power management + // but we should never have more than expected, else taskset is broken + if (available <= 0 || available > expected) + throw new Error("Expected " + expected + " processors, but found " + + available); + else + System.out.println(SUCCESS_STRING + available); + } +} diff --git a/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java b/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java index 06729ac6a86..d92361396bb 100644 --- a/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java +++ b/hotspot/test/runtime/testlibrary/ClassUnloadCommon.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * 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,6 +21,12 @@ * questions. */ + +/* + * To use ClassUnloadCommon from a sub-process, see hotspot/test/runtime/logging/ClassLoadUnloadTest.java + * for an example. + */ + import java.io.File; import java.net.MalformedURLException; import java.net.URL; diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java index bbf073a827c..63e80ab05bd 100644 --- a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java +++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* * @build jdk.test.lib.hprof.* - * @build jdk.test.lib.hprof.module.* + * @build jdk.test.lib.hprof.model.* * @build jdk.test.lib.hprof.parser.* * @build jdk.test.lib.hprof.utils.* * @build HeapDumpTest diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java index 20f766d3bf6..aefd604c25c 100644 --- a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java +++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ import jdk.test.lib.dcmd.PidJcmdExecutor; * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* * @build jdk.test.lib.hprof.* - * @build jdk.test.lib.hprof.module.* + * @build jdk.test.lib.hprof.model.* * @build jdk.test.lib.hprof.parser.* * @build jdk.test.lib.hprof.utils.* * @run testng HeapDumpTest diff --git a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java index 75b04597cd2..198124cf3a0 100644 --- a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java @@ -88,6 +88,7 @@ public class WaitNotifyThreadTest { } private void doTest() throws Exception { + // Verify stack trace consistency when notifying the thread doTest(new ActionNotify()); @@ -134,8 +135,7 @@ public class WaitNotifyThreadTest { if (mi.getName().startsWith(OBJECT_WAIT) && mi.getCompilationUnit() == null /*native method*/) { if (mi.getLocks().size() == 1) { MonitorInfo monInfo = mi.getLocks().getFirst(); - if (monInfo.getType().equals("waiting on") - && monInfo.getMonitorClass().equals(OBJECT)) { + if (monInfo.getType().equals("waiting on") && compareMonitorClass(monInfo)) { monitorAddress = monInfo.getMonitorAddress(); } else { System.err.println("Error: incorrect monitor info: " + monInfo.getType() + ", " + monInfo.getMonitorClass()); @@ -166,7 +166,7 @@ public class WaitNotifyThreadTest { private void assertMonitorInfo(String expectedMessage, MonitorInfo monInfo, String monitorAddress) { if (monInfo.getType().equals(expectedMessage) - && monInfo.getMonitorClass().equals(OBJECT + "11") + && compareMonitorClass(monInfo) && monInfo.getMonitorAddress().equals( monitorAddress)) { System.out.println("Correct monitor info found"); @@ -177,6 +177,13 @@ public class WaitNotifyThreadTest { } } + private boolean compareMonitorClass(MonitorInfo monInfo) { + // If monitor class info is present in the jstack output + // then compare it with the class of the actual monitor object + // If there is no monitor class info available then return true + return OBJECT.equals(monInfo.getMonitorClass()) || (monInfo.getMonitorClass() == null); + } + private void analyzeThreadStackNoWaiting(ThreadStack ti2) { Iterator it = ti2.getStack().iterator(); diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java b/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java index 4c753a5c0c9..6ce6c1b2c80 100644 --- a/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java +++ b/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java @@ -70,10 +70,18 @@ public class DefaultFormat implements Format { return "^JNI\\sglobal\\sreferences:\\s((.+))$"; } + // Sample string that matches the pattern: + // waiting on <0x000000008f64e6d0> (a java.lang.Object) protected String monitorInfoPattern() { return "^\\s+\\-\\s(locked|waiting\\son|waiting\\sto\\slock)\\s\\<(.*)\\>\\s\\(((.*))\\)$"; } + // Sample string that matches the pattern: + // waiting on + protected String monitorInfoNoObjectRefPattern() { + return "^\\s+\\-\\s(locked|waiting\\son|waiting\\sto\\slock)\\s\\<(.*)\\>$"; + } + protected String vmVersionInfoPattern() { return "Full\\sthread\\sdump\\s.*"; } @@ -100,7 +108,10 @@ public class DefaultFormat implements Format { currentMethodInfo = parseMethodInfo(line); currentThreadStack.addMethod(currentMethodInfo); } else if (line.matches(monitorInfoPattern())) { - MonitorInfo mi = parseMonitorInfo(line); + MonitorInfo mi = parseMonitorInfo(line, monitorInfoPattern()); + currentMethodInfo.getLocks().add(mi); + } else if (line.matches(monitorInfoNoObjectRefPattern())) { + MonitorInfo mi = parseMonitorInfo(line, monitorInfoNoObjectRefPattern()); currentMethodInfo.getLocks().add(mi); } else if (line.matches(extendedStatusPattern())) { currentThreadStack.setExtendedStatus(parseExtendedStatus(line)); @@ -125,16 +136,17 @@ public class DefaultFormat implements Format { return result; } - private MonitorInfo parseMonitorInfo(String line) { + private MonitorInfo parseMonitorInfo(String line, String pattern) { Scanner s = new Scanner(line); - s.findInLine(monitorInfoPattern()); + s.findInLine(pattern); MonitorInfo mi = new MonitorInfo(); MatchResult res = s.match(); mi.setType(res.group(1)); mi.setMonitorAddress(res.group(2)); - mi.setMonitorClass(res.group(3)); - + if (res.groupCount() > 2) { + mi.setMonitorClass(res.group(3)); + } return mi; } diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java index e695ca3d9bb..3b63e0210d1 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 +29,7 @@ import utils.*; * displayed with jstat -gccapacity. * @library /test/lib/share/classes * @library ../share - * @ignore 8147848 + * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @build common.* * @build utils.* * @run main/othervm -XX:+UsePerfData GcCapacityTest diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java index b233f770d61..55ee941e38c 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ * collection time increase. * @library /test/lib/share/classes * @library ../share - * @ignore 8147848 + * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @build common.* * @build utils.* * diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java index 6b1c92bda8e..ee731adb144 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ * collection time increase. * @library /test/lib/share/classes * @library ../share - * @ignore 8147848 + * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @build common.* * @build utils.* * diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java index 309a5bd76db..388b53c5256 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 +61,7 @@ public class GcProvokerImpl implements GcProvoker { long edenSize = Pools.getEdenCommittedSize(); long heapSize = Pools.getHeapCommittedSize(); float targetPercent = ((float) edenSize) / (heapSize); - if ((targetPercent <= 0) || (targetPercent > 1.0)) { + if ((targetPercent < 0) || (targetPercent > 1.0)) { throw new RuntimeException("Error in the percent calculation" + " (eden size: " + edenSize + ", heap size: " + heapSize + ", calculated eden percent: " + targetPercent + ")"); } eatHeapMemory(targetPercent); diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java index c4eb9bdbda2..6ac62fa48ef 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,10 +77,10 @@ public class JstatGcCapacityResults extends JstatResults { assertThat(NGC <= NGCMX, "NGC > NGCMX (generation capacity > max generation capacity)"); float S0C = getFloatValue("S0C"); - assertThat(S0C < NGC, "S0C >= NGC (survivor space 0 capacity >= new generation capacity)"); + assertThat(S0C <= NGC, "S0C > NGC (survivor space 0 capacity > new generation capacity)"); float S1C = getFloatValue("S1C"); - assertThat(S1C < NGC, "S1C >= NGC (survivor space 1 capacity >= new generation capacity)"); + assertThat(S1C <= NGC, "S1C > NGC (survivor space 1 capacity > new generation capacity)"); float EC = getFloatValue("EC"); assertThat(EC <= NGC, "EC > NGC (eden space capacity > new generation capacity)"); diff --git a/hotspot/test/stress/gc/TestStressRSetCoarsening.java b/hotspot/test/stress/gc/TestStressRSetCoarsening.java new file mode 100644 index 00000000000..10ac597facc --- /dev/null +++ b/hotspot/test/stress/gc/TestStressRSetCoarsening.java @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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.concurrent.TimeoutException; +import sun.hotspot.WhiteBox; + +/* + * @test TestStressRSetCoarsening.java + * @key stress + * @bug 8146984 8147087 + * @requires vm.gc=="G1" | vm.gc=="null" + * @requires os.maxMemory > 3G + * + * @summary Stress G1 Remembered Set by creating a lot of cross region links + * @modules java.base/sun.misc + * @library /testlibrary /test/lib + * @build sun.hotspot.WhiteBox + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/timeout=300 + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC + * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintGC -XX:+PrintGCTimeStamps -Xlog:gc + * -Xmx500m -XX:G1HeapRegionSize=1m -XX:MaxGCPauseMillis=1000 TestStressRSetCoarsening 1 0 300 + * @run main/othervm/timeout=300 + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC + * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintGC -XX:+PrintGCTimeStamps -Xlog:gc + * -Xmx500m -XX:G1HeapRegionSize=8m -XX:MaxGCPauseMillis=1000 TestStressRSetCoarsening 1 10 300 + * @run main/othervm/timeout=300 + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC + * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintGC -XX:+PrintGCTimeStamps -Xlog:gc + * -Xmx500m -XX:G1HeapRegionSize=32m -XX:MaxGCPauseMillis=1000 TestStressRSetCoarsening 42 10 300 + * @run main/othervm/timeout=300 + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC + * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintGC -XX:+PrintGCTimeStamps -Xlog:gc + * -Xmx500m -XX:G1HeapRegionSize=1m -XX:MaxGCPauseMillis=1000 TestStressRSetCoarsening 2 0 300 + * @run main/othervm/timeout=1800 + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC + * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintGC -XX:+PrintGCTimeStamps -Xlog:gc + * -Xmx1G -XX:G1HeapRegionSize=1m -XX:MaxGCPauseMillis=1000 TestStressRSetCoarsening 500 0 1800 + * @run main/othervm/timeout=1800 + * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseG1GC + * -XX:+IgnoreUnrecognizedVMOptions -XX:+PrintGC -XX:+PrintGCTimeStamps -Xlog:gc + * -Xmx1G -XX:G1HeapRegionSize=1m -XX:MaxGCPauseMillis=1000 TestStressRSetCoarsening 10 10 1800 + */ + +/** + * What the test does. + * Preparation stage: + * Fill out ~90% of the heap with objects, each object is an object array. + * If we want to allocate K objects per region, we calculate N to meet: + * sizeOf(Object[N]) ~= regionSize / K + * Stress stage: + * No more allocation, so no more GC. + * We will perform a number of iterations. On each iteration i, + * for each pair of regions Rx and Ry we will set c[i] references + * from Rx to Ry. If c[i] less than c[i-1] at the end of iteration + * concurrent mark cycle will be initiated (to recalculate remembered sets). + * As the result RSet will be growing up and down, up and down many times. + * + * The test expects: no crash and no timeouts. + * + * Test Parameters: + * args[0] - number of objects per Heap Region (1 - means humongous) + * args[1] - number of regions to refresh to provoke GC at the end of cycle. + * (0 - means no GC, i.e. no reading from RSet) + * args[2] - timeout in seconds (to stop execution to avoid jtreg timeout) + */ +public class TestStressRSetCoarsening { + + public static void main(String... args) throws InterruptedException { + if (args.length != 3) { + throw new IllegalArgumentException("Wrong number of arguments " + args.length); + } + int objectsPerRegion = Integer.parseInt(args[0]); // 1 means humongous + int regsToRefresh = Integer.parseInt(args[1]); // 0 means no regions to refresh at the end of cycle + int timeout = Integer.parseInt(args[2]); // in seconds, test should stop working eariler + new TestStressRSetCoarsening(objectsPerRegion, regsToRefresh, timeout).go(); + } + + private static final long KB = 1024; + private static final long MB = 1024 * KB; + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + + public final Object[][] storage; + + /** + * Number of objects per region. This is a test parameter. + */ + public final int K; + + /** + * Length of object array: sizeOf(Object[N]) ~= regionSize / K + * N will be calculated as function of K. + */ + public final int N; + + /** + * How many regions involved into testing. + * Will be calculated as heapFractionToAllocate * freeRegionCount. + */ + public final int regionCount; + + /** + * How much heap to use. + */ + public final float heapFractionToAllocate = 0.9f; + + /** + * How many regions to be refreshed at the end of cycle. + * This is a test parameter. + */ + public final int regsToRefresh; + + /** + * Initial time. + */ + public final long start; + + /** + * Time when the test should stop working. + */ + public final long finishAt; + + /** + * Does pre-calculation and allocate necessary objects. + * + * @param objPerRegions how many objects per G1 heap region + */ + TestStressRSetCoarsening(int objPerRegions, int regsToRefresh, int timeout) { + this.K = objPerRegions; + this.regsToRefresh = regsToRefresh; + this.start = System.currentTimeMillis(); + this.finishAt = start + timeout * 900; // 10% ahead of jtreg timeout + + long regionSize = WB.g1RegionSize(); + + // How many free regions + Runtime rt = Runtime.getRuntime(); + long used = rt.totalMemory() - rt.freeMemory(); + long totalFree = rt.maxMemory() - used; + regionCount = (int) ((totalFree / regionSize) * heapFractionToAllocate); + long toAllocate = regionCount * regionSize; + System.out.println("%% Test parameters"); + System.out.println("%% Objects per region : " + K); + System.out.println("%% Heap fraction to allocate : " + (int) (heapFractionToAllocate * 100) + "%"); + System.out.println("%% Regions to refresh to provoke GC: " + regsToRefresh); + + System.out.println("%% Memory"); + System.out.println("%% used : " + used / MB + "M"); + System.out.println("%% available : " + totalFree / MB + "M"); + System.out.println("%% to allocate : " + toAllocate / MB + "M"); + System.out.println("%% (in regs) : " + regionCount); + System.out.println("%% G1 Region Size: " + regionSize / MB + "M"); + + int refSize = WB.getHeapOopSize(); + + // Calculate N: K*sizeOf(Object[N]) ~= regionSize + // sizeOf(Object[N]) ~= (N+4)*refSize + // ==> + // N = regionSize / K / refSize - 4; + N = (int) ((regionSize / K) / refSize) - 5; + + /* + * -------------- + * region0 storage[0] = new Object[N] + * ... + * storage[K-1] = new Object[N] + * --------------- + * region1 storage[K] = new Object[N] + * ... + * storage[2*K - 1] = new Object[N] + * -------------- + * ... + * -------------- + * regionX storage[X*K] = new Object[N] + * ... + * storage[(X+1)*K -1] = new Object[N] + * where X = HeapFraction * TotalRegions + * ------------- + */ + System.out.println("%% Objects"); + System.out.println("%% N (array length) : " + N); + System.out.println("%% K (objects in regions): " + K); + System.out.println("%% Reference size : " + refSize); + System.out.println("%% Approximate obj size : " + (N + 2) * refSize / KB + "K)"); + + storage = new Object[regionCount * K][]; + for (int i = 0; i < storage.length; i++) { + storage[i] = new Object[N]; + } + } + + public void go() throws InterruptedException { + // threshold for sparce -> fine + final int FINE = WB.getIntxVMFlag("G1RSetSparseRegionEntries").intValue(); + + // threshold for fine -> coarse + final int COARSE = WB.getIntxVMFlag("G1RSetRegionEntries").intValue(); + + // regToRegRefCounts - array of reference counts from region to region + // at the the end of iteration. + // The number of test iterations is array length - 1. + // If c[i] > c[i-1] then during the iteration i more references will + // be created. + // If c[i] < c[i-1] then some referenes will be cleaned. + int[] regToRegRefCounts = {0, FINE / 2, 0, FINE, (FINE + COARSE) / 2, 0, + COARSE, COARSE + 10, FINE + 1, FINE / 2, 0}; + + // For progress tracking + int[] progress = new int[regToRegRefCounts.length]; + progress[0] = 0; + for (int i = 1; i < regToRegRefCounts.length; i++) { + progress[i] = progress[i - 1] + Math.abs(regToRegRefCounts[i] - regToRegRefCounts[i - 1]); + } + try { + for (int i = 1; i < regToRegRefCounts.length; i++) { + int pre = regToRegRefCounts[i - 1]; + int cur = regToRegRefCounts[i]; + float prog = ((float) progress[i - 1] / progress[progress.length - 1]); + + System.out.println("%% step " + i + + " out of " + (regToRegRefCounts.length - 1) + + " (~" + (int) (100 * prog) + "% done)"); + System.out.println("%% " + pre + " --> " + cur); + for (int to = 0; to < regionCount; to++) { + // Select a celebrity object that we will install references to. + // The celebrity will be referred from all other regions. + // If the number of references after should be less than they + // were before, select NULL. + Object celebrity = cur > pre ? storage[to * K] : null; + for (int from = 0; from < regionCount; from++) { + if (to == from) { + continue; // no need to refer to itself + } + + int step = cur > pre ? +1 : -1; + for (int rn = pre; rn != cur; rn += step) { + storage[getY(to, from, rn)][getX(to, from, rn)] = celebrity; + if (System.currentTimeMillis() > finishAt) { + throw new TimeoutException(); + } + } + } + } + if (pre > cur) { + // Number of references went down. + // Need to provoke recalculation of RSet. + WB.g1StartConcMarkCycle(); + while (WB.g1InConcurrentMark()) { + Thread.sleep(1); + } + } + + // To force the use of rememebered set entries we need to provoke a GC. + // To induce some fragmentation, and some mixed GCs, we need + // to make a few objects unreachable. + for (int toClean = i * regsToRefresh; toClean < (i + 1) * regsToRefresh; toClean++) { + int to = toClean % regionCount; + // Need to remove all references from all regions to the region 'to' + for (int from = 0; from < regionCount; from++) { + if (to == from) { + continue; // no need to refer to itself + } + for (int rn = 0; rn <= cur; rn++) { + storage[getY(to, from, rn)][getX(to, from, rn)] = null; + } + } + // 'Refresh' storage elements for the region 'to' + // After that loop all 'old' objects in the region 'to' + // should become unreachable. + for (int k = 0; k < K; k++) { + storage[(to * K + k) % storage.length] = new Object[N]; + } + } + } + } catch (TimeoutException e) { + System.out.println("%% TIMEOUT!!!"); + } + long now = System.currentTimeMillis(); + System.out.println("%% Summary"); + System.out.println("%% Time spent : " + ((now - start) / 1000) + " seconds"); + System.out.println("%% Free memory left : " + Runtime.getRuntime().freeMemory() / KB + "K"); + System.out.println("%% Test passed"); + } + + /** + * Returns X index in the Storage of the reference #rn from the region + * 'from' to the region 'to'. + * + * @param to region # to refer to + * @param from region # to refer from + * @param rn number of reference + * + * @return X index in the range: [0 ... N-1] + */ + private int getX(int to, int from, int rn) { + return (rn * regionCount + to) % N; + } + + /** + * Returns Y index in the Storage of the reference #rn from the region + * 'from' to the region 'to'. + * + * @param to region # to refer to + * @param from region # to refer from + * @param rn number of reference + * + * @return Y index in the range: [0 ... K*regionCount -1] + */ + private int getY(int to, int from, int rn) { + return ((rn * regionCount + to) / N + from * K) % (regionCount * K); + } +} + diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 75132348c9c..fd1852485e0 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -346,3 +346,4 @@ d45bcd374f6057851e3c2dcd45607cd362afadfa jdk-9+100 d3e834ff74e724a2b92a558e18e8cbf81c6dbc59 jdk-9+101 9dcf193c0b6cf22c0e89e2dc705a2c0f520ae064 jdk-9+102 bdbf2342b21bd8ecad1b4e6499a0dfb314952bd7 jdk-9+103 +58448465334e1d8bf1cfc09052783937b1cc21c0 jdk-9+104 diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java index 0701bb124e8..d11c50bb904 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java @@ -26,6 +26,8 @@ package com.sun.org.apache.xalan.internal.utils; import com.sun.org.apache.xalan.internal.XalanConstants; +import java.util.concurrent.CopyOnWriteArrayList; +import org.xml.sax.SAXException; /** @@ -415,6 +417,23 @@ public final class XMLSecurityManager { } + // Array list to store printed warnings for each SAX parser used + private static final CopyOnWriteArrayList printedWarnings = new CopyOnWriteArrayList<>(); + + /** + * Prints out warnings if a parser does not support the specified feature/property. + * + * @param parserClassName the name of the parser class + * @param propertyName the property name + * @param exception the exception thrown by the parser + */ + public static void printWarning(String parserClassName, String propertyName, SAXException exception) { + String key = parserClassName+":"+propertyName; + if (printedWarnings.addIfAbsent(key)) { + System.err.println( "Warning: "+parserClassName+": "+exception.getMessage()); + } + } + /** * Read from system properties, or those in jaxp.properties * diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java index 4845a190adb..413125827e6 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java @@ -489,18 +489,20 @@ public class Parser implements Constants, ContentHandler { } final XMLReader reader = parser.getXMLReader(); + String lastProperty = ""; try { XMLSecurityManager securityManager = (XMLSecurityManager)_xsltc.getProperty(XalanConstants.SECURITY_MANAGER); for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { - reader.setProperty(limit.apiProperty(), securityManager.getLimitValueAsString(limit)); + lastProperty = limit.apiProperty(); + reader.setProperty(lastProperty, securityManager.getLimitValueAsString(limit)); } if (securityManager.printEntityCountInfo()) { + lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO; parser.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); } } catch (SAXException se) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + se.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se); } return(parse(reader, input)); diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java index 4c6e02936c3..bd3284db258 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java @@ -29,7 +29,6 @@ import java.io.Reader; import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.stream.XMLEventReader; @@ -39,7 +38,6 @@ import javax.xml.transform.Source; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource; -import javax.xml.transform.stax.StAXResult; import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; @@ -111,8 +109,8 @@ public final class Util { reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, xsltc.isSecureProcessing()); } catch (SAXNotRecognizedException e) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + e.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), + XMLConstants.FEATURE_SECURE_PROCESSING, e); } } catch (Exception e ) { try { @@ -149,25 +147,27 @@ public final class Util { reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD)); } catch (SAXNotRecognizedException e) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + e.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), + XMLConstants.ACCESS_EXTERNAL_DTD, e); } + String lastProperty = ""; try { XMLSecurityManager securityManager = (XMLSecurityManager)xsltc.getProperty(XalanConstants.SECURITY_MANAGER); if (securityManager != null) { for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { - reader.setProperty(limit.apiProperty(), + lastProperty = limit.apiProperty(); + reader.setProperty(lastProperty, securityManager.getLimitValueAsString(limit)); } if (securityManager.printEntityCountInfo()) { + lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO; reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); } } } catch (SAXException se) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + se.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se); } xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java index 5d64d975e1c..852a09fb87f 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java @@ -2249,8 +2249,8 @@ public class XSDHandler { try { parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, fAccessExternalDTD); } catch (SAXNotRecognizedException exc) { - System.err.println("Warning: " + parser.getClass().getName() + ": " + - exc.getMessage()); + XMLSecurityManager.printWarning(parser.getClass().getName(), + XMLConstants.ACCESS_EXTERNAL_DTD, exc); } } // If XML names and Namespace URIs are already internalized we diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java index 1b6dd4053c1..4dca2c5d10d 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java @@ -697,8 +697,8 @@ final class ValidatorHandlerImpl extends ValidatorHandler implements reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD)); } catch (SAXException exc) { - System.err.println("Warning: " + reader.getClass().getName() + ": " + - exc.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), + XMLConstants.ACCESS_EXTERNAL_DTD, exc); } } } catch( Exception e ) { diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java index 7ae6df98fab..0673db9df29 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java @@ -27,6 +27,8 @@ package com.sun.org.apache.xerces.internal.utils; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.util.SecurityManager; +import java.util.concurrent.CopyOnWriteArrayList; +import org.xml.sax.SAXException; /** * This class manages standard and implementation-specific limitations. @@ -496,6 +498,23 @@ public final class XMLSecurityManager { } + // Array list to store printed warnings for each SAX parser used + private static final CopyOnWriteArrayList printedWarnings = new CopyOnWriteArrayList<>(); + + /** + * Prints out warnings if a parser does not support the specified feature/property. + * + * @param parserClassName the name of the parser class + * @param propertyName the property name + * @param exception the exception thrown by the parser + */ + public static void printWarning(String parserClassName, String propertyName, SAXException exception) { + String key = parserClassName+":"+propertyName; + if (printedWarnings.addIfAbsent(key)) { + System.err.println( "Warning: "+parserClassName+": "+exception.getMessage()); + } + } + /** * Read from system properties, or those in jaxp.properties * diff --git a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java index a9c9aab1d50..09cd04c3fd9 100644 --- a/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java +++ b/jaxp/src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java @@ -128,8 +128,8 @@ public class XMLReaderManager { try { reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _secureProcessing); } catch (SAXNotRecognizedException e) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + e.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), + XMLConstants.FEATURE_SECURE_PROCESSING, e); } } catch (Exception e) { try { @@ -172,23 +172,25 @@ public class XMLReaderManager { //reader is cached, but this property might have been reset reader.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); } catch (SAXException se) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + se.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), + XMLConstants.ACCESS_EXTERNAL_DTD, se); } + String lastProperty = ""; try { if (_xmlSecurityManager != null) { for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { - reader.setProperty(limit.apiProperty(), + lastProperty = limit.apiProperty(); + reader.setProperty(lastProperty, _xmlSecurityManager.getLimitValueAsString(limit)); } if (_xmlSecurityManager.printEntityCountInfo()) { + lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO; reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); } } } catch (SAXException se) { - System.err.println("Warning: " + reader.getClass().getName() + ": " - + se.getMessage()); + XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se); } return reader; diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/TestSAXDriver.java b/jaxp/test/javax/xml/jaxp/unittest/common/TestSAXDriver.java new file mode 100644 index 00000000000..033bbdefd6e --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/common/TestSAXDriver.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package common; + +import com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl; +import javax.xml.XMLConstants; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; + +/* + * Test implementation of SAXParser. It is extended from JDK parser and two methods + * are overriden to disable support of specific features and properties. + * This class is used in ValidationWarningsTest and TransformationWarningsTest + * to generate multiple warnings during xml validation and transformation processes. +*/ +public class TestSAXDriver extends SAXParserImpl.JAXPSAXParser { + + @Override + public synchronized void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { + if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(name)) { + throw new SAXNotRecognizedException(name+" feature is not recognised by test SAX parser intentionally."); + } else { + super.setFeature(name, value); + } + } + + @Override + public synchronized void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + if (XMLConstants.ACCESS_EXTERNAL_DTD.equals(name) || ENT_EXP_LIMIT_PROP.equals(name)) { + throw new SAXNotRecognizedException(name+" property is not recognised by test SAX parser intentionally."); + } else { + super.setProperty(name, value); + } + } + + private static final String ENT_EXP_LIMIT_PROP = "http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit"; +} diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java b/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java new file mode 100644 index 00000000000..26659a0d8d6 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/common/TransformationWarningsTest.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package common; + +import java.io.StringReader; +import java.io.StringWriter; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import org.testng.annotations.Test; +import org.testng.annotations.BeforeClass; + +/* + * @test + * @modules javax.xml/com.sun.org.apache.xerces.internal.jaxp + * @bug 8144593 + * @summary Check that warnings about unsupported properties from parsers + * are suppressed during the transformation process. + */ +public class TransformationWarningsTest extends WarningsTestBase { + + @BeforeClass + public void setup() { + //Set test SAX driver implementation. + System.setProperty("org.xml.sax.driver", "common.TestSAXDriver"); + } + + @Test + public void testTransformation() throws Exception { + startTest(); + } + + //One iteration of xml transformation test case. It will be called from each + //TestWorker task defined in WarningsTestBase class. + void doOneTestIteration() throws Exception { + // Prepare output stream + StringWriter xmlResultString = new StringWriter(); + StreamResult xmlResultStream = new StreamResult(xmlResultString); + // Prepare xml source stream + Source src = new StreamSource(new StringReader(xml)); + Transformer t = createTransformer(); + //Transform the xml + t.transform(src, xmlResultStream); + } + + //Create transformer from xsl test string + Transformer createTransformer() throws Exception { + // Prepare sources for transormation + Source xslsrc = new StreamSource(new StringReader(xsl)); + + // Create factory and transformer + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer t = tf.newTransformer(xslsrc); + + // Set URI Resolver to return the newly constructed xml + // stream source object from xml test string + t.setURIResolver((String href, String base) -> new StreamSource(new StringReader(xml))); + return t; + } + + //Xsl and Xml contents used in the transformation test + private static final String xsl = "" + + " " + + " " + + " Simple Transformation Result. No warnings should be printed to console" + + " " + + ""; + private static final String xml = ""; +} diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java b/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java new file mode 100644 index 00000000000..85cbb342736 --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/common/ValidationWarningsTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package common; + +import java.io.ByteArrayInputStream; +import java.io.StringReader; +import javax.xml.XMLConstants; +import javax.xml.transform.Source; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.Validator; +import org.testng.annotations.Test; +import org.testng.annotations.BeforeClass; +import org.xml.sax.InputSource; + +/* + * @test + * @modules javax.xml/com.sun.org.apache.xerces.internal.jaxp + * @bug 8144593 + * @summary Check that warnings about unsupported properties from SAX + * parsers are suppressed during the xml validation process. + */ +public class ValidationWarningsTest extends WarningsTestBase { + + @BeforeClass + public void setup() { + //Set test SAX driver implementation. + System.setProperty("org.xml.sax.driver", "common.TestSAXDriver"); + } + + @Test + public void testValidation() throws Exception { + startTest(); + } + + //One iteration of xml validation test case. It will be called from each + //TestWorker task defined in WarningsTestBase class. + void doOneTestIteration() throws Exception { + Source src = new StreamSource(new StringReader(xml)); + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + SAXSource xsdSource = new SAXSource(new InputSource(new ByteArrayInputStream(xsd.getBytes()))); + Schema schema = schemaFactory.newSchema(xsdSource); + Validator v = schema.newValidator(); + v.validate(src); + } + + //Xsd and Xml contents used in the validation test + private static final String xsd = "" + + " " + + " \n" + + " "; + private static final String xml = "Element"; + +} diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java b/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java new file mode 100644 index 00000000000..9a7ce2d8f7b --- /dev/null +++ b/jaxp/test/javax/xml/jaxp/unittest/common/WarningsTestBase.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package common; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.xml.XMLConstants; +import org.testng.Assert; + +/* + * This class helps to test suppression of unsupported parser properties + * messages printed to standard error output. + * It launches THREADS_COUNT tasks. Each task does ITERATIONS_PER_THREAD + * sequential calls to doOneIteration method implemented by specific test class. + */ +public abstract class WarningsTestBase { + + /* + * Abstract method that should be implemented by test class. + * It is repeatedly called by each TestWorker task. + */ + abstract void doOneTestIteration() throws Exception; + + /* + * Launches parallel test tasks and check the output for the number of + * generated warning messages. There should be no more than one message of + * each type. + */ + void startTest() throws Exception { + //Save standard error stream + PrintStream defStdErr = System.err; + //Set new byte array stream as standard error stream + ByteArrayOutputStream byteStream = new ByteArrayOutputStream(5000); + System.setErr(new PrintStream(byteStream)); + //Execute multiple TestWorker tasks + for (int id = 0; id < THREADS_COUNT; id++) { + EXECUTOR.execute(new TestWorker(id)); + } + //Initiate shutdown of previously submitted task + EXECUTOR.shutdown(); + //Wait for termination of submitted tasks + if (!EXECUTOR.awaitTermination(THREADS_COUNT, TimeUnit.SECONDS)) { + //If not all tasks terminates during the time out force them to shutdown + EXECUTOR.shutdownNow(); + } + //Restore default standard error stream + System.setErr(defStdErr); + //Print tasks stderr output + String errContent = byteStream.toString(); + System.out.println("Standard error output content:"); + System.out.println(errContent); + //Check tasks stderr output for quatity of warning messages + Assert.assertTrue(warningPrintedOnce(XMLConstants.ACCESS_EXTERNAL_DTD, errContent)); + Assert.assertTrue(warningPrintedOnce(ENT_EXP_PROPERTY, errContent)); + Assert.assertTrue(warningPrintedOnce(XMLConstants.FEATURE_SECURE_PROCESSING, errContent)); + } + + // Count occurences of warning messages in standard error and check if warning is printed + // not more than once + private boolean warningPrintedOnce(String propertyName, String testOutput) { + //Count for property name in test output + Pattern p = Pattern.compile(propertyName); + Matcher m = p.matcher(testOutput); + int count = 0; + while (m.find()) { + count += 1; + } + System.out.println("'" + propertyName + "' print count: " + count); + //If count is more than 1 then consider test failed + return count <= 1; + } + + //TestWorker task that sequentially calls test method + private class TestWorker implements Runnable { + // Task id + private final int id; + + TestWorker(int id) { + this.id = id; + } + + @Override + public void run() { + try { + System.out.printf("%d: waiting for barrier%n", id); + //Synchronize startup of all tasks + BARRIER.await(); + System.out.printf("%d: starting iterations%n", id); + //Call test method multiple times + for (int i = 0; i < ITERATIONS_PER_THREAD; i++) { + doOneTestIteration(); + } + } catch (Exception ex) { + throw new RuntimeException("TestWorker id:" + id + " failed", ex); + } + } + } + + //Entity expansion limit property name + private static final String ENT_EXP_PROPERTY = "http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit"; + //Number of simultaneous test threads + private static final int THREADS_COUNT = 10; + //Number of iterations per one thread + private static final int ITERATIONS_PER_THREAD = 4; + //Test thread pool + private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool(); + //Cyclic barrier for threads startup synchronisation + private static final CyclicBarrier BARRIER = new CyclicBarrier(THREADS_COUNT); +} diff --git a/jaxws/.hgtags b/jaxws/.hgtags index 9909ccb59aa..6cb1535db51 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -349,3 +349,4 @@ d0a97e57d2336238edf6a4cd60aafe67deb7258d jdk-9+100 3e99318616da903e0dc8f07f9f9203dc1bd49921 jdk-9+101 0868b93587cc99df3a4f4d3817a1aa756bea60ab jdk-9+102 eb5e005a17e50d7d8340daaf21a5c3c5ae358d68 jdk-9+103 +0f557aa096e2a5c9733d406d8cf0c2e6b1f8ca60 jdk-9+104 diff --git a/jdk/.hgtags b/jdk/.hgtags index a0ad6c5e122..99f6d153fb3 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -346,3 +346,4 @@ e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99 5e8370fb3ed925335164afe340d1e54beab2d4d5 jdk-9+101 6eb3c8132e489dab81adde4ce29844904ce15482 jdk-9+102 eee1ced1d8e78293f2a004af818ca474387dbebf jdk-9+103 +8faf1aec77a9517c69d2f4d8dd146429852ace7f jdk-9+104 diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index abd7edc0021..ad58edb2823 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -235,6 +235,13 @@ ifeq ($(OPENJDK_TARGET_OS), linux) LIBAWT_MAPFILE := endif +# Turn off all warnings for debug_mem.c This is needed because the specific warning +# about initializing a declared 'extern' cannot be turned off individually. Only +# applies to debug builds. +ifeq ($(TOOLCHAIN_TYPE), gcc) + BUILD_LIBAWT_debug_mem.c_CFLAGS := -w +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ LIBRARY := awt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -248,7 +255,6 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \ DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \ DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \ - WARNINGS_AS_ERRORS_gcc := false, \ ASFLAGS := $(LIBAWT_ASFLAGS), \ MAPFILE := $(LIBAWT_MAPFILE), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -343,6 +349,19 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) LIBAWT_XAWT_LIBS += -lpthread endif + ifeq ($(TOOLCHAIN_TYPE), gcc) + # Turn off all warnings for the following files since they contain warnings + # that cannot be turned of individually. + # redefining a macro + BUILD_LIBAWT_XAWT_gtk2_interface.c_CFLAGS := -w + # comparison between pointer and integer + BUILD_LIBAWT_XAWT_awt_Font.c_CFLAGS := -w + # initializing a declared 'extern' + BUILD_LIBAWT_XAWT_debug_mem.c_CFLAGS := -w + # decimal constant is unsigned only in ISO C90 (JAVASE_EMBEDDED) + BUILD_LIBAWT_XAWT_XToolkit.c_CFLAGS := -w + endif + $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \ LIBRARY := awt_xawt, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ @@ -356,7 +375,6 @@ ifeq ($(findstring $(OPENJDK_TARGET_OS),windows macosx),) format-security int-to-pointer-cast parentheses, \ DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \ E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \ - WARNINGS_AS_ERRORS_gcc := false, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN) \ @@ -658,8 +676,11 @@ endif LIBFONTMANAGER_CFLAGS += $(FONT_HEADERS) $(X_CFLAGS) -DLE_STANDALONE -DHEADLESS -# Turn off aliasing with GCC for ExtensionSubtables.cpp -ifeq ($(OPENJDK_TARGET_OS), linux) +ifeq ($(TOOLCHAIN_TYPE), gcc) + # Turn off all warnings for sunFont.c. This is needed because the specific warning + # about discarding 'const' qualifier cannot be turned off individually. + BUILD_LIBFONTMANAGER_sunFont.c_CFLAGS := -w + # Turn off aliasing with GCC for ExtensionSubtables.cpp BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing endif @@ -674,14 +695,20 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBFONTMANAGER_CFLAGS), \ OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \ CFLAGS_windows = -DCC_NOEX, \ - DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast reorder \ - delete-non-virtual-dtor type-limits missing-field-initializers, \ + DISABLED_WARNINGS_gcc := sign-compare int-to-pointer-cast \ + type-limits missing-field-initializers, \ + DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ + maybe-uninitialized, \ DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ tautological-constant-out-of-range-compare int-to-pointer-cast, \ - DISABLED_WARNINGS_solstudio := truncwarn, \ + DISABLED_WARNINGS_C_solstudio = \ + E_INTEGER_OVERFLOW_DETECTED \ + E_ARG_INCOMPATIBLE_WITH_ARG_L \ + E_ENUM_VAL_OVERFLOWS_INT_MAX, \ + DISABLED_WARNINGS_CXX_solstudio := \ + truncwarn wvarhidenmem wvarhidemem wbadlkginit identexpected \ + hidevf w_novirtualdescr arrowrtn2, \ DISABLED_WARNINGS_microsoft := 4267 4244 4018 4090 4996 4146 4334, \ - WARNINGS_AS_ERRORS_gcc := false, \ - WARNINGS_AS_ERRORS_solstudio := false, \ MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk index 5cbeb4b03f7..ea7c7f3c991 100644 --- a/jdk/make/lib/CoreLibraries.gmk +++ b/jdk/make/lib/CoreLibraries.gmk @@ -247,6 +247,13 @@ ifeq ($(OPENJDK_TARGET_OS), aix) LIBJIMAGE_TOOLCHAIN := TOOLCHAIN_LINK_CXX endif # OPENJDK_TARGET_OS aix +JIMAGELIB_CPPFLAGS := \ + -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ + -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ + -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \ + -I$(SUPPORT_OUTPUTDIR)/headers/java.base \ + # + $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \ LIBRARY := jimage, \ TOOLCHAIN := $(LIBJIMAGE_TOOLCHAIN), \ @@ -255,12 +262,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJIMAGE, \ SRC := $(JDK_TOPDIR)/src/java.base/share/native/libjimage \ $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjimage, \ EXCLUDES := $(LIBJIMAGE_EXCLUDES), \ - CFLAGS := $(CFLAGS_JDKLIB) \ - $(JIMAGELIB_CPPFLAGS) \ - -I$(JDK_TOPDIR)/src/java.base/share/native/libjava \ - -I$(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \ - -I$(JDK_TOPDIR)/src/java.base/share/native/libjimage \ - -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ + CFLAGS := $(CFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ + CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JIMAGELIB_CPPFLAGS), \ CFLAGS_unix := -UDEBUG, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjimage/mapfile-vers, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers index 3ec9f530b2d..faf1cc130fe 100644 --- a/jdk/make/mapfiles/libjava/mapfile-vers +++ b/jdk/make/mapfiles/libjava/mapfile-vers @@ -250,6 +250,7 @@ SUNWprivate_1.1 { Java_sun_misc_Signal_raise0; Java_sun_reflect_ConstantPool_getClassAt0; Java_sun_reflect_ConstantPool_getClassAtIfLoaded0; + Java_sun_reflect_ConstantPool_getClassRefIndexAt0; Java_sun_reflect_ConstantPool_getDoubleAt0; Java_sun_reflect_ConstantPool_getFieldAt0; Java_sun_reflect_ConstantPool_getFieldAtIfLoaded0; @@ -259,8 +260,11 @@ SUNWprivate_1.1 { Java_sun_reflect_ConstantPool_getMemberRefInfoAt0; Java_sun_reflect_ConstantPool_getMethodAt0; Java_sun_reflect_ConstantPool_getMethodAtIfLoaded0; + Java_sun_reflect_ConstantPool_getNameAndTypeRefIndexAt0; + Java_sun_reflect_ConstantPool_getNameAndTypeRefInfoAt0; Java_sun_reflect_ConstantPool_getSize0; Java_sun_reflect_ConstantPool_getStringAt0; + Java_sun_reflect_ConstantPool_getTagAt0; Java_sun_reflect_ConstantPool_getUTF8At0; Java_java_io_Console_istty; Java_java_io_Console_encoding; diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java index 21acfccded0..4556e0242ef 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/AESCrypt.java @@ -351,8 +351,8 @@ final class AESCrypt extends SymmetricCipher implements AESConstants */ void encryptBlock(byte[] in, int inOffset, byte[] out, int outOffset) { - cryptBlockCheck(in, inOffset); - cryptBlockCheck(out, outOffset); + Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length); + Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length); implEncryptBlock(in, inOffset, out, outOffset); } @@ -430,8 +430,8 @@ final class AESCrypt extends SymmetricCipher implements AESConstants */ void decryptBlock(byte[] in, int inOffset, byte[] out, int outOffset) { - cryptBlockCheck(in, inOffset); - cryptBlockCheck(out, outOffset); + Objects.checkFromIndexSize(inOffset, AES_BLOCK_SIZE, in.length); + Objects.checkFromIndexSize(outOffset, AES_BLOCK_SIZE, out.length); implDecryptBlock(in, inOffset, out, outOffset); } @@ -593,26 +593,6 @@ final class AESCrypt extends SymmetricCipher implements AESConstants out[outOffset ] = (byte)(Si[(a0 ) & 0xFF] ^ (t1 )); } - // Used to perform all checks required by the Java semantics - // (i.e., null checks and bounds checks) on the input parameters - // to encryptBlock and to decryptBlock. - // Normally, the Java Runtime performs these checks, however, as - // encryptBlock and decryptBlock are possibly replaced with - // compiler intrinsics, the JDK performs the required checks instead. - // Does not check accesses to class-internal (private) arrays. - private static void cryptBlockCheck(byte[] array, int offset) { - Objects.requireNonNull(array); - - if (offset < 0 || offset >= array.length) { - throw new ArrayIndexOutOfBoundsException(offset); - } - - int largestIndex = offset + AES_BLOCK_SIZE - 1; - if (largestIndex < 0 || largestIndex >= array.length) { - throw new ArrayIndexOutOfBoundsException(largestIndex); - } - } - /** * Expand a user-supplied key material into a session key. * diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java index 684be4f0d76..da6c10a7956 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java @@ -173,9 +173,9 @@ final class CounterMode extends FeedbackCipher { */ private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) { - cryptBlockCheck(in, inOff, len); - cryptBlockCheck(out, outOff, len); - return implCrypt(in, inOff, len, out, outOff); + Objects.checkFromIndexSize(inOff, len, in.length); + Objects.checkFromIndexSize(outOff, len, out.length); + return implCrypt(in, inOff, len, out, outOff); } // Implementation of crpyt() method. Possibly replaced with a compiler intrinsic. @@ -193,22 +193,4 @@ final class CounterMode extends FeedbackCipher { return result; } - // Used to perform all checks required by the Java semantics - // (i.e., null checks and bounds checks) on the input parameters to crypt(). - // Normally, the Java Runtime performs these checks, however, as crypt() is - // possibly replaced with compiler intrinsic, the JDK performs the - // required checks instead. - // Does not check accesses to class-internal (private) arrays. - private static void cryptBlockCheck(byte[] array, int offset, int len) { - Objects.requireNonNull(array); - - if (offset < 0 || len < 0 || offset >= array.length) { - throw new ArrayIndexOutOfBoundsException(offset); - } - - int largestIndex = offset + len - 1; - if (largestIndex < 0 || largestIndex >= array.length) { - throw new ArrayIndexOutOfBoundsException(largestIndex); - } - } } diff --git a/jdk/src/java.base/share/classes/java/lang/Long.java b/jdk/src/java.base/share/classes/java/lang/Long.java index 48019cd31b3..ae93a7ca827 100644 --- a/jdk/src/java.base/share/classes/java/lang/Long.java +++ b/jdk/src/java.base/share/classes/java/lang/Long.java @@ -401,18 +401,6 @@ public final class Long extends Number implements Comparable { * @param offset the offset in the destination buffer to start at * @param len the number of characters to write */ - static void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) { - // assert shift > 0 && shift <=5 : "Illegal shift value"; - // assert offset >= 0 && offset < buf.length : "illegal offset"; - // assert len > 0 && (offset + len) <= buf.length : "illegal length"; - int charPos = offset + len; - int radix = 1 << shift; - int mask = radix - 1; - do { - buf[--charPos] = Integer.digits[((int) val) & mask]; - val >>>= shift; - } while (charPos > offset); - } /** byte[]/LATIN1 version */ static void formatUnsignedLong0(long val, int shift, byte[] buf, int offset, int len) { @@ -436,6 +424,39 @@ public final class Long extends Number implements Comparable { } while (charPos > offset); } + static String fastUUID(long lsb, long msb) { + if (COMPACT_STRINGS) { + byte[] buf = new byte[36]; + formatUnsignedLong0(lsb, 4, buf, 24, 12); + formatUnsignedLong0(lsb >>> 48, 4, buf, 19, 4); + formatUnsignedLong0(msb, 4, buf, 14, 4); + formatUnsignedLong0(msb >>> 16, 4, buf, 9, 4); + formatUnsignedLong0(msb >>> 32, 4, buf, 0, 8); + + buf[23] = '-'; + buf[18] = '-'; + buf[13] = '-'; + buf[8] = '-'; + + return new String(buf, LATIN1); + } else { + byte[] buf = new byte[72]; + + formatUnsignedLong0UTF16(lsb, 4, buf, 24, 12); + formatUnsignedLong0UTF16(lsb >>> 48, 4, buf, 19, 4); + formatUnsignedLong0UTF16(msb, 4, buf, 14, 4); + formatUnsignedLong0UTF16(msb >>> 16, 4, buf, 9, 4); + formatUnsignedLong0UTF16(msb >>> 32, 4, buf, 0, 8); + + StringUTF16.putChar(buf, 23, '-'); + StringUTF16.putChar(buf, 18, '-'); + StringUTF16.putChar(buf, 13, '-'); + StringUTF16.putChar(buf, 8, '-'); + + return new String(buf, UTF16); + } + } + /** * Returns a {@code String} object representing the specified * {@code long}. The argument is converted to signed decimal diff --git a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java index d9517e5226f..1504e6ff37d 100644 --- a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java +++ b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java @@ -342,4 +342,12 @@ final class StringConcatHelper { return new String(buf, coder); } + /** + * Provides the initial coder for the String. + * @return initial coder + */ + static byte initialCoder() { + return String.COMPACT_STRINGS ? String.LATIN1 : String.UTF16; + } + } diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java index 16b1e6b57e3..1919264ce52 100644 --- a/jdk/src/java.base/share/classes/java/lang/System.java +++ b/jdk/src/java.base/share/classes/java/lang/System.java @@ -1911,11 +1911,8 @@ public final class System { public void invokeFinalize(Object o) throws Throwable { o.finalize(); } - public void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) { - Long.formatUnsignedLong(val, shift, buf, offset, len); - } - public void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) { - Integer.formatUnsignedInt(val, shift, buf, offset, len); + public String fastUUID(long lsb, long msb) { + return Long.fastUUID(lsb, msb); } }); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index f00be9c067e..e9bb8046246 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -30,7 +30,7 @@ import java.lang.reflect.Field; import static java.lang.invoke.MethodHandleNatives.Constants.*; import static java.lang.invoke.MethodHandleStatics.*; import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; /** * The JVM interface for the method handles package is all here. diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 4925829a985..45908f1ea23 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -1043,7 +1043,8 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method * @param specialCaller the proposed calling class to perform the {@code invokespecial} * @return the desired method handle * @throws NoSuchMethodException if the method does not exist - * @throws IllegalAccessException if access checking fails + * @throws IllegalAccessException if access checking fails, + * or if the method is {@code static}, * or if the method's variable arity modifier bit * is set and {@code asVarargsCollector} fails * @exception SecurityException if a security manager is present and it @@ -1275,7 +1276,8 @@ return mh1; * @param m the reflected method * @param specialCaller the class nominally calling the method * @return a method handle which can invoke the reflected method - * @throws IllegalAccessException if access checking fails + * @throws IllegalAccessException if access checking fails, + * or if the method is {@code static}, * or if the method's variable arity modifier bit * is set and {@code asVarargsCollector} fails * @throws NullPointerException if any argument is null diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java index 016c939a285..008a4161bd5 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java @@ -30,7 +30,7 @@ import jdk.internal.org.objectweb.asm.Label; import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.org.objectweb.asm.Opcodes; import jdk.internal.vm.annotation.ForceInline; -import sun.misc.Unsafe; +import jdk.internal.misc.Unsafe; import java.lang.invoke.MethodHandles.Lookup; import java.security.AccessController; @@ -957,6 +957,22 @@ public final class StringConcatFactory { storage trimming, which defeats the purpose of exact strategies. */ + /* + The logic for this check is as follows: + + Stack before: Op: + (SB) dup, dup + (SB, SB, SB) capacity() + (int, SB, SB) swap + (SB, int, SB) toString() + (S, int, SB) length() + (int, int, SB) if_icmpeq + (SB) + + Note that it leaves the same StringBuilder on exit, like the one on enter. + */ + + mv.visitInsn(DUP); mv.visitInsn(DUP); mv.visitMethodInsn( @@ -967,7 +983,7 @@ public final class StringConcatFactory { false ); - mv.visitIntInsn(ISTORE, 0); + mv.visitInsn(SWAP); mv.visitMethodInsn( INVOKEVIRTUAL, @@ -977,8 +993,6 @@ public final class StringConcatFactory { false ); - mv.visitInsn(DUP); - mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/String", @@ -987,8 +1001,6 @@ public final class StringConcatFactory { false ); - mv.visitIntInsn(ILOAD, 0); - Label l0 = new Label(); mv.visitJumpInsn(IF_ICMPEQ, l0); @@ -1003,16 +1015,16 @@ public final class StringConcatFactory { mv.visitInsn(ATHROW); mv.visitLabel(l0); - } else { - mv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/StringBuilder", - "toString", - "()Ljava/lang/String;", - false - ); } + mv.visitMethodInsn( + INVOKEVIRTUAL, + "java/lang/StringBuilder", + "toString", + "()Ljava/lang/String;", + false + ); + mv.visitInsn(ARETURN); mv.visitMaxs(-1, -1); @@ -1485,7 +1497,7 @@ public final class StringConcatFactory { // // The method handle shape after all length and coder mixers is: // (int, byte, )String = ("index", "coder", ) - byte initialCoder = 0; // initial coder + byte initialCoder = INITIAL_CODER; int initialLen = 0; // initial length, in characters for (RecipeElement el : recipe.getElements()) { switch (el.getTag()) { @@ -1618,11 +1630,14 @@ public final class StringConcatFactory { private static final ConcurrentMap, MethodHandle> LENGTH_MIXERS; private static final ConcurrentMap, MethodHandle> CODER_MIXERS; private static final Class STRING_HELPER; + private static final byte INITIAL_CODER; static { try { STRING_HELPER = Class.forName("java.lang.StringConcatHelper"); - } catch (ClassNotFoundException e) { + MethodHandle initCoder = lookupStatic(Lookup.IMPL_LOOKUP, STRING_HELPER, "initialCoder", byte.class); + INITIAL_CODER = (byte) initCoder.invoke(); + } catch (Throwable e) { throw new AssertionError(e); } diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java index 0f06a6c937f..0a6728d007e 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java @@ -26,10 +26,10 @@ package java.lang.ref; import jdk.internal.vm.annotation.DontInline; -import sun.misc.Cleaner; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.misc.JavaLangRefAccess; import jdk.internal.misc.SharedSecrets; +import jdk.internal.ref.Cleaner; /** * Abstract base class for reference objects. This class defines the diff --git a/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template index 16e495a4fba..76aa4a9c61b 100644 --- a/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template +++ b/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template @@ -28,9 +28,9 @@ package java.nio; import java.io.FileDescriptor; -import sun.misc.Cleaner; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; +import jdk.internal.ref.Cleaner; import sun.nio.ch.DirectBuffer; diff --git a/jdk/src/java.base/share/classes/java/nio/file/Files.java b/jdk/src/java.base/share/classes/java/nio/file/Files.java index 3fb7fe28c94..8f8a50434e7 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Files.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Files.java @@ -1898,7 +1898,7 @@ public final class Files { * many file systems. * *

The attribute-list component is a comma separated list of - * zero or more names of attributes to read. If the list contains the value + * one or more names of attributes to read. If the list contains the value * {@code "*"} then all attributes are read. Attributes that are not supported * are ignored and will not be present in the returned map. It is * implementation specific if all attributes are read as an atomic operation @@ -1948,7 +1948,7 @@ public final class Files { * @throws UnsupportedOperationException * if the attribute view is not available * @throws IllegalArgumentException - * if no attributes are specified or an unrecognized attributes is + * if no attributes are specified or an unrecognized attribute is * specified * @throws IOException * if an I/O error occurs diff --git a/jdk/src/java.base/share/classes/java/nio/file/Path.java b/jdk/src/java.base/share/classes/java/nio/file/Path.java index ac497c3c0cf..e7307e65640 100644 --- a/jdk/src/java.base/share/classes/java/nio/file/Path.java +++ b/jdk/src/java.base/share/classes/java/nio/file/Path.java @@ -150,7 +150,7 @@ public interface Path * #normalize normalize} method, to eliminate redundant names, for cases where * shell-like navigation is required. * - *

If this path has one or more elements, and no root component, then + *

If this path has more than one element, and no root component, then * this method is equivalent to evaluating the expression: *

      * subpath(0, getNameCount()-1);
diff --git a/jdk/src/java.base/share/classes/java/security/SecureRandom.java b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
index 543b7abd98f..d7495f4ad52 100644
--- a/jdk/src/java.base/share/classes/java/security/SecureRandom.java
+++ b/jdk/src/java.base/share/classes/java/security/SecureRandom.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -472,7 +472,7 @@ public class SecureRandom extends java.util.Random {
      * @param bytes the array to be filled in with random bytes.
      */
     @Override
-    public synchronized void nextBytes(byte[] bytes) {
+    public void nextBytes(byte[] bytes) {
         secureRandomSpi.engineNextBytes(bytes);
     }
 
diff --git a/jdk/src/java.base/share/classes/java/time/Duration.java b/jdk/src/java.base/share/classes/java/time/Duration.java
index 646d7109fd3..af7abfe4226 100644
--- a/jdk/src/java.base/share/classes/java/time/Duration.java
+++ b/jdk/src/java.base/share/classes/java/time/Duration.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -62,6 +62,7 @@
 package java.time;
 
 import static java.time.LocalTime.MINUTES_PER_HOUR;
+import static java.time.LocalTime.NANOS_PER_MILLI;
 import static java.time.LocalTime.NANOS_PER_SECOND;
 import static java.time.LocalTime.SECONDS_PER_DAY;
 import static java.time.LocalTime.SECONDS_PER_HOUR;
@@ -1214,8 +1215,16 @@ public final class Duration
      * @throws ArithmeticException if numeric overflow occurs
      */
     public long toMillis() {
-        long millis = Math.multiplyExact(seconds, 1000);
-        millis = Math.addExact(millis, nanos / 1000_000);
+        long tempSeconds = seconds;
+        long tempNanos = nanos;
+        if (tempSeconds < 0) {
+            // change the seconds and nano value to
+            // handle Long.MIN_VALUE case
+            tempSeconds = tempSeconds + 1;
+            tempNanos = tempNanos - NANOS_PER_SECOND;
+        }
+        long millis = Math.multiplyExact(tempSeconds, 1000);
+        millis = Math.addExact(millis, tempNanos / NANOS_PER_MILLI);
         return millis;
     }
 
@@ -1229,8 +1238,16 @@ public final class Duration
      * @throws ArithmeticException if numeric overflow occurs
      */
     public long toNanos() {
-        long totalNanos = Math.multiplyExact(seconds, NANOS_PER_SECOND);
-        totalNanos = Math.addExact(totalNanos, nanos);
+        long tempSeconds = seconds;
+        long tempNanos = nanos;
+        if (tempSeconds < 0) {
+            // change the seconds and nano value to
+            // handle Long.MIN_VALUE case
+            tempSeconds = tempSeconds + 1;
+            tempNanos = tempNanos - NANOS_PER_SECOND;
+        }
+        long totalNanos = Math.multiplyExact(tempSeconds, NANOS_PER_SECOND);
+        totalNanos = Math.addExact(totalNanos, tempNanos);
         return totalNanos;
     }
 
diff --git a/jdk/src/java.base/share/classes/java/time/LocalDate.java b/jdk/src/java.base/share/classes/java/time/LocalDate.java
index 3d8c034fa91..940f21f0f1e 100644
--- a/jdk/src/java.base/share/classes/java/time/LocalDate.java
+++ b/jdk/src/java.base/share/classes/java/time/LocalDate.java
@@ -100,6 +100,8 @@ import java.time.temporal.ValueRange;
 import java.time.zone.ZoneOffsetTransition;
 import java.time.zone.ZoneRules;
 import java.util.Objects;
+import java.util.stream.LongStream;
+import java.util.stream.Stream;
 
 /**
  * A date without a time-zone in the ISO-8601 calendar system,
@@ -1715,6 +1717,89 @@ public final class LocalDate
         return Period.of(Math.toIntExact(years), months, days);
     }
 
+    /**
+     * Returns a sequential ordered stream of dates. The returned stream starts from this date
+     * (inclusive) and goes to {@code endExclusive} (exclusive) by an incremental step of 1 day.
+     * 

+ * This method is equivalent to {@code datesUntil(endExclusive, Period.ofDays(1))}. + * + * @param endExclusive the end date, exclusive, not null + * @return a sequential {@code Stream} for the range of {@code LocalDate} values + * @throws IllegalArgumentException if end date is before this date + * @since 9 + */ + public Stream datesUntil(LocalDate endExclusive) { + long end = endExclusive.toEpochDay(); + long start = toEpochDay(); + if (end < start) { + throw new IllegalArgumentException(endExclusive + " < " + this); + } + return LongStream.range(start, end).mapToObj(LocalDate::ofEpochDay); + } + + /** + * Returns a sequential ordered stream of dates by given incremental step. The returned stream + * starts from this date (inclusive) and goes to {@code endExclusive} (exclusive). + *

+ * The n-th date which appears in the stream is equal to {@code this.plus(step.multipliedBy(n))} + * (but the result of step multiplication never overflows). For example, if this date is + * {@code 2015-01-31}, the end date is {@code 2015-05-01} and the step is 1 month, then the + * stream contains {@code 2015-01-31}, {@code 2015-02-28}, {@code 2015-03-31}, and + * {@code 2015-04-30}. + * + * @param endExclusive the end date, exclusive, not null + * @param step the non-zero, non-negative {@code Period} which represents the step. + * @return a sequential {@code Stream} for the range of {@code LocalDate} values + * @throws IllegalArgumentException if step is zero, or {@code step.getDays()} and + * {@code step.toTotalMonths()} have opposite sign, or end date is before this date + * and step is positive, or end date is after this date and step is negative + * @since 9 + */ + public Stream datesUntil(LocalDate endExclusive, Period step) { + if (step.isZero()) { + throw new IllegalArgumentException("step is zero"); + } + long end = endExclusive.toEpochDay(); + long start = toEpochDay(); + long until = end - start; + long months = step.toTotalMonths(); + long days = step.getDays(); + if ((months < 0 && days > 0) || (months > 0 && days < 0)) { + throw new IllegalArgumentException("period months and days are of opposite sign"); + } + if (until == 0) { + return Stream.empty(); + } + int sign = months > 0 || days > 0 ? 1 : -1; + if (sign < 0 ^ until < 0) { + throw new IllegalArgumentException(endExclusive + (sign < 0 ? " > " : " < ") + this); + } + if (months == 0) { + long steps = (until - sign) / days; // non-negative + return LongStream.rangeClosed(0, steps).mapToObj( + n -> LocalDate.ofEpochDay(start + n * days)); + } + // 48699/1600 = 365.2425/12, no overflow, non-negative result + long steps = until * 1600 / (months * 48699 + days * 1600) + 1; + long addMonths = months * steps; + long addDays = days * steps; + long maxAddMonths = months > 0 ? MAX.getProlepticMonth() - getProlepticMonth() + : getProlepticMonth() - MIN.getProlepticMonth(); + // adjust steps estimation + if (addMonths * sign > maxAddMonths + || (plusMonths(addMonths).toEpochDay() + addDays) * sign >= end * sign) { + steps--; + addMonths -= months; + addDays -= days; + if (addMonths * sign > maxAddMonths + || (plusMonths(addMonths).toEpochDay() + addDays) * sign >= end * sign) { + steps--; + } + } + return LongStream.rangeClosed(0, steps).mapToObj( + n -> this.plusMonths(months * n).plusDays(days * n)); + } + /** * Formats this date using the specified formatter. *

diff --git a/jdk/src/java.base/share/classes/java/util/UUID.java b/jdk/src/java.base/share/classes/java/util/UUID.java index a7f5f6bc63e..db9e907110b 100644 --- a/jdk/src/java.base/share/classes/java/util/UUID.java +++ b/jdk/src/java.base/share/classes/java/util/UUID.java @@ -392,17 +392,7 @@ public final class UUID implements java.io.Serializable, Comparable { * @return A string representation of this {@code UUID} */ public String toString() { - char[] chars = new char[36]; - jla.formatUnsignedLong(mostSigBits >> 32, 4, chars, 0, 8); - chars[8] = '-'; - jla.formatUnsignedLong(mostSigBits >> 16, 4, chars, 9, 4); - chars[13] = '-'; - jla.formatUnsignedLong(mostSigBits, 4, chars, 14, 4); - chars[18] = '-'; - jla.formatUnsignedLong(leastSigBits >> 48, 4, chars, 19, 4); - chars[23] = '-'; - jla.formatUnsignedLong(leastSigBits, 4, chars, 24, 12); - return jla.newStringUnsafe(chars); + return jla.fastUUID(leastSigBits, mostSigBits); } /** diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java index 44268d97fbd..1395886faa5 100644 --- a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java +++ b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java @@ -35,6 +35,9 @@ package java.util.concurrent; +import java.time.temporal.ChronoUnit; +import java.util.Objects; + /** * A {@code TimeUnit} represents time durations at a given unit of * granularity and provides utility methods to convert across units, @@ -390,4 +393,48 @@ public enum TimeUnit { } } + /** + * Converts this {@code TimeUnit} to the equivalent {@code ChronoUnit}. + * + * @return the converted equivalent ChronoUnit + * @since 9 + */ + public ChronoUnit toChronoUnit() { + switch (this) { + case NANOSECONDS: return ChronoUnit.NANOS; + case MICROSECONDS: return ChronoUnit.MICROS; + case MILLISECONDS: return ChronoUnit.MILLIS; + case SECONDS: return ChronoUnit.SECONDS; + case MINUTES: return ChronoUnit.MINUTES; + case HOURS: return ChronoUnit.HOURS; + case DAYS: return ChronoUnit.DAYS; + default: throw new AssertionError(); + } + } + + /** + * Converts a {@code ChronoUnit} to the equivalent {@code TimeUnit}. + * + * @param chronoUnit the ChronoUnit to convert + * @return the converted equivalent TimeUnit + * @throws IllegalArgumentException if {@code chronoUnit} has no + * equivalent TimeUnit + * @throws NullPointerException if {@code chronoUnit} is null + * @since 9 + */ + public static TimeUnit of(ChronoUnit chronoUnit) { + switch (Objects.requireNonNull(chronoUnit, "chronoUnit")) { + case NANOS: return TimeUnit.NANOSECONDS; + case MICROS: return TimeUnit.MICROSECONDS; + case MILLIS: return TimeUnit.MILLISECONDS; + case SECONDS: return TimeUnit.SECONDS; + case MINUTES: return TimeUnit.MINUTES; + case HOURS: return TimeUnit.HOURS; + case DAYS: return TimeUnit.DAYS; + default: + throw new IllegalArgumentException( + "No TimeUnit equivalent for " + chronoUnit); + } + } + } diff --git a/jdk/src/java.base/share/classes/java/util/stream/FindOps.java b/jdk/src/java.base/share/classes/java/util/stream/FindOps.java index 5926e79dd4d..45e1d697de0 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/FindOps.java +++ b/jdk/src/java.base/share/classes/java/util/stream/FindOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,7 +107,7 @@ final class FindOps { */ private static final class FindOp implements TerminalOp { private final StreamShape shape; - final boolean mustFindFirst; + final int opFlags; final O emptyValue; final Predicate presentPredicate; final Supplier> sinkSupplier; @@ -129,7 +129,7 @@ final class FindOps { O emptyValue, Predicate presentPredicate, Supplier> sinkSupplier) { - this.mustFindFirst = mustFindFirst; + this.opFlags = StreamOpFlag.IS_SHORT_CIRCUIT | (mustFindFirst ? 0 : StreamOpFlag.NOT_ORDERED); this.shape = shape; this.emptyValue = emptyValue; this.presentPredicate = presentPredicate; @@ -138,7 +138,7 @@ final class FindOps { @Override public int getOpFlags() { - return StreamOpFlag.IS_SHORT_CIRCUIT | (mustFindFirst ? 0 : StreamOpFlag.NOT_ORDERED); + return opFlags; } @Override @@ -156,7 +156,10 @@ final class FindOps { @Override public O evaluateParallel(PipelineHelper helper, Spliterator spliterator) { - return new FindTask<>(this, helper, spliterator).invoke(); + // This takes into account the upstream ops flags and the terminal + // op flags and therefore takes into account findFirst or findAny + boolean mustFindFirst = StreamOpFlag.ORDERED.isKnown(helper.getStreamAndOpFlags()); + return new FindTask<>(this, mustFindFirst, helper, spliterator).invoke(); } } @@ -250,16 +253,20 @@ final class FindOps { private static final class FindTask extends AbstractShortCircuitTask> { private final FindOp op; + private final boolean mustFindFirst; FindTask(FindOp op, + boolean mustFindFirst, PipelineHelper helper, Spliterator spliterator) { super(helper, spliterator); + this.mustFindFirst = mustFindFirst; this.op = op; } FindTask(FindTask parent, Spliterator spliterator) { super(parent, spliterator); + this.mustFindFirst = parent.mustFindFirst; this.op = parent.op; } @@ -283,7 +290,7 @@ final class FindOps { @Override protected O doLeaf() { O result = helper.wrapAndCopyInto(op.sinkSupplier.get(), spliterator).get(); - if (!op.mustFindFirst) { + if (!mustFindFirst) { if (result != null) shortCircuit(result); return null; @@ -300,7 +307,7 @@ final class FindOps { @Override public void onCompletion(CountedCompleter caller) { - if (op.mustFindFirst) { + if (mustFindFirst) { for (FindTask child = leftChild, p = null; child != p; p = child, child = rightChild) { O result = child.getLocalResult(); diff --git a/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java b/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java index 68a84f8512b..e771b1f00f6 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java +++ b/jdk/src/java.base/share/classes/java/util/stream/SliceOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -139,7 +139,7 @@ final class SliceOps { } else { // @@@ OOMEs will occur for LongStream.range(0, Long.MAX_VALUE).filter(i -> true).limit(n) - // regardless of the value of n + // when n * parallelismLevel is sufficiently large. // Need to adjust the target size of splitting for the // SliceTask from say (size / k) to say min(size / k, 1 << 14) // This will limit the size of the buffers created at the leaf nodes @@ -604,8 +604,15 @@ final class SliceOps { return nb.build(); } else { - Node node = helper.wrapAndCopyInto(helper.makeNodeBuilder(-1, generator), - spliterator).build(); + final Node.Builder nb = op.makeNodeBuilder(-1, generator); + if (targetOffset == 0) { // limit only + Sink opSink = op.opWrapSink(helper.getStreamAndOpFlags(), nb); + helper.copyIntoWithCancel(helper.wrapSink(opSink), spliterator); + } + else { + helper.wrapAndCopyInto(nb, spliterator); + } + Node node = nb.build(); thisNodeSize = node.count(); completed = true; spliterator = null; diff --git a/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java b/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java index 20d112d44f3..7e8d81150a8 100644 --- a/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java +++ b/jdk/src/java.base/share/classes/java/util/stream/StreamSpliterators.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,7 +186,7 @@ class StreamSpliterators { @Override public Spliterator trySplit() { - if (isParallel && !finished) { + if (isParallel && buffer == null && !finished) { init(); Spliterator split = spliterator.trySplit(); diff --git a/jdk/src/java.base/share/classes/jdk/Version.java b/jdk/src/java.base/share/classes/jdk/Version.java new file mode 100644 index 00000000000..9ce9ec9314d --- /dev/null +++ b/jdk/src/java.base/share/classes/jdk/Version.java @@ -0,0 +1,609 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 jdk; + +import java.math.BigInteger; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + +/** + * A representation of the JDK version-string which contains a version + * number optionally followed by pre-release and build information. + * + *

Version numbers

+ * + * A version number, {@code $VNUM}, is a non-empty sequence of + * non-negative integer numerals, without leading or trailing zeroes, + * separated by period characters (U+002E); i.e., it matches the regular + * expression {@code ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$}. The sequence may + * be of arbitrary length but the first three elements are assigned specific + * meanings, as follows: + * + *
+ *     $MAJOR.$MINOR.$SECURITY
+ * 
+ * + *
    + * + *
  • {@code $MAJOR} --- The major version number, + * incremented for a major release that contains significant new features as + * specified in a new edition of the Java SE Platform Specification, + * e.g., JSR 337 + * for Java SE 8. Features may be removed in a major release, given + * advance notice at least one major release ahead of time, and incompatible + * changes may be made when justified. The {@code $MAJOR} version number of + * JDK 8 was {@code 8}; the {@code $MAJOR} version number of JDK 9 + * is {@code 9}.

  • + * + *
  • {@code $MINOR} --- The minor version number, + * incremented for a minor update release that may contain compatible bug + * fixes, revisions to standard APIs mandated by a Maintenance Release of + * the relevant Platform Specification, and implementation features outside + * the scope of that Specification such as new JDK-specific APIs, additional + * service providers, new garbage collectors, and ports to new hardware + * architectures. {@code $MINOR} is reset to zero when {@code $MAJOR} is + * incremented.

  • + * + *
  • {@code $SECURITY} --- The security level, + * incremented for a security-update release that contains critical fixes + * including those necessary to improve security. {@code $SECURITY} is reset + * to zero only when {@code $MAJOR} is incremented. A higher + * value of {@code $SECURITY} for a given {@code $MAJOR} value, therefore, + * always indicates a more secure release, regardless of the value of {@code + * $MINOR}.

  • + * + *
+ * + *

The fourth and later elements of a version number are free for use by + * downstream consumers of the JDK code base. Such a consumer may, + * e.g., use the fourth element to identify patch releases which + * contain a small number of critical non-security fixes in addition to the + * security fixes in the corresponding security release.

+ * + *

The version number does not include trailing zero elements; + * i.e., {@code $SECURITY} is omitted if it has the value zero, and + * {@code $MINOR} is omitted if both {@code $MINOR} and {@code $SECURITY} have + * the value zero.

+ * + *

The sequence of numerals in a version number is compared to another + * such sequence in numerical, pointwise fashion; e.g., {@code 9.9.1} + * is less than {@code 9.10.0}. If one sequence is shorter than another then + * the missing elements of the shorter sequence are considered to be zero; + * e.g., {@code 9.1.2} is equal to {@code 9.1.2.0} but less than + * {@code 9.1.2.1}.

+ * + *

Version strings

+ * + *

A version string {@code $VSTR} consists of a version number + * {@code $VNUM}, as described above, optionally followed by pre-release and + * build information, in the format

+ * + *
+ *     $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?
+ * 
+ * + *

where:

+ * + *
    + * + *
  • {@code $PRE}, matching {@code ([a-zA-Z0-9]+)} --- + * A pre-release identifier. Typically {@code ea}, for an early-access + * release that's under active development and potentially unstable, or {@code + * internal}, for an internal developer build. + * + *

  • {@code $BUILD}, matching {@code + * (0|[1-9][0-9]*)} --- The build number, incremented for each promoted build. + * {@code $BUILD} is reset to {@code 1} when any portion of {@code $VNUM} is + * incremented.

    + * + *
  • {@code $OPT}, matching {@code ([-a-zA-Z0-9\.]+)} + * --- Additional build information, if desired. In the case of an {@code + * internal} build this will often contain the date and time of the + * build.

    + * + *
+ * + *

When comparing two version strings the value of {@code $OPT}, if + * present, may or may not be significant depending on the chosen comparison + * method. The comparison methods {@link #compareTo(Version) compareTo()} and + * {@link #compareToIgnoreOpt(Version) compareToIgnoreOpt{}} should be used + * consistently with the corresponding methods {@link #equals(Object) equals()} + * and {@link #equalsIgnoreOpt(Object) equalsIgnoreOpt()}.

+ * + *

A short version string ({@code $SVSTR}), often useful in less + * formal contexts, is simply {@code $VNUM} optionally ended with {@code + * -$PRE}.

+ * + * @since 9 + */ +public final class Version + implements Comparable +{ + private final List version; + private final Optional pre; + private final Optional build; + private final Optional optional; + + private static Version current; + + // $VNUM(-$PRE)?(\+($BUILD)?(\-$OPT)?)? + // RE limits the format of version strings + // ([1-9][0-9]*(?:(?:\.0)*\.[1-9][0-9]*)*)(?:-([a-zA-Z0-9]+))?(?:(\+)(0|[1-9][0-9]*)?)?(?:-([-a-zA-Z0-9.]+))? + + private static final String VNUM + = "(?[1-9][0-9]*(?:(?:\\.0)*\\.[1-9][0-9]*)*)"; + private static final String VNUM_GROUP = "VNUM"; + + private static final String PRE = "(?:-(?
[a-zA-Z0-9]+))?";
+    private static final String PRE_GROUP   = "PRE";
+
+    private static final String BUILD
+        = "(?:(?\\+)(?0|[1-9][0-9]*)?)?";
+    private static final String PLUS_GROUP  = "PLUS";
+    private static final String BUILD_GROUP = "BUILD";
+
+    private static final String OPT      = "(?:-(?[-a-zA-Z0-9.]+))?";
+    private static final String OPT_GROUP   = "OPT";
+
+    private static final String VSTR_FORMAT
+        = "^" + VNUM + PRE + BUILD + OPT + "$";
+    private static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT);
+
+    /**
+     * Constructs a valid JDK version string containing a
+     * version number followed by pre-release and build
+     * information.
+     *
+     * @param  s
+     *         A string to be interpreted as a version
+     *
+     * @throws  IllegalArgumentException
+     *          If the given string cannot be interpreted a valid version
+     *
+     * @throws  NullPointerException
+     *          If {@code s} is {@code null}
+     *
+     * @throws  NumberFormatException
+     *          If an element of the version number or the build number cannot
+     *          be represented as an {@link Integer}
+     */
+    private Version(String s) {
+        if (s == null)
+            throw new NullPointerException();
+
+        Matcher m = VSTR_PATTERN.matcher(s);
+        if (!m.matches())
+            throw new IllegalArgumentException("Invalid version string: '"
+                                               + s + "'");
+
+        // $VNUM is a dot-separated list of integers of arbitrary length
+        version
+            = Collections.unmodifiableList(
+                  Arrays.stream(m.group(VNUM_GROUP).split("\\."))
+                  .map(Integer::parseInt)
+                  .collect(Collectors.toList()));
+
+        pre = Optional.ofNullable(m.group(PRE_GROUP));
+
+        String b = m.group(BUILD_GROUP);
+        // $BUILD is an integer
+        build = (b == null)
+             ? Optional.empty()
+             : Optional.ofNullable(Integer.parseInt(b));
+
+        optional = Optional.ofNullable(m.group(OPT_GROUP));
+
+        // empty '+'
+        if ((m.group(PLUS_GROUP) != null) && !build.isPresent()) {
+            if (optional.isPresent()) {
+                if (pre.isPresent())
+                    throw new IllegalArgumentException("'+' found with"
+                        + " pre-release and optional components:'" + s + "'");
+            } else {
+                throw new IllegalArgumentException("'+' found with neither"
+                    + " build or optional components: '" + s + "'");
+            }
+        }
+    }
+
+    /**
+     * Parses the given string as a valid JDK version string containing a version number followed by pre-release and
+     * build information.
+     *
+     * @param  s
+     *         A string to interpret as a version
+     *
+     * @throws  IllegalArgumentException
+     *          If the given string cannot be interpreted a valid version
+     *
+     * @throws  NullPointerException
+     *          If the given string is {@code null}
+     *
+     * @throws  NumberFormatException
+     *          If an element of the version number or the build number cannot
+     *          be represented as an {@link Integer}
+     *
+     * @return  This version
+     */
+    public static Version parse(String s) {
+        return new Version(s);
+    }
+
+    /**
+     * Returns {@code System.getProperty("java.version")} as a Version.
+     *
+     * @throws  SecurityException
+     *          If a security manager exists and its {@link
+     *          SecurityManager#checkPropertyAccess(String)
+     *          checkPropertyAccess} method does not allow access to the
+     *          system property "java.version"
+     *
+     * @return  {@code System.getProperty("java.version")} as a Version
+     */
+    public static Version current() {
+        if (current == null) {
+            current = parse(AccessController.doPrivileged(
+                new PrivilegedAction<>() {
+                    public String run() {
+                        return System.getProperty("java.version");
+                    }
+                }));
+        }
+        return current;
+    }
+
+    /**
+     * Returns the major version number.
+     *
+     * @return  The major version number
+     */
+    public int major() {
+        return version.get(0);
+    }
+
+    /**
+     * Returns the minor version number or zero if it was
+     * not set.
+     *
+     * @return  The minor version number or zero if it was not set
+     */
+    public int minor() {
+        return (version.size() > 1 ? version.get(1) : 0);
+    }
+
+    /**
+     * Returns the security version number or zero if
+     * it was not set.
+     *
+     * @return  The security version number or zero if it was not set
+     */
+    public int security() {
+        return (version.size() > 2 ? version.get(2) : 0);
+    }
+
+    /**
+     * Returns an unmodifiable {@link java.util.List List} of the
+     * integer numerals contained in the version
+     * number.  The {@code List} always contains at least one
+     * element corresponding to the major version
+     * number.
+     *
+     * @return  An unmodifiable list of the integer numerals
+     *          contained in the version number
+     */
+    public List version() {
+        return version;
+    }
+
+    /**
+     * Returns the optional pre-release information.
+     *
+     * @return  The optional pre-release information as a String
+     */
+    public Optional pre() {
+        return pre;
+    }
+
+    /**
+     * Returns the build number.
+     *
+     * @return The optional build number.
+     */
+    public Optional build() {
+        return build;
+    }
+
+    /**
+     * Returns optional additional identifying build
+     * information.
+     *
+     * @return  Additional build information as a String
+     */
+    public Optional optional() {
+        return optional;
+    }
+
+    /**
+     * Compares this version to another.
+     *
+     * 

Each of the components in the version is + * compared in the follow order of precedence: version numbers, + * pre-release identifiers, build numbers, optional build information.

+ * + *

Comparison begins by examining the sequence of version numbers. If + * one sequence is shorter than another, then the missing elements of the + * shorter sequence are considered to be zero.

+ * + *

A version with a pre-release identifier is always considered to be + * less than a version without one. Pre-release identifiers are compared + * numerically when they consist only of digits, and lexicographically + * otherwise. Numeric identifiers are considered to be less than + * non-numeric identifiers.

+ * + *

A version without a build number is always less than one with a + * build number; otherwise build numbers are compared numerically.

+ * + *

The optional build information is compared lexicographically. + * During this comparison, a version with optional build information is + * considered to be greater than a version without one.

+ * + *

A version is not comparable to any other type of object. + * + * @param ob + * The object to be compared + * + * @return A negative integer, zero, or a positive integer if this + * {@code Version} is less than, equal to, or greater than the + * given {@code Version} + * + * @throws NullPointerException + * If the given object is {@code null} + */ + @Override + public int compareTo(Version ob) { + return compare(ob, false); + } + + /** + * Compares this version to another disregarding optional build + * information. + * + *

Two versions are compared by examining the version string as + * described in {@link #compareTo(Version)} with the exception that the + * optional build information is always ignored.

+ * + *

A version is not comparable to any other type of object. + * + * @param ob + * The object to be compared + * + * @return A negative integer, zero, or a positive integer if this + * {@code Version} is less than, equal to, or greater than the + * given {@code Version} + * + * @throws NullPointerException + * If the given object is {@code null} + */ + public int compareToIgnoreOpt(Version ob) { + return compare(ob, true); + } + + private int compare(Version ob, boolean ignoreOpt) { + if (ob == null) + throw new NullPointerException("Invalid argument"); + + int ret = compareVersion(ob); + if (ret != 0) + return ret; + + ret = comparePre(ob); + if (ret != 0) + return ret; + + ret = compareBuild(ob); + if (ret != 0) + return ret; + + if (!ignoreOpt) + return compareOpt(ob); + + return 0; + } + + private int compareVersion(Version ob) { + int size = version.size(); + int oSize = ob.version().size(); + int min = Math.min(size, oSize); + for (int i = 0; i < min; i++) { + Integer val = version.get(i); + Integer oVal = ob.version().get(i); + if (val != oVal) + return val - oVal; + } + if (size != oSize) + return size - oSize; + return 0; + } + + private int comparePre(Version ob) { + Optional oPre = ob.pre(); + if (!pre.isPresent()) { + if (oPre.isPresent()) + return 1; + } else { + if (!oPre.isPresent()) + return -1; + String val = pre.get(); + String oVal = oPre.get(); + if (val.matches("\\d+")) { + return (oVal.matches("\\d+") + ? (new BigInteger(val)).compareTo(new BigInteger(oVal)) + : -1); + } else { + return (oVal.matches("\\d+") + ? 1 + : val.compareTo(oVal)); + } + } + return 0; + } + + private int compareBuild(Version ob) { + Optional oBuild = ob.build(); + if (oBuild.isPresent()) { + return (build.isPresent() + ? build.get().compareTo(oBuild.get()) + : 1); + } else if (build.isPresent()) { + return -1; + } + return 0; + } + + private int compareOpt(Version ob) { + Optional oOpt = ob.optional(); + if (!optional.isPresent()) { + if (oOpt.isPresent()) + return -1; + } else { + if (!oOpt.isPresent()) + return 1; + return optional.get().compareTo(oOpt.get()); + } + return 0; + } + + /** + * Returns a string representation of this version. + * + * @return The version string + */ + @Override + public String toString() { + StringBuilder sb + = new StringBuilder(version.stream() + .map(Object::toString) + .collect(Collectors.joining("."))); + pre.ifPresent(v -> sb.append("-").append(v)); + + if (build.isPresent()) { + sb.append("+").append(build.get()); + if (optional.isPresent()) + sb.append("-").append(optional.get()); + } else { + if (optional.isPresent()) { + sb.append(pre.isPresent() ? "-" : "+-"); + sb.append(optional.get()); + } + } + + return sb.toString(); + } + + /** + * Determines whether this {@code Version} is equal to another object. + * + *

Two {@code Version}s are equal if and only if they represent the + * same version string. + * + *

This method satisfies the general contract of the {@link + * Object#equals(Object) Object.equals} method.

+ * + * @param ob + * The object to which this {@code Version} is to be compared + * + * @return {@code true} if, and only if, the given object is a {@code + * Version} that is identical to this {@code Version} + * + */ + @Override + public boolean equals(Object ob) { + boolean ret = equalsIgnoreOpt(ob); + if (!ret) + return false; + + Version that = (Version)ob; + return (this.optional().equals(that.optional())); + } + + /** + * Determines whether this {@code Version} is equal to another + * disregarding optional build information. + * + *

Two {@code Version}s are equal if and only if they represent the + * same version string disregarding the optional build information. + * + * @param ob + * The object to which this {@code Version} is to be compared + * + * @return {@code true} if, and only if, the given object is a {@code + * Version} that is identical to this {@code Version} + * ignoring the optinal build information + * + */ + public boolean equalsIgnoreOpt(Object ob) { + if (this == ob) + return true; + if (!(ob instanceof Version)) + return false; + + Version that = (Version)ob; + return (this.version().equals(that.version()) + && this.pre().equals(that.pre()) + && this.build().equals(that.build())); + } + + /** + * Returns the hash code of this version. + * + *

This method satisfies the general contract of the {@link + * Object#hashCode Object.hashCode} method. + * + * @return The hashcode of this version + */ + @Override + public int hashCode() { + int h = 1; + int p = 17; + + h = p * h + version.hashCode(); + h = p * h + pre.hashCode(); + h = p * h + build.hashCode(); + h = p * h + optional.hashCode(); + + return h; + } +} diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java index c513894a086..75ba73da5b2 100644 --- a/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java +++ b/jdk/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java @@ -124,12 +124,7 @@ public interface JavaLangAccess { void invokeFinalize(Object o) throws Throwable; /** - * Invokes Long.formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) + * Invokes Long.fastUUID */ - void formatUnsignedLong(long val, int shift, char[] buf, int offset, int len); - - /** - * Invokes Integer.formatUnsignedInt(long val, int shift, char[] buf, int offset, int len) - */ - void formatUnsignedInt(int val, int shift, char[] buf, int offset, int len); + String fastUUID(long lsb, long msb); } diff --git a/jdk/src/java.base/share/classes/sun/misc/Cleaner.java b/jdk/src/java.base/share/classes/jdk/internal/ref/Cleaner.java similarity index 95% rename from jdk/src/java.base/share/classes/sun/misc/Cleaner.java rename to jdk/src/java.base/share/classes/jdk/internal/ref/Cleaner.java index ea473a17712..84c0f618a91 100644 --- a/jdk/src/java.base/share/classes/sun/misc/Cleaner.java +++ b/jdk/src/java.base/share/classes/jdk/internal/ref/Cleaner.java @@ -23,7 +23,7 @@ * questions. */ -package sun.misc; +package jdk.internal.ref; import java.lang.ref.*; import java.security.AccessController; @@ -58,6 +58,7 @@ import java.security.PrivilegedAction; public class Cleaner extends PhantomReference + implements Runnable { // Dummy reference queue, needed because the PhantomReference constructor @@ -153,4 +154,11 @@ public class Cleaner } } + @Override public void run() { + SecurityManager security = System.getSecurityManager(); + if (security != null) + security.checkPackageAccess("jdk.internal.ref"); + this.clean(); + } + } diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java b/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java index 577ed7b16da..cba31015f0c 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/DirectBuffer.java @@ -25,7 +25,7 @@ package sun.nio.ch; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; public interface DirectBuffer { diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java b/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java index 1c4e1ca5075..671fe79efcc 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java @@ -47,7 +47,7 @@ import java.util.List; import jdk.internal.misc.JavaIOFileDescriptorAccess; import jdk.internal.misc.JavaNioAccess; import jdk.internal.misc.SharedSecrets; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; import sun.security.action.GetPropertyAction; public class FileChannelImpl diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java b/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java index 0b09fe752bf..d2c03a34fea 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/IOVecWrapper.java @@ -26,7 +26,7 @@ package sun.nio.ch; import java.nio.ByteBuffer; -import sun.misc.*; +import jdk.internal.ref.Cleaner; /** diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java index f2095540180..a580b82c4d0 100644 --- a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java +++ b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java @@ -33,7 +33,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; import jdk.internal.misc.Unsafe; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; import sun.security.action.GetPropertyAction; diff --git a/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java b/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java index 8acc0c198a1..91efac348e8 100644 --- a/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java +++ b/jdk/src/java.base/share/classes/sun/nio/fs/NativeBuffer.java @@ -26,7 +26,7 @@ package sun.nio.fs; import jdk.internal.misc.Unsafe; -import sun.misc.Cleaner; +import jdk.internal.ref.Cleaner; /** * A light-weight buffer in native memory. diff --git a/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java b/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java index 03a5c189f7c..b813519bf2c 100644 --- a/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java +++ b/jdk/src/java.base/share/classes/sun/reflect/ConstantPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -36,6 +36,10 @@ public class ConstantPool { public int getSize() { return getSize0 (constantPoolOop); } public Class getClassAt (int index) { return getClassAt0 (constantPoolOop, index); } public Class getClassAtIfLoaded (int index) { return getClassAtIfLoaded0 (constantPoolOop, index); } + // Returns a class reference index for a method or a field. + public int getClassRefIndexAt(int index) { + return getClassRefIndexAt0(constantPoolOop, index); + } // Returns either a Method or Constructor. // Static initializers are returned as Method objects. public Member getMethodAt (int index) { return getMethodAt0 (constantPoolOop, index); } @@ -45,13 +49,56 @@ public class ConstantPool { // Fetches the class name, member (field, method or interface // method) name, and type descriptor as an array of three Strings public String[] getMemberRefInfoAt (int index) { return getMemberRefInfoAt0 (constantPoolOop, index); } + // Returns a name and type reference index for a method, a field or an invokedynamic. + public int getNameAndTypeRefIndexAt(int index) { + return getNameAndTypeRefIndexAt0(constantPoolOop, index); + } + // Fetches the name and type from name_and_type index as an array of two Strings + public String[] getNameAndTypeRefInfoAt(int index) { + return getNameAndTypeRefInfoAt0(constantPoolOop, index); + } public int getIntAt (int index) { return getIntAt0 (constantPoolOop, index); } public long getLongAt (int index) { return getLongAt0 (constantPoolOop, index); } public float getFloatAt (int index) { return getFloatAt0 (constantPoolOop, index); } public double getDoubleAt (int index) { return getDoubleAt0 (constantPoolOop, index); } public String getStringAt (int index) { return getStringAt0 (constantPoolOop, index); } public String getUTF8At (int index) { return getUTF8At0 (constantPoolOop, index); } + public Tag getTagAt(int index) { + return Tag.valueOf(getTagAt0(constantPoolOop, index)); + } + public static enum Tag { + UTF8(1), + INTEGER(3), + FLOAT(4), + LONG(5), + DOUBLE(6), + CLASS(7), + STRING(8), + FIELDREF(9), + METHODREF(10), + INTERFACEMETHODREF(11), + NAMEANDTYPE(12), + METHODHANDLE(15), + METHODTYPE(16), + INVOKEDYNAMIC(18), + INVALID(0); + + private final int tagCode; + + private Tag(int tagCode) { + this.tagCode = tagCode; + } + + private static Tag valueOf(byte v) { + for (Tag tag : Tag.values()) { + if (tag.tagCode == v) { + return tag; + } + } + throw new IllegalArgumentException("Unknown constant pool tag code " + v); + } + } //--------------------------------------------------------------------------- // Internals only below this point // @@ -66,15 +113,19 @@ public class ConstantPool { private native int getSize0 (Object constantPoolOop); private native Class getClassAt0 (Object constantPoolOop, int index); private native Class getClassAtIfLoaded0 (Object constantPoolOop, int index); + private native int getClassRefIndexAt0 (Object constantPoolOop, int index); private native Member getMethodAt0 (Object constantPoolOop, int index); private native Member getMethodAtIfLoaded0(Object constantPoolOop, int index); private native Field getFieldAt0 (Object constantPoolOop, int index); private native Field getFieldAtIfLoaded0 (Object constantPoolOop, int index); private native String[] getMemberRefInfoAt0 (Object constantPoolOop, int index); + private native int getNameAndTypeRefIndexAt0(Object constantPoolOop, int index); + private native String[] getNameAndTypeRefInfoAt0(Object constantPoolOop, int index); private native int getIntAt0 (Object constantPoolOop, int index); private native long getLongAt0 (Object constantPoolOop, int index); private native float getFloatAt0 (Object constantPoolOop, int index); private native double getDoubleAt0 (Object constantPoolOop, int index); private native String getStringAt0 (Object constantPoolOop, int index); private native String getUTF8At0 (Object constantPoolOop, int index); + private native byte getTagAt0 (Object constantPoolOop, int index); } diff --git a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java index 9f9c86d99e2..1db2d089932 100644 --- a/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java +++ b/jdk/src/java.base/share/classes/sun/security/jca/ProviderList.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -653,6 +653,7 @@ public final class ProviderList { String type = null; String algorithm; String provider; + String alternateName = null; PreferredEntry(String t, String p) { int i = t.indexOf('.'); @@ -664,6 +665,11 @@ public final class ProviderList { } provider = p; + if (algorithm.compareToIgnoreCase("SHA1") == 0) { + alternateName = "SHA-1"; + } else if (algorithm.compareToIgnoreCase("SHA-1") == 0) { + alternateName = "SHA1"; + } } boolean match(String t, String a) { @@ -685,6 +691,15 @@ public final class ProviderList { return true; } + if (alternateName != null && + a.compareToIgnoreCase(alternateName) == 0) { + if (debug != null) { + debug.println("Config entry found (alternateName): " + + toString()); + } + return true; + } + // No match return false; } diff --git a/jdk/src/java.base/share/conf/security/java.security b/jdk/src/java.base/share/conf/security/java.security index be48902f550..e71a2c3ff8d 100644 --- a/jdk/src/java.base/share/conf/security/java.security +++ b/jdk/src/java.base/share/conf/security/java.security @@ -109,7 +109,8 @@ security.provider.tbd=sun.security.pkcs11.SunPKCS11 # jdk.security.provider.preferred=AES/GCM/NoPadding:SunJCE, \ # MessageDigest.SHA-256:SUN #ifdef solaris-sparc -jdk.security.provider.preferred=AES:SunJCE, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN +jdk.security.provider.preferred=AES:SunJCE, SHA1:SUN, SHA-224:SUN, \ + SHA-256:SUN, SHA-384:SUN, SHA-512:SUN #endif #ifdef solaris-x86 jdk.security.provider.preferred=AES:SunJCE, RSA:SunRsaSign diff --git a/jdk/src/java.base/share/native/include/jvm.h b/jdk/src/java.base/share/native/include/jvm.h index 2f65c1a2e97..99f7c7f8be4 100644 --- a/jdk/src/java.base/share/native/include/jvm.h +++ b/jdk/src/java.base/share/native/include/jvm.h @@ -63,7 +63,7 @@ extern "C" { * class. */ -#define JVM_INTERFACE_VERSION 4 +#define JVM_INTERFACE_VERSION 5 JNIEXPORT jint JNICALL JVM_GetInterfaceVersion(void); @@ -502,6 +502,9 @@ JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded (JNIEnv *env, jobject unused, jobject jcpool, jint index); +JNIEXPORT jint JNICALL JVM_ConstantPoolGetClassRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt (JNIEnv *env, jobject unused, jobject jcpool, jint index); @@ -517,6 +520,12 @@ JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt (JNIEnv *env, jobject unused, jobject jcpool, jint index); +JNIEXPORT jint JNICALL JVM_ConstantPoolGetNameAndTypeRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + +JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetNameAndTypeRefInfoAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt (JNIEnv *env, jobject unused, jobject jcpool, jint index); @@ -535,6 +544,9 @@ JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At (JNIEnv *env, jobject unused, jobject jcpool, jint index); +JNIEXPORT jbyte JNICALL JVM_ConstantPoolGetTagAt +(JNIEnv *env, jobject unused, jobject jcpool, jint index); + /* * Parameter reflection */ diff --git a/jdk/src/java.base/share/native/libjava/ConstantPool.c b/jdk/src/java.base/share/native/libjava/ConstantPool.c index 1a29f003ba4..f7f744144e3 100644 --- a/jdk/src/java.base/share/native/libjava/ConstantPool.c +++ b/jdk/src/java.base/share/native/libjava/ConstantPool.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -44,6 +44,12 @@ JNIEXPORT jclass JNICALL Java_sun_reflect_ConstantPool_getClassAtIfLoaded0 return JVM_ConstantPoolGetClassAtIfLoaded(env, unused, jcpool, index); } +JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getClassRefIndexAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetClassRefIndexAt(env, unused, jcpool, index); +} + JNIEXPORT jobject JNICALL Java_sun_reflect_ConstantPool_getMethodAt0 (JNIEnv *env, jobject unused, jobject jcpool, jint index) { @@ -74,6 +80,18 @@ JNIEXPORT jobjectArray JNICALL Java_sun_reflect_ConstantPool_getMemberRefInfoAt0 return JVM_ConstantPoolGetMemberRefInfoAt(env, unused, jcpool, index); } +JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getNameAndTypeRefIndexAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetNameAndTypeRefIndexAt(env, unused, jcpool, index); +} + +JNIEXPORT jobjectArray JNICALL Java_sun_reflect_ConstantPool_getNameAndTypeRefInfoAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetNameAndTypeRefInfoAt(env, unused, jcpool, index); +} + JNIEXPORT jint JNICALL Java_sun_reflect_ConstantPool_getIntAt0 (JNIEnv *env, jobject unused, jobject jcpool, jint index) { @@ -109,3 +127,10 @@ JNIEXPORT jstring JNICALL Java_sun_reflect_ConstantPool_getUTF8At0 { return JVM_ConstantPoolGetUTF8At(env, unused, jcpool, index); } + +JNIEXPORT jbyte JNICALL Java_sun_reflect_ConstantPool_getTagAt0 +(JNIEnv *env, jobject unused, jobject jcpool, jint index) +{ + return JVM_ConstantPoolGetTagAt(env, unused, jcpool, index); +} + diff --git a/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp b/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp index 32aa7d0c29f..124995dd0a2 100644 --- a/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp +++ b/jdk/src/java.base/share/native/libjimage/ImageNativeSubstrate.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 +210,7 @@ static jlong* JIMAGE_FindAttributes(JNIEnv *env, jlong* rawAttributes, jbyte* ra // Locate resource location data. ImageLocation location; bool found = reader->find_location(path, location); - delete path; + delete[] path; // Resource not found. if (!found) return NULL; // Expand stream into array. diff --git a/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp b/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp index e3110f060ab..edf88b5e85b 100644 --- a/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp +++ b/jdk/src/java.base/share/native/libjimage/imageDecompressor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,7 +86,7 @@ void ImageDecompressor::image_decompressor_init() { } void ImageDecompressor::image_decompressor_close() { - delete _decompressors; + delete[] _decompressors; } /* @@ -135,13 +135,13 @@ void ImageDecompressor::decompress_resource(u1* compressed, u1* uncompressed, decompressor->decompress_resource(compressed_resource, decompressed_resource, &_header, strings); if (compressed_resource_base != compressed) { - delete compressed_resource_base; + delete[] compressed_resource_base; } compressed_resource = decompressed_resource; } } while (has_header); memcpy(uncompressed, decompressed_resource, uncompressed_size); - delete decompressed_resource; + delete[] decompressed_resource; } // Zip decompressor @@ -190,8 +190,8 @@ void SharedStringDecompressor::decompress_resource(u1* data, { // String in Strings table *uncompressed_resource = 1; uncompressed_resource += 1; - int i = decompress_int(data); - const char * string = strings->get(i); + int k = decompress_int(data); + const char * string = strings->get(k); int str_length = (int) strlen(string); Endian::set_java(uncompressed_resource, str_length); uncompressed_resource += 2; @@ -241,7 +241,7 @@ void SharedStringDecompressor::decompress_resource(u1* data, *fullpkg = '/'; memcpy(uncompressed_resource, pkg_base, len); uncompressed_resource += len; - delete pkg_base; + delete[] pkg_base; desc_length += len; } else { // Empty package // Nothing to do. diff --git a/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java b/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java index c591fe806c6..f19b7e48a48 100644 --- a/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java +++ b/jdk/src/java.base/unix/classes/sun/security/provider/NativePRNG.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,8 @@ package sun.security.provider; import java.io.*; import java.net.*; import java.security.*; +import java.util.Arrays; + import sun.security.util.Debug; /** @@ -334,7 +336,9 @@ public final class NativePRNG extends SecureRandomSpi { private static final long MAX_BUFFER_TIME = 100; // size of the "next" buffer - private static final int BUFFER_SIZE = 32; + private static final int MAX_BUFFER_SIZE = 65536; + private static final int MIN_BUFFER_SIZE = 32; + private int bufferSize = 256; // Holder for the seedFile. Used if we ever add seed material. File seedFile; @@ -351,7 +355,7 @@ public final class NativePRNG extends SecureRandomSpi { private volatile sun.security.provider.SecureRandom mixRandom; // buffer for next bits - private final byte[] nextBuffer; + private byte[] nextBuffer; // number of bytes left in nextBuffer private int buffered; @@ -359,6 +363,16 @@ public final class NativePRNG extends SecureRandomSpi { // time we read the data into the nextBuffer private long lastRead; + // Count for the number of buffer size changes requests + // Positive value in increase size, negative to lower it. + private int change_buffer = 0; + + // Request limit to trigger an increase in nextBuffer size + private static final int REQ_LIMIT_INC = 1000; + + // Request limit to trigger a decrease in nextBuffer size + private static final int REQ_LIMIT_DEC = -100; + // mutex lock for nextBytes() private final Object LOCK_GET_BYTES = new Object(); @@ -373,7 +387,7 @@ public final class NativePRNG extends SecureRandomSpi { this.seedFile = seedFile; seedIn = FileInputStreamPool.getInputStream(seedFile); nextIn = FileInputStreamPool.getInputStream(nextFile); - nextBuffer = new byte[BUFFER_SIZE]; + nextBuffer = new byte[bufferSize]; } // get the SHA1PRNG for mixing @@ -466,9 +480,47 @@ public final class NativePRNG extends SecureRandomSpi { // if not, read new bytes private void ensureBufferValid() throws IOException { long time = System.currentTimeMillis(); - if ((buffered > 0) && (time - lastRead < MAX_BUFFER_TIME)) { - return; + int new_buffer_size = 0; + + // Check if buffer has bytes available that are not too old + if (buffered > 0) { + if (time - lastRead < MAX_BUFFER_TIME) { + return; + } else { + // byte is old, so subtract from counter to shrink buffer + change_buffer--; + } + } else { + // No bytes available, so add to count to increase buffer + change_buffer++; } + + // If counter has it a limit, increase or decrease size + if (change_buffer > REQ_LIMIT_INC) { + new_buffer_size = nextBuffer.length * 2; + } else if (change_buffer < REQ_LIMIT_DEC) { + new_buffer_size = nextBuffer.length / 2; + } + + // If buffer size is to be changed, replace nextBuffer. + if (new_buffer_size > 0) { + if (new_buffer_size <= MAX_BUFFER_SIZE && + new_buffer_size >= MIN_BUFFER_SIZE) { + nextBuffer = new byte[new_buffer_size]; + if (debug != null) { + debug.println("Buffer size changed to " + + new_buffer_size); + } + } else { + if (debug != null) { + debug.println("Buffer reached limit: " + + nextBuffer.length); + } + } + change_buffer = 0; + } + + // Load fresh random bytes into nextBuffer lastRead = time; readFully(nextIn, nextBuffer); buffered = nextBuffer.length; @@ -478,24 +530,40 @@ public final class NativePRNG extends SecureRandomSpi { // read from "next" and XOR with bytes generated by the // mixing SHA1PRNG private void implNextBytes(byte[] data) { - synchronized (LOCK_GET_BYTES) { try { getMixRandom().engineNextBytes(data); - int len = data.length; + int data_len = data.length; int ofs = 0; - while (len > 0) { - ensureBufferValid(); - int bufferOfs = nextBuffer.length - buffered; - while ((len > 0) && (buffered > 0)) { - data[ofs++] ^= nextBuffer[bufferOfs++]; - len--; - buffered--; + int len; + int buf_pos; + int localofs; + byte[] localBuffer; + + while (data_len > 0) { + synchronized (LOCK_GET_BYTES) { + ensureBufferValid(); + buf_pos = nextBuffer.length - buffered; + if (data_len > buffered) { + len = buffered; + buffered = 0; + } else { + len = data_len; + buffered -= len; + } + localBuffer = Arrays.copyOfRange(nextBuffer, buf_pos, + buf_pos + len); } + localofs = 0; + while (len > localofs) { + data[ofs] ^= localBuffer[localofs]; + ofs++; + localofs++; + } + data_len -= len; } - } catch (IOException e) { + } catch (IOException e){ throw new ProviderException("nextBytes() failed", e); } - } } - } + } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java index 19d1edd43dc..3535b4ae3d6 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/Application.java @@ -39,7 +39,7 @@ import sun.lwawt.LWWindowPeer; import sun.lwawt.macosx.CPlatformWindow; /** - * The Application class allows you to integrate your Java application with the native Mac OS X environment. + * The {@code Application} class allows you to integrate your Java application with the native Mac OS X environment. * You can provide your Mac OS X users a greatly enhanced experience by implementing a few basic handlers for standard system events. * * For example: @@ -142,7 +142,7 @@ public class Application { /** * Installs a handler to show a custom About window for your application. * - * Setting the {@link AboutHandler} to null reverts it to the default Cocoa About window. + * Setting the {@link AboutHandler} to {@code null} reverts it to the default Cocoa About window. * * @param aboutHandler the handler to respond to the {@link AboutHandler#handleAbout()} message * @since Java for Mac OS X 10.6 Update 3 @@ -155,7 +155,7 @@ public class Application { /** * Installs a handler to create the Preferences menu item in your application's app menu. * - * Setting the {@link PreferencesHandler} to null will remove the Preferences item from the app menu. + * Setting the {@link PreferencesHandler} to {@code null} will remove the Preferences item from the app menu. * * @param preferencesHandler * @since Java for Mac OS X 10.6 Update 3 @@ -167,8 +167,8 @@ public class Application { /** * Installs the handler which is notified when the application is asked to open a list of files. - * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a CFBundleDocumentTypes array present in it's Info.plist. - * See the Info.plist Key Reference for more information about adding a CFBundleDocumentTypes key to your app's Info.plist. + * The {@link OpenFilesHandler#openFiles(AppEvent.OpenFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist. * * @param openFileHandler * @since Java for Mac OS X 10.6 Update 3 @@ -180,8 +180,8 @@ public class Application { /** * Installs the handler which is notified when the application is asked to print a list of files. - * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a CFBundleDocumentTypes array present in it's Info.plist. - * See the Info.plist Key Reference for more information about adding a CFBundleDocumentTypes key to your app's Info.plist. + * The {@link PrintFilesHandler#printFiles(AppEvent.PrintFilesEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleDocumentTypes} array present in it's Info.plist. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleDocumentTypes} key to your app's Info.plist. * * @param printFileHandler * @since Java for Mac OS X 10.6 Update 3 @@ -193,10 +193,10 @@ public class Application { /** * Installs the handler which is notified when the application is asked to open a URL. - * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a CFBundleURLTypes array present in it's Info.plist. - * See the Info.plist Key Reference for more information about adding a CFBundleURLTypes key to your app's Info.plist. + * The {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} notifications are only sent if the Java app is a bundled application, with a {@code CFBundleURLTypes} array present in it's Info.plist. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist. * - * Setting the handler to null causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set. + * Setting the handler to {@code null} causes all {@link OpenURIHandler#openURI(AppEvent.OpenURIEvent)} requests to be enqueued until another handler is set. * * @param openURIHandler * @since Java for Mac OS X 10.6 Update 3 @@ -209,7 +209,7 @@ public class Application { /** * Installs the handler which determines if the application should quit. * The handler is passed a one-shot {@link QuitResponse} which can cancel or proceed with the quit. - * Setting the handler to null causes all quit requests to directly perform the default {@link QuitStrategy}. + * Setting the handler to {@code null} causes all quit requests to directly perform the default {@link QuitStrategy}. * * @param quitHandler the handler that is called when the application is asked to quit * @since Java for Mac OS X 10.6 Update 3 @@ -432,11 +432,11 @@ public class Application { /** * Enables the Preferences item in the application menu. The ApplicationListener receives a callback for - * selection of the Preferences item in the application menu only if this is set to true. + * selection of the Preferences item in the application menu only if this is set to {@code true}. * * If a Preferences item isn't present, this method adds and enables it. * - * @param enable specifies whether the Preferences item in the application menu should be enabled (true) or not (false) + * @param enable specifies whether the Preferences item in the application menu should be enabled ({@code true}) or not ({@code false}) * * @deprecated no replacement * @since 1.4 @@ -449,12 +449,12 @@ public class Application { /** * Enables the About item in the application menu. The ApplicationListener receives a callback for - * selection of the About item in the application menu only if this is set to true. Because AWT supplies - * a standard About window when an application may not, by default this is set to true. + * selection of the About item in the application menu only if this is set to {@code true}. Because AWT supplies + * a standard About window when an application may not, by default this is set to {@code true}. * * If the About item isn't present, this method adds and enables it. * - * @param enable specifies whether the About item in the application menu should be enabled (true) or not (false) + * @param enable specifies whether the About item in the application menu should be enabled ({@code true}) or not ({@code false}) * * @deprecated no replacement * @since 1.4 @@ -553,7 +553,7 @@ public class Application { } /** - * @deprecated Use java.awt.MouseInfo.getPointerInfo().getLocation(). + * @deprecated Use {@code java.awt.MouseInfo.getPointerInfo().getLocation()}. * * @since 1.4 */ diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java index bf78e586311..17339373153 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationAdapter.java @@ -26,7 +26,7 @@ package com.apple.eawt; /** - * An abstract adapter class for receiving ApplicationEvents. + * An abstract adapter class for receiving {@code ApplicationEvents}. * * ApplicationEvents are deprecated. Use individual app event listeners or handlers instead. * diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java index 908c8257b01..0cfe0741682 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationEvent.java @@ -50,9 +50,9 @@ public class ApplicationEvent extends EventObject { /** * Determines whether an ApplicationListener has acted on a particular event. - * An event is marked as having been handled with setHandled(true). + * An event is marked as having been handled with {@code setHandled(true)}. * - * @return true if the event has been handled, otherwise false + * @return {@code true} if the event has been handled, otherwise {@code false} * * @since 1.4 * @deprecated @@ -65,10 +65,10 @@ public class ApplicationEvent extends EventObject { /** * Marks the event as handled. * After this method handles an ApplicationEvent, it may be useful to specify that it has been handled. - * This is usually used in conjunction with getHandled(). - * Set to true to designate that this event has been handled. By default it is false. + * This is usually used in conjunction with {@code getHandled()}. + * Set to {@code true} to designate that this event has been handled. By default it is {@code false}. * - * @param state true if the event has been handled, otherwise false. + * @param state {@code true} if the event has been handled, otherwise {@code false}. * * @since 1.4 * @deprecated @@ -84,7 +84,7 @@ public class ApplicationEvent extends EventObject { * For example, the Print and Open events refer to specific files. * For these cases, this returns the appropriate file name. * - * @return the full path to the file associated with the event, if applicable, otherwise null + * @return the full path to the file associated with the event, if applicable, otherwise {@code null} * * @since 1.4 * @deprecated use {@link OpenFilesHandler} or {@link PrintFilesHandler} instead diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java index 14e3386134e..ea2efcf0ede 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/ApplicationListener.java @@ -53,9 +53,9 @@ import java.util.EventListener; @Deprecated public interface ApplicationListener extends EventListener { /** - * Called when the user selects the About item in the application menu. If event is not handled by - * setting isHandled(true), a default About window consisting of the application's name and icon is - * displayed. To display a custom About window, designate the event as being handled and display the + * Called when the user selects the About item in the application menu. If {@code event} is not handled by + * setting {@code isHandled(true)}, a default About window consisting of the application's name and icon is + * displayed. To display a custom About window, designate the {@code event} as being handled and display the * appropriate About window. * * @param event an ApplicationEvent initiated by the user choosing About in the application menu @@ -99,7 +99,7 @@ public interface ApplicationListener extends EventListener { * Called when the Preference item in the application menu is selected. Native Mac OS X applications make their * Preferences window available through the application menu. Java applications are automatically given an application * menu in Mac OS X. By default, the Preferences item is disabled in that menu. If you are deploying an application - * on Mac OS X, you should enable the preferences item with setEnabledPreferencesMenu(true) in the + * on Mac OS X, you should enable the preferences item with {@code setEnabledPreferencesMenu(true)} in the * Application object and then display your Preferences window in this handler. * * @param event triggered when the user selects Preferences from the application menu @@ -130,8 +130,8 @@ public interface ApplicationListener extends EventListener { * application menu, when the user types Command-Q, or when the user control clicks on your application icon in the * Dock and chooses Quit. You can either accept or reject the request to quit. You might want to reject the request * to quit if the user has unsaved work. Reject the request, move into your code to save changes, then quit your - * application. To accept the request to quit, and terminate the application, set isHandled(true) for the - * event. To reject the quit, set isHandled(false). + * application. To accept the request to quit, and terminate the application, set {@code isHandled(true)} for the + * {@code event}. To reject the quit, set {@code isHandled(false)}. * * @param event a Quit Application event * @deprecated use {@link QuitHandler} and {@link QuitResponse} diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java index 3197f1528f5..1964344f94a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/OpenURIHandler.java @@ -29,8 +29,8 @@ import com.apple.eawt.AppEvent.OpenURIEvent; /** * An implementor is notified when the application is asked to open a URI. - * The application only sends {@link com.apple.eawt.EAWTEvent.OpenURIEvent}s when it has been launched as a bundled Mac application, and it's Info.plist claims URL schemes in it's CFBundleURLTypes entry. - * See the Info.plist Key Reference for more information about adding a CFBundleURLTypes key to your app's Info.plist. + * The application only sends {@link com.apple.eawt.EAWTEvent.OpenURIEvent}s when it has been launched as a bundled Mac application, and it's Info.plist claims URL schemes in it's {@code CFBundleURLTypes} entry. + * See the Info.plist Key Reference for more information about adding a {@code CFBundleURLTypes} key to your app's Info.plist. * * @see Application#setOpenURIHandler(OpenURIHandler) * diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java index 89c8be0465f..a0140d9ba78 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eawt/QuitStrategy.java @@ -38,7 +38,7 @@ package com.apple.eawt; */ public enum QuitStrategy { /** - * Shuts down the application by calling System.exit(0). This is the default strategy. + * Shuts down the application by calling {@code System.exit(0)}. This is the default strategy. */ SYSTEM_EXIT_0, diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java b/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java index 5dec385d5aa..90841e426c0 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java @@ -32,19 +32,19 @@ import java.io.*; * attributes. These attributes in turn are dependent on HFS and HFS+ file systems. As such, it is important to recognize * their limitation when writing code that must function well across multiple platforms.

* - * In addition to file name suffixes, Mac OS X can use Finder attributes like file type and creator codes to - * identify and handle files. These codes are unique 4-byte identifiers. The file type is a string that describes the - * contents of a file. For example, the file type APPL identifies the file as an application and therefore - * executable. A file type of TEXT means that the file contains raw text. Any application that can read raw - * text can open a file of type TEXT. Applications that use proprietary file types might assign their files a proprietary - * file type code. + * In addition to file name suffixes, Mac OS X can use Finder attributes like file {@code type} and {@code creator} codes to + * identify and handle files. These codes are unique 4-byte identifiers. The file {@code type} is a string that describes the + * contents of a file. For example, the file type {@code APPL} identifies the file as an application and therefore + * executable. A file type of {@code TEXT} means that the file contains raw text. Any application that can read raw + * text can open a file of type {@code TEXT}. Applications that use proprietary file types might assign their files a proprietary + * file {@code type} code. *

- * To identify the application that can handle a document, the Finder can look at the creator. For example, if a user - * double-clicks on a document with the ttxt creator, it opens up in Text Edit, the application registered - * with the ttxt creator code. Note that the creator + * To identify the application that can handle a document, the Finder can look at the {@code creator}. For example, if a user + * double-clicks on a document with the {@code ttxt creator}, it opens up in Text Edit, the application registered + * with the {@code ttxt creator} code. Note that the {@code creator} * code can be set to any application, not necessarily the application that created it. For example, if you - * use an editor to create an HTML document, you might want to assign a browser's creator code for the file rather than - * the HTML editor's creator code. Double-clicking on the document then opens the appropriate browser rather than the + * use an editor to create an HTML document, you might want to assign a browser's {@code creator} code for the file rather than + * the HTML editor's {@code creator} code. Double-clicking on the document then opens the appropriate browser rather than the *HTML editor. *

* If you plan to publicly distribute your application, you must register its creator and any proprietary file types with the Apple @@ -126,7 +126,7 @@ public class FileManager { } /** - * Sets the file type and creator codes for a file or folder. + * Sets the file {@code type} and {@code creator} codes for a file or folder. * * @since 1.4 */ @@ -140,7 +140,7 @@ public class FileManager { private static native void _setFileTypeAndCreator(String filename, int type, int creator) throws IOException; /** - * Sets the file type code for a file or folder. + * Sets the file {@code type} code for a file or folder. * * @since 1.4 */ @@ -154,7 +154,7 @@ public class FileManager { private static native void _setFileType(String filename, int type) throws IOException; /** - * Sets the file creator code for a file or folder. + * Sets the file {@code creator} code for a file or folder. * * @since 1.4 */ @@ -168,7 +168,7 @@ public class FileManager { private static native void _setFileCreator(String filename, int creator) throws IOException; /** - * Obtains the file type code for a file or folder. + * Obtains the file {@code type} code for a file or folder. * * @since 1.4 */ @@ -182,7 +182,7 @@ public class FileManager { private static native int _getFileType(String filename) throws IOException; /** - * Obtains the file creator code for a file or folder. + * Obtains the file {@code creator} code for a file or folder. * * @since 1.4 */ @@ -200,11 +200,11 @@ public class FileManager { * Locates a folder of a particular type. Mac OS X recognizes certain specific folders that have distinct purposes. * For example, the user's desktop or temporary folder. These folders have corresponding codes. Given one of these codes, * this method returns the path to that particular folder. Certain folders of a given type may appear in more than - * one domain. For example, although there is only one root folder, there are multiple pref - * folders. If this method is called to find the pref folder, it will return the first one it finds, - * the user's preferences folder in ~/Library/Preferences. To explicitly locate a folder in a certain - * domain use findFolder(short domain, int folderType) or findFolder(short domain, int folderType, - * boolean createIfNeeded). + * one domain. For example, although there is only one {@code root} folder, there are multiple {@code pref} + * folders. If this method is called to find the {@code pref} folder, it will return the first one it finds, + * the user's preferences folder in {@code ~/Library/Preferences}. To explicitly locate a folder in a certain + * domain use {@code findFolder(short domain, int folderType)} or + * {@code findFolder(short domain, int folderType, boolean createIfNeeded)}. * * @return the path to the folder searched for * @@ -215,8 +215,8 @@ public class FileManager { } /** - * Locates a folder of a particular type, within a given domain. Similar to findFolder(int folderType) - * except that the domain to look in can be specified. Valid values for domaininclude: + * Locates a folder of a particular type, within a given domain. Similar to {@code findFolder(int folderType)} + * except that the domain to look in can be specified. Valid values for {@code domain} include: *

*
user
*
The User domain contains resources specific to the user who is currently logged in
@@ -239,12 +239,12 @@ public class FileManager { /** * Locates a folder of a particular type within a given domain and optionally creating the folder if it does - * not exist. The behavior is similar to findFolder(int folderType) and - * findFolder(short domain, int folderType) except that it can create the folder if it does not already exist. + * not exist. The behavior is similar to {@code findFolder(int folderType)} and + * {@code findFolder(short domain, int folderType)} except that it can create the folder if it does not already exist. * * @param createIfNeeded - * set to true, by setting to false the behavior will be the - * same as findFolder(short domain, int folderType, boolean createIfNeeded) + * set to {@code true}, by setting to {@code false} the behavior will be the + * same as {@code findFolder(short domain, int folderType, boolean createIfNeeded)} * @return the path to the folder searched for * * @since 1.4 @@ -263,9 +263,9 @@ public class FileManager { /** - * Opens the path specified by a URL in the appropriate application for that URL. HTTP URL's (http://) - * open in the default browser as set in the Internet pane of System Preferences. File (file://) and - * FTP URL's (ftp://) open in the Finder. Note that opening an FTP URL will prompt the user for where + * Opens the path specified by a URL in the appropriate application for that URL. HTTP URL's ({@code http://}) + * open in the default browser as set in the Internet pane of System Preferences. File ({@code file://}) and + * FTP URL's ({@code ftp://}) open in the Finder. Note that opening an FTP URL will prompt the user for where * they want to save the downloaded file(s). * * @param url diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java index 887ab5c8bd3..05eddcea4d8 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileSystemModel.java @@ -26,6 +26,7 @@ package com.apple.laf; +import java.awt.ComponentOrientation; import java.beans.*; import java.io.File; import java.util.*; @@ -85,6 +86,15 @@ class AquaFileSystemModel extends AbstractTableModel implements PropertyChangeLi } else if (prop == JFileChooser.FILE_SELECTION_MODE_CHANGED_PROPERTY) { invalidateFileCache(); validateFileCache(); + } else if (prop.equals("componentOrientation")) { + ComponentOrientation o = (ComponentOrientation) e.getNewValue(); + JFileChooser cc = (JFileChooser) e.getSource(); + if (o != e.getOldValue()) { + cc.applyComponentOrientation(o); + } + fFileList.setComponentOrientation(o); + fFileList.getParent().getParent().setComponentOrientation(o); + } if (prop == SORT_BY_CHANGED) {// $ Ought to just resort fSortNames = (((Integer)e.getNewValue()).intValue() == 0); diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java index 49a9a19d201..c2ce10b0e4a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameManager.java @@ -105,7 +105,9 @@ public class AquaInternalFrameManager extends DefaultDesktopManager { // Position depends on *current* position of frame, unlike super which reuses the first position final Rectangle r = getBoundsForIconOf(f); desktopIcon.setBounds(r.x, r.y, r.width, r.height); - + if (!wasIcon(f)) { + setWasIcon(f, Boolean.TRUE); + } c = f.getParent(); if (c == null) return; diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java index 530b5c6d999..74b40511795 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaInternalFrameUI.java @@ -295,9 +295,9 @@ public class AquaInternalFrameUI extends BasicInternalFrameUI implements SwingCo } /** - * Installs necessary mouse handlers on newPane + * Installs necessary mouse handlers on {@code newPane} * and adds it to the frame. - * Reverse process for the currentPane. + * Reverse process for the {@code currentPane}. */ @Override protected void replacePane(final JComponent currentPane, final JComponent newPane) { diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java index 44b9be288f5..f04d42de03b 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaLookAndFeel.java @@ -82,9 +82,9 @@ public class AquaLookAndFeel extends BasicLookAndFeel { } /** - * Returns true if the LookAndFeel returned - * RootPaneUI instances support providing Window decorations - * in a JRootPane. + * Returns true if the {@code LookAndFeel} returned + * {@code RootPaneUI} instances support providing Window decorations + * in a {@code JRootPane}. *

* The default implementation returns false, subclasses that support * Window decorations should override this and return true. @@ -174,20 +174,20 @@ public class AquaLookAndFeel extends BasicLookAndFeel { } /** - * Returns an ActionMap. + * Returns an {@code ActionMap}. *

- * This ActionMap contains Actions that + * This {@code ActionMap} contains {@code Actions} that * embody the ability to render an auditory cue. These auditory * cues map onto user and system activities that may be useful * for an end user to know about (such as a dialog box appearing). *

- * At the appropriate time in a JComponent UI's lifecycle, + * At the appropriate time in a {@code JComponent} UI's lifecycle, * the ComponentUI is responsible for getting the appropriate - * Action out of the ActionMap and passing - * it on to playSound. + * {@code Action} out of the {@code ActionMap} and passing + * it on to {@code playSound}. *

- * The Actions in this ActionMap are - * created by the createAudioAction method. + * The {@code Actions} in this {@code ActionMap} are + * created by the {@code createAudioAction} method. * * @return an ActionMap containing Actions * responsible for rendering auditory cues diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java index c1a57e503df..c62eab5f08b 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaOptionPaneUI.java @@ -47,7 +47,7 @@ public class AquaOptionPaneUI extends BasicOptionPaneUI { /** * Creates and returns a Container containin the buttons. The buttons - * are created by calling getButtons. + * are created by calling {@code getButtons}. */ protected Container createButtonArea() { final Container bottom = super.createButtonArea(); @@ -141,5 +141,27 @@ public class AquaOptionPaneUI extends BasicOptionPaneUI { xLocation += xOffset; } } + + @Override + public Dimension minimumLayoutSize(Container c) { + if (c != null) { + Component[] children = c.getComponents(); + if (children != null && children.length > 0) { + int numChildren = children.length; + Insets cInsets = c.getInsets(); + int extraHeight = cInsets.top + cInsets.bottom; + int extraWidth = cInsets.left + cInsets.right; + int okCancelButtonWidth = extraWidth + + (kOKCancelButtonWidth * numChildren) + + (numChildren - 1) * padding; + int okbuttonHeight = extraHeight + kButtonHeight; + Dimension minSize = super.minimumLayoutSize(c); + return new Dimension(Math.max(minSize.width, + okCancelButtonWidth), + Math.max(minSize.height, okbuttonHeight)); + } + } + return new Dimension(0, 0); + } } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java index 1ac16c320b7..9f5f09bbd1e 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaProgressBarUI.java @@ -180,10 +180,19 @@ public class AquaProgressBarUI extends ProgressBarUI implements ChangeListener, final int width = progressBar.getWidth() - (i.right + i.left); final int height = progressBar.getHeight() - (i.bottom + i.top); + Graphics2D g2 = (Graphics2D) g; + final AffineTransform savedAT = g2.getTransform(); + if (!progressBar.getComponentOrientation().isLeftToRight()) { + //Scale operation: Flips component about pivot + //Translate operation: Moves component back into original position + g2.scale(-1, 1); + g2.translate(-progressBar.getWidth(), 0); + } painter.paint(g, progressBar, i.left, i.top, width, height); + g2.setTransform(savedAT); if (progressBar.isStringPainted() && !progressBar.isIndeterminate()) { - paintString(g, i.left, i.top, width, height); + paintString(g, i.left, i.top, width, height); } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java index 3ab83b037c8..a4e179645a9 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaRootPaneUI.java @@ -164,7 +164,7 @@ public class AquaRootPaneUI extends BasicRootPaneUI implements AncestorListener, /** * Invoked when a property changes on the root pane. If the event - * indicates the defaultButton has changed, this will + * indicates the {@code defaultButton} has changed, this will * update the animation. * If the enabled state changed, it will start or stop the animation */ diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java index d2d9a76500b..219e739bcfb 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaSpinnerUI.java @@ -22,7 +22,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ - package com.apple.laf; import java.awt.*; @@ -45,33 +44,37 @@ import com.apple.laf.AquaUtils.RecyclableSingleton; import com.apple.laf.AquaUtils.RecyclableSingletonFromDefaultConstructor; /** - * This is originally derived from BasicSpinnerUI, but they made everything private - * so we can't subclass! + * This is originally derived from BasicSpinnerUI, but they made everything + * private so we can't subclass! */ public class AquaSpinnerUI extends SpinnerUI { + private static final RecyclableSingleton propertyChangeListener = new RecyclableSingletonFromDefaultConstructor<>(PropertyChangeHandler.class); + static PropertyChangeListener getPropertyChangeListener() { return propertyChangeListener.get(); } private static final RecyclableSingleton nextButtonHandler = new RecyclableSingleton() { - @Override - protected ArrowButtonHandler getInstance() { - return new ArrowButtonHandler("increment", true); - } - }; + @Override + protected ArrowButtonHandler getInstance() { + return new ArrowButtonHandler("increment", true); + } + }; + static ArrowButtonHandler getNextButtonHandler() { return nextButtonHandler.get(); } private static final RecyclableSingleton previousButtonHandler = new RecyclableSingleton() { - @Override - protected ArrowButtonHandler getInstance() { - return new ArrowButtonHandler("decrement", false); - } - }; + @Override + protected ArrowButtonHandler getInstance() { + return new ArrowButtonHandler("decrement", false); + } + }; + static ArrowButtonHandler getPreviousButtonHandler() { return previousButtonHandler.get(); } @@ -92,9 +95,10 @@ public class AquaSpinnerUI extends SpinnerUI { } boolean wasOpaque; + @Override public void installUI(final JComponent c) { - this.spinner = (JSpinner)c; + this.spinner = (JSpinner) c; installDefaults(); installListeners(); next = createNextButton(); @@ -110,8 +114,7 @@ public class AquaSpinnerUI extends SpinnerUI { installKeyboardActions(); // this doesn't work because JSpinner calls setOpaque(true) directly in it's constructor - // LookAndFeel.installProperty(spinner, "opaque", Boolean.FALSE); - + // LookAndFeel.installProperty(spinner, "opaque", Boolean.FALSE); // ...so we have to handle the is/was opaque ourselves wasOpaque = spinner.isOpaque(); spinner.setOpaque(false); @@ -208,6 +211,7 @@ public class AquaSpinnerUI extends SpinnerUI { @SuppressWarnings("serial") // Superclass is not serializable across versions class TransparentButton extends JButton implements SwingConstants { + boolean interceptRepaints = false; public TransparentButton() { @@ -219,14 +223,17 @@ public class AquaSpinnerUI extends SpinnerUI { } @Override - public void paint(final Graphics g) {} + public void paint(final Graphics g) { + } @Override public void repaint() { // only intercept repaints if we are after this has been initialized // otherwise we can't talk to our containing class if (interceptRepaints) { - if (spinPainter == null) return; + if (spinPainter == null) { + return; + } spinPainter.repaint(); } super.repaint(); @@ -246,7 +253,9 @@ public class AquaSpinnerUI extends SpinnerUI { } protected void fixupEditor(final JComponent editor) { - if (!(editor instanceof DefaultEditor)) return; + if (!(editor instanceof DefaultEditor)) { + return; + } editor.setOpaque(false); editor.setInheritsPopupMenu(true); @@ -255,7 +264,7 @@ public class AquaSpinnerUI extends SpinnerUI { editor.setFont(new FontUIResource(spinner.getFont())); } - final JFormattedTextField editorTextField = ((DefaultEditor)editor).getTextField(); + final JFormattedTextField editorTextField = ((DefaultEditor) editor).getTextField(); if (editorTextField.getFont() instanceof UIResource) { editorTextField.setFont(new FontUIResource(spinner.getFont())); } @@ -277,7 +286,7 @@ public class AquaSpinnerUI extends SpinnerUI { child.setEnabled(enabled); if (child instanceof Container) { - updateEnabledState((Container)child, enabled); + updateEnabledState((Container) child, enabled); } } } @@ -290,13 +299,13 @@ public class AquaSpinnerUI extends SpinnerUI { private InputMap getInputMap(final int condition) { if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) { - return (InputMap)UIManager.get("Spinner.ancestorInputMap"); + return (InputMap) UIManager.get("Spinner.ancestorInputMap"); } return null; } private ActionMap getActionMap() { - ActionMap map = (ActionMap)UIManager.get("Spinner.actionMap"); + ActionMap map = (ActionMap) UIManager.get("Spinner.actionMap"); if (map == null) { map = createActionMap(); @@ -316,6 +325,7 @@ public class AquaSpinnerUI extends SpinnerUI { @SuppressWarnings("serial") // Superclass is not serializable across versions private static class ArrowButtonHandler extends AbstractAction implements MouseListener { + final javax.swing.Timer autoRepeatTimer; final boolean isNext; JSpinner spinner = null; @@ -330,9 +340,9 @@ public class AquaSpinnerUI extends SpinnerUI { private JSpinner eventToSpinner(final AWTEvent e) { Object src = e.getSource(); while ((src instanceof Component) && !(src instanceof JSpinner)) { - src = ((Component)src).getParent(); + src = ((Component) src).getParent(); } - return (src instanceof JSpinner) ? (JSpinner)src : null; + return (src instanceof JSpinner) ? (JSpinner) src : null; } @Override @@ -342,13 +352,15 @@ public class AquaSpinnerUI extends SpinnerUI { spinner = eventToSpinner(e); } - if (spinner == null) return; + if (spinner == null) { + return; + } try { final int calendarField = getCalendarField(spinner); spinner.commitEdit(); if (calendarField != -1) { - ((SpinnerDateModel)spinner.getModel()).setCalendarField(calendarField); + ((SpinnerDateModel) spinner.getModel()).setCalendarField(calendarField); } final Object value = (isNext) ? spinner.getNextValue() : spinner.getPreviousValue(); if (value != null) { @@ -368,37 +380,46 @@ public class AquaSpinnerUI extends SpinnerUI { */ private void select(final JSpinner spinnerComponent) { final JComponent editor = spinnerComponent.getEditor(); - if (!(editor instanceof JSpinner.DateEditor)) return; + if (!(editor instanceof JSpinner.DateEditor)) { + return; + } - final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor; + final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor) editor; final JFormattedTextField ftf = dateEditor.getTextField(); final Format format = dateEditor.getFormat(); Object value; - if (format == null || (value = spinnerComponent.getValue()) == null) return; + if (format == null || (value = spinnerComponent.getValue()) == null) { + return; + } final SpinnerDateModel model = dateEditor.getModel(); final DateFormat.Field field = DateFormat.Field.ofCalendarField(model.getCalendarField()); - if (field == null) return; + if (field == null) { + return; + } try { final AttributedCharacterIterator iterator = format.formatToCharacterIterator(value); if (!select(ftf, iterator, field) && field == DateFormat.Field.HOUR0) { select(ftf, iterator, DateFormat.Field.HOUR1); } - } catch (final IllegalArgumentException iae) {} + } catch (final IllegalArgumentException iae) { + } } /** - * Selects the passed in field, returning true if it is found, - * false otherwise. + * Selects the passed in field, returning true if it is found, false + * otherwise. */ private boolean select(final JFormattedTextField ftf, final AttributedCharacterIterator iterator, final DateFormat.Field field) { final int max = ftf.getDocument().getLength(); iterator.first(); do { - final Map attrs = iterator.getAttributes(); - if (attrs == null || !attrs.containsKey(field)) continue; + final Map attrs = iterator.getAttributes(); + if (attrs == null || !attrs.containsKey(field)) { + continue; + } final int start = iterator.getRunStart(field); final int end = iterator.getRunLimit(field); @@ -412,29 +433,35 @@ public class AquaSpinnerUI extends SpinnerUI { } /** - * Returns the calendarField under the start of the selection, or - * -1 if there is no valid calendar field under the selection (or - * the spinner isn't editing dates. + * Returns the calendarField under the start of the selection, or -1 if + * there is no valid calendar field under the selection (or the spinner + * isn't editing dates. */ private int getCalendarField(final JSpinner spinnerComponent) { final JComponent editor = spinnerComponent.getEditor(); - if (!(editor instanceof JSpinner.DateEditor)) return -1; + if (!(editor instanceof JSpinner.DateEditor)) { + return -1; + } - final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor)editor; + final JSpinner.DateEditor dateEditor = (JSpinner.DateEditor) editor; final JFormattedTextField ftf = dateEditor.getTextField(); final int start = ftf.getSelectionStart(); final JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter(); - if (!(formatter instanceof InternationalFormatter)) return -1; + if (!(formatter instanceof InternationalFormatter)) { + return -1; + } - final Format.Field[] fields = ((InternationalFormatter)formatter).getFields(start); + final Format.Field[] fields = ((InternationalFormatter) formatter).getFields(start); for (final Field element : fields) { - if (!(element instanceof DateFormat.Field)) continue; + if (!(element instanceof DateFormat.Field)) { + continue; + } int calendarField; if (element == DateFormat.Field.HOUR1) { calendarField = Calendar.HOUR; } else { - calendarField = ((DateFormat.Field)element).getCalendarField(); + calendarField = ((DateFormat.Field) element).getCalendarField(); } if (calendarField != -1) { @@ -446,7 +473,9 @@ public class AquaSpinnerUI extends SpinnerUI { @Override public void mousePressed(final MouseEvent e) { - if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) return; + if (!SwingUtilities.isLeftMouseButton(e) || !e.getComponent().isEnabled()) { + return; + } spinner = eventToSpinner(e); autoRepeatTimer.start(); @@ -460,26 +489,35 @@ public class AquaSpinnerUI extends SpinnerUI { } @Override - public void mouseClicked(final MouseEvent e) {} + public void mouseClicked(final MouseEvent e) { + } + @Override - public void mouseEntered(final MouseEvent e) {} + public void mouseEntered(final MouseEvent e) { + } + @Override - public void mouseExited(final MouseEvent e) {} + public void mouseExited(final MouseEvent e) { + } /** - * Requests focus on a child of the spinner if the spinner doesn't - * have focus. + * Requests focus on a child of the spinner if the spinner doesn't have + * focus. */ private void focusSpinnerIfNecessary() { final Component fo = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); - if (!spinner.isRequestFocusEnabled() || (fo != null && (SwingUtilities.isDescendingFrom(fo, spinner)))) return; + if (!spinner.isRequestFocusEnabled() || (fo != null && (SwingUtilities.isDescendingFrom(fo, spinner)))) { + return; + } Container root = spinner; if (!root.isFocusCycleRoot()) { root = root.getFocusCycleRootAncestor(); } - if (root == null) return; + if (root == null) { + return; + } final FocusTraversalPolicy ftp = root.getFocusTraversalPolicy(); final Component child = ftp.getComponentAfter(root, spinner); @@ -491,6 +529,7 @@ public class AquaSpinnerUI extends SpinnerUI { @SuppressWarnings("serial") // Superclass is not serializable across versions class SpinPainter extends JComponent { + final AquaPainter painter = AquaPainter.create(JRSUIStateFactory.getSpinnerArrows()); ButtonModel fTopModel; @@ -551,11 +590,12 @@ public class AquaSpinnerUI extends SpinnerUI { } /** - * A simple layout manager for the editor and the next/previous buttons. - * See the AquaSpinnerUI javadoc for more information about exactly - * how the components are arranged. + * A simple layout manager for the editor and the next/previous buttons. See + * the AquaSpinnerUI javadoc for more information about exactly how the + * components are arranged. */ static class SpinnerLayout implements LayoutManager { + private Component nextButton = null; private Component previousButton = null; private Component editor = null; @@ -656,26 +696,38 @@ public class AquaSpinnerUI extends SpinnerUI { } /** - * Detect JSpinner property changes we're interested in and delegate. Subclasses - * shouldn't need to replace the default propertyChangeListener (although they - * can by overriding createPropertyChangeListener) since all of the interesting - * property changes are delegated to protected methods. + * Detect JSpinner property changes we're interested in and delegate. + * Subclasses shouldn't need to replace the default propertyChangeListener + * (although they can by overriding createPropertyChangeListener) since all + * of the interesting property changes are delegated to protected methods. */ static class PropertyChangeHandler implements PropertyChangeListener { + @Override public void propertyChange(final PropertyChangeEvent e) { final String propertyName = e.getPropertyName(); - final JSpinner spinner = (JSpinner)(e.getSource()); + final JSpinner spinner = (JSpinner) (e.getSource()); final SpinnerUI spinnerUI = spinner.getUI(); if (spinnerUI instanceof AquaSpinnerUI) { - final AquaSpinnerUI ui = (AquaSpinnerUI)spinnerUI; + final AquaSpinnerUI ui = (AquaSpinnerUI) spinnerUI; if ("editor".equals(propertyName)) { - final JComponent oldEditor = (JComponent)e.getOldValue(); - final JComponent newEditor = (JComponent)e.getNewValue(); + final JComponent oldEditor = (JComponent) e.getOldValue(); + final JComponent newEditor = (JComponent) e.getNewValue(); ui.replaceEditor(oldEditor, newEditor); ui.updateEnabledState(); + } else if ("componentOrientation".equals(propertyName)) { + ComponentOrientation o + = (ComponentOrientation) e.getNewValue(); + if (o != e.getOldValue()) { + JComponent editor = spinner.getEditor(); + if (editor != null) { + editor.applyComponentOrientation(o); + } + spinner.revalidate(); + spinner.repaint(); + } } else if ("enabled".equals(propertyName)) { ui.updateEnabledState(); } else if (JComponent.TOOL_TIP_TEXT_KEY.equals(propertyName)) { @@ -683,8 +735,8 @@ public class AquaSpinnerUI extends SpinnerUI { } else if ("font".equals(propertyName)) { JComponent editor = spinner.getEditor(); if (editor instanceof JSpinner.DefaultEditor) { - JTextField tf = - ((JSpinner.DefaultEditor) editor).getTextField(); + JTextField tf + = ((JSpinner.DefaultEditor) editor).getTextField(); if (tf != null) { if (tf.getFont() instanceof UIResource) { tf.setFont(new FontUIResource(spinner.getFont())); @@ -703,12 +755,12 @@ public class AquaSpinnerUI extends SpinnerUI { final Component[] children = spinnerComponent.getComponents(); for (final Component element : children) { if (element instanceof JSpinner.DefaultEditor) { - final JTextField tf = ((JSpinner.DefaultEditor)element).getTextField(); + final JTextField tf = ((JSpinner.DefaultEditor) element).getTextField(); if (tf != null) { tf.setToolTipText(toolTipText); } } else if (element instanceof JComponent) { - ((JComponent)element).setToolTipText(toolTipText); + ((JComponent) element).setToolTipText(toolTipText); } } } diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java index 94d69294407..92df95b6db2 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java @@ -235,9 +235,9 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing } /** - * Invoked by installUI to create + * Invoked by {@code installUI} to create * a layout manager object to manage - * the JTabbedPane. + * the {@code JTabbedPane}. * * @return a layout manager object * @@ -536,7 +536,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Sets the tab the mouse is over by location. This is a cover method - * for setRolloverTab(tabForCoordinate(x, y, false)). + * for {@code setRolloverTab(tabForCoordinate(x, y, false))}. */ private void setRolloverTab(final int x, final int y) { // NOTE: @@ -547,8 +547,8 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing } /** - * Sets the tab the mouse is currently over to index. - * index will be -1 if the mouse is no longer over any + * Sets the tab the mouse is currently over to {@code index}. + * {@code index} will be -1 if the mouse is no longer over any * tab. No checking is done to ensure the passed in index identifies a * valid tab. * @@ -676,7 +676,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Returns the amount the baseline is offset by. This is typically - * the same as getTabLabelShiftY. + * the same as {@code getTabLabelShiftY}. * * @return amount to offset the baseline by * @since 1.6 @@ -765,10 +765,10 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Paints the tabs in the tab area. * Invoked by paint(). - * The graphics parameter must be a valid Graphics + * The graphics parameter must be a valid {@code Graphics} * object. Tab placement may be either: - * JTabbedPane.TOP, JTabbedPane.BOTTOM, - * JTabbedPane.LEFT, or JTabbedPane.RIGHT. + * {@code JTabbedPane.TOP}, {@code JTabbedPane.BOTTOM}, + * {@code JTabbedPane.LEFT}, or {@code JTabbedPane.RIGHT}. * The selected index must be a valid tabbed pane tab index (0 to * tab count - 1, inclusive) or -1 if no tab is currently selected. * The handling of invalid parameters is unspecified. @@ -1406,7 +1406,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing * designated Rectangle object (rather than instantiating and returning * a new Rectangle each time). The tab index parameter must be a valid * tabbed pane tab index (0 to tab count - 1, inclusive). The destination - * rectangle parameter must be a valid Rectangle instance. + * rectangle parameter must be a valid {@code Rectangle} instance. * The handling of invalid parameters is unspecified. * * @param tabIndex the index of the tab @@ -3717,7 +3717,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * An ActionMap that populates its contents as necessary. The - * contents are populated by invoking the loadActionMap + * contents are populated by invoking the {@code loadActionMap} * method on the passed in Object. * * @version 1.6, 11/17/05 @@ -3726,14 +3726,14 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing @SuppressWarnings("serial") // Superclass is not serializable across versions static class LazyActionMap extends ActionMapUIResource { /** - * Object to invoke loadActionMap on. This may be + * Object to invoke {@code loadActionMap} on. This may be * a Class object. */ private transient Object _loader; /** * Installs an ActionMap that will be populated by invoking the - * loadActionMap method on the specified Class + * {@code loadActionMap} method on the specified Class * when necessary. *

* This should be used if the ActionMap can be shared. @@ -3755,7 +3755,7 @@ public class AquaTabbedPaneCopyFromBasicUI extends TabbedPaneUI implements Swing /** * Returns an ActionMap that will be populated by invoking the - * loadActionMap method on the specified Class + * {@code loadActionMap} method on the specified Class * when necessary. *

* This should be used if the ActionMap can be shared. diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java index 1b73f2a987a..2de5975051a 100644 --- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java +++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaTreeUI.java @@ -179,8 +179,8 @@ public class AquaTreeUI extends BasicTreeUI { } /** - * Paints the expand (toggle) part of a row. The receiver should NOT modify clipBounds, or - * insets. + * Paints the expand (toggle) part of a row. The receiver should NOT modify {@code clipBounds}, or + * {@code insets}. */ protected void paintExpandControl(final Graphics g, final Rectangle clipBounds, final Insets insets, final Rectangle bounds, final TreePath path, final int row, final boolean isExpanded, final boolean hasBeenExpanded, final boolean isLeaf) { final Object value = path.getLastPathComponent(); diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java index 0eb6db7e6e0..d3203da3980 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java +++ b/jdk/src/java.desktop/macosx/classes/sun/font/NativeFont.java @@ -41,7 +41,7 @@ public class NativeFont extends PhysicalFont { /** * Verifies native font is accessible. - * @throws FontFormatException - if the font can't be located. + * @throws FontFormatException if the font can't be located. */ public NativeFont(String platName, boolean isBitmapDelegate) throws FontFormatException { diff --git a/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java b/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java index 08f5ef206e9..8447ba159d1 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java +++ b/jdk/src/java.desktop/macosx/classes/sun/java2d/DataBufferNIOInt.java @@ -37,10 +37,10 @@ public final class DataBufferNIOInt extends DataBuffer { IntBuffer bankdata[]; /** - * Constructs an integer-based DataBuffer with a single bank + * Constructs an integer-based {@code DataBuffer} with a single bank * and the specified size. * - * @param size The size of the DataBuffer. + * @param size The size of the {@code DataBuffer}. */ public DataBufferNIOInt(int size) { super(TYPE_INT,size); @@ -51,7 +51,7 @@ public final class DataBufferNIOInt extends DataBuffer { } /** - * Returns the default (first) IntBuffer in DataBuffer. + * Returns the default (first) IntBuffer in {@code DataBuffer}. * * @return The first IntBuffer. */ @@ -70,7 +70,7 @@ public final class DataBufferNIOInt extends DataBuffer { } /** - * Returns the default (first) int data array in DataBuffer. + * Returns the default (first) int data array in {@code DataBuffer}. * * @return The first integer data array. */ @@ -137,7 +137,7 @@ public final class DataBufferNIOInt extends DataBuffer { /** * Sets the requested data array element in the specified bank - * to the integer value i. + * to the integer value {@code i}. * @param bank The bank in which you want to set the data array element. * @param i The data array element you want to set. * @param val The integer value to which you want to set the specified data array element. diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java index 39e5afe9f81..1bc37a7aa46 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CDesktopPeer.java @@ -33,7 +33,7 @@ import java.net.URI; /** - * Concrete implementation of the interface DesktopPeer for MacOS X + * Concrete implementation of the interface {@code DesktopPeer} for MacOS X * * @see DesktopPeer */ diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java index a1606d2f959..276e0f9260a 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CInputMethod.java @@ -101,7 +101,7 @@ public class CInputMethod extends InputMethodAdapter { * method. * * @param context the input method context for this input method - * @exception NullPointerException if context is null + * @exception NullPointerException if {@code context} is null */ public void setInputMethodContext(InputMethodContext context) { fIMContext = context; @@ -124,7 +124,7 @@ public class CInputMethod extends InputMethodAdapter { * * @param lang locale to input * @return whether the specified locale is supported - * @exception NullPointerException if locale is null + * @exception NullPointerException if {@code locale} is null */ public boolean setLocale(Locale lang) { return setLocale(lang, false); @@ -205,7 +205,7 @@ public class CInputMethod extends InputMethodAdapter { * are dispatched to the current input method for this component before * they are dispatched to the component's methods or event listeners. * The input method decides whether it needs to handle the event. If it - * does, it also calls the event's consume method; this + * does, it also calls the event's {@code consume} method; this * causes the event to not get dispatched to the component's event * processing methods or event listeners. *

@@ -216,7 +216,7 @@ public class CInputMethod extends InputMethodAdapter { * This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}. * * @param event the event being dispatched to the input method - * @exception NullPointerException if event is null + * @exception NullPointerException if {@code event} is null */ public void dispatchEvent(final AWTEvent event) { // No-op for Mac OS X. diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java index 5457b1f291a..8d8c00b6a19 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java @@ -75,8 +75,7 @@ final class CPlatformResponder { jclickCount = clickCount; } - int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber, - modifierFlags); + int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags); boolean jpopupTrigger = NSEvent.isPopupTrigger(jmodifiers); eventNotifier.notifyMouseEvent(jeventType, System.currentTimeMillis(), jbuttonNumber, @@ -90,9 +89,7 @@ final class CPlatformResponder { void handleScrollEvent(final int x, final int y, final int absX, final int absY, final int modifierFlags, final double deltaX, final double deltaY) { - final int buttonNumber = CocoaConstants.kCGMouseButtonCenter; - int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber, - modifierFlags); + int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags); final boolean isShift = (jmodifiers & InputEvent.SHIFT_DOWN_MASK) != 0; // Vertical scroll. @@ -187,8 +184,7 @@ final class CPlatformResponder { postsTyped = false; } - - int jmodifiers = NSEvent.nsToJavaKeyModifiers(modifierFlags); + int jmodifiers = NSEvent.nsToJavaModifiers(modifierFlags); long when = System.currentTimeMillis(); if (jeventType == KeyEvent.KEY_PRESSED) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java index c47b213b3a7..7450508cdfb 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterDevice.java @@ -35,8 +35,8 @@ public class CPrinterDevice extends GraphicsDevice { } /** - * Returns the type of this GraphicsDevice. - * @return the type of this GraphicsDevice, which can + * Returns the type of this {@code GraphicsDevice}. + * @return the type of this {@code GraphicsDevice}, which can * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER. * @see #TYPE_RASTER_SCREEN * @see #TYPE_PRINTER @@ -48,30 +48,30 @@ public class CPrinterDevice extends GraphicsDevice { /** * Returns the identification string associated with this - * GraphicsDevice. - * @return a String that is the identification - * of this GraphicsDevice. + * {@code GraphicsDevice}. + * @return a {@code String} that is the identification + * of this {@code GraphicsDevice}. */ public String getIDstring() { return ("Printer"); } /** - * Returns all of the GraphicsConfiguration - * objects associated with this GraphicsDevice. - * @return an array of GraphicsConfiguration + * Returns all of the {@code GraphicsConfiguration} + * objects associated with this {@code GraphicsDevice}. + * @return an array of {@code GraphicsConfiguration} * objects that are associated with this - * GraphicsDevice. + * {@code GraphicsDevice}. */ public GraphicsConfiguration[] getConfigurations() { return new GraphicsConfiguration[] { gc }; } /** - * Returns the default GraphicsConfiguration - * associated with this GraphicsDevice. - * @return the default GraphicsConfiguration - * of this GraphicsDevice. + * Returns the default {@code GraphicsConfiguration} + * associated with this {@code GraphicsDevice}. + * @return the default {@code GraphicsConfiguration} + * of this {@code GraphicsDevice}. */ public GraphicsConfiguration getDefaultConfiguration() { return gc; diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java index 89363a5b907..64f564abc1c 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterGraphicsConfig.java @@ -49,9 +49,9 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns the {@link GraphicsDevice} associated with this - * GraphicsConfiguration. - * @return a GraphicsDevice object that is - * associated with this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code GraphicsDevice} object that is + * associated with this {@code GraphicsConfiguration}. */ public GraphicsDevice getDevice() { return gd; @@ -59,16 +59,16 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns a {@link BufferedImage} with a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has + * a device. The returned {@code BufferedImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. */ public BufferedImage createCompatibleImage(int width, int height) { return createCompatibleImage(width, height, Transparency.OPAQUE); @@ -76,15 +76,15 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration. - * The returned VolatileImage + * compatible with this {@code GraphicsConfiguration}. + * The returned {@code VolatileImage} * may have data that is stored optimally for the underlying graphics * device and may therefore benefit from platform-specific rendering * acceleration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @see Component#createVolatileImage(int, int) */ public VolatileImage createCompatibleVolatileImage(int width, int height) { @@ -97,18 +97,18 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { } /** - * Returns a BufferedImage that supports the specified + * Returns a {@code BufferedImage} that supports the specified * transparency and has a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has a layout and + * a device. The returned {@code BufferedImage} has a layout and * color model that can be optimally blitted to a device - * with this GraphicsConfiguration. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage + * with this {@code GraphicsConfiguration}. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} * @param transparency the specified transparency mode - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration} * and also supports the specified transparency. * @see Transparency#OPAQUE * @see Transparency#BITMASK @@ -121,21 +121,21 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns the {@link ColorModel} associated with this - * GraphicsConfiguration. - * @return a ColorModel object that is associated with - * this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration}. */ public ColorModel getColorModel() { return getColorModel(Transparency.OPAQUE); } /** - * Returns the ColorModel associated with this - * GraphicsConfiguration that supports the specified + * Returns the {@code ColorModel} associated with this + * {@code GraphicsConfiguration} that supports the specified * transparency. * @param transparency the specified transparency mode - * @return a ColorModel object that is associated with - * this GraphicsConfiguration and supports the + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration} and supports the * specified transparency. */ public ColorModel getColorModel(int transparency) { @@ -144,22 +144,22 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * Returns the default {@link AffineTransform} for this - * GraphicsConfiguration. This - * AffineTransform is typically the Identity transform - * for most normal screens. The default AffineTransform + * {@code GraphicsConfiguration}. This + * {@code AffineTransform} is typically the Identity transform + * for most normal screens. The default {@code AffineTransform} * maps coordinates onto the device such that 72 user space * coordinate units measure approximately 1 inch in device * space. The normalizing transform can be used to make * this mapping more exact. Coordinates in the coordinate space - * defined by the default AffineTransform for screen and + * defined by the default {@code AffineTransform} for screen and * printer devices have the origin in the upper left-hand corner of * the target region of the device, with X coordinates * increasing to the right and Y coordinates increasing downwards. * For image buffers not associated with a device, such as those not - * created by createCompatibleImage, - * this AffineTransform is the Identity transform. - * @return the default AffineTransform for this - * GraphicsConfiguration. + * created by {@code createCompatibleImage}, + * this {@code AffineTransform} is the Identity transform. + * @return the default {@code AffineTransform} for this + * {@code GraphicsConfiguration}. */ public AffineTransform getDefaultTransform() { return new AffineTransform(); @@ -167,9 +167,9 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { /** * - * Returns a AffineTransform that can be concatenated - * with the default AffineTransform - * of a GraphicsConfiguration so that 72 units in user + * Returns a {@code AffineTransform} that can be concatenated + * with the default {@code AffineTransform} + * of a {@code GraphicsConfiguration} so that 72 units in user * space equals 1 inch in device space. *

* For a particular {@link Graphics2D}, g, one @@ -181,16 +181,16 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { * g.setTransform(gc.getDefaultTransform()); * g.transform(gc.getNormalizingTransform()); * - * Note that sometimes this AffineTransform is identity, + * Note that sometimes this {@code AffineTransform} is identity, * such as for printers or metafile output, and that this - * AffineTransform is only as accurate as the information + * {@code AffineTransform} is only as accurate as the information * supplied by the underlying system. For image buffers not * associated with a device, such as those not created by - * createCompatibleImage, this - * AffineTransform is the Identity transform + * {@code createCompatibleImage}, this + * {@code AffineTransform} is the Identity transform * since there is no valid distance measurement. - * @return an AffineTransform to concatenate to the - * default AffineTransform so that 72 units in user + * @return an {@code AffineTransform} to concatenate to the + * default {@code AffineTransform} so that 72 units in user * space is mapped to 1 inch in device space. */ public AffineTransform getNormalizingTransform() { @@ -198,12 +198,12 @@ public class CPrinterGraphicsConfig extends GraphicsConfiguration { } /** - * Returns the bounds of the GraphicsConfiguration + * Returns the bounds of the {@code GraphicsConfiguration} * in the device coordinates. In a multi-screen environment * with a virtual device, the bounds can have negative X * or Y origins. * @return the bounds of the area covered by this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @since 1.3 */ public Rectangle getBounds() { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java index c28e83bfbf2..491b257765f 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java @@ -83,13 +83,13 @@ public final class CPrinterJob extends RasterPrinterJob { * to these native print services. * To present the cross platform print dialog for all services, * including native ones instead use - * printDialog(PrintRequestAttributeSet). + * {@code printDialog(PrintRequestAttributeSet)}. *

* PrinterJob implementations which can use PrintService's will update * the PrintService for this PrinterJob to reflect the new service * selected by the user. - * @return true if the user does not cancel the dialog; - * false otherwise. + * @return {@code true} if the user does not cancel the dialog; + * {@code false} otherwise. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -117,19 +117,19 @@ public final class CPrinterJob extends RasterPrinterJob { /** * Displays a dialog that allows modification of a - * PageFormat instance. - * The page argument is used to initialize controls + * {@code PageFormat} instance. + * The {@code page} argument is used to initialize controls * in the page setup dialog. * If the user cancels the dialog then this method returns the - * original page object unmodified. + * original {@code page} object unmodified. * If the user okays the dialog then this method returns a new - * PageFormat object with the indicated changes. - * In either case, the original page object is + * {@code PageFormat} object with the indicated changes. + * In either case, the original {@code page} object is * not modified. - * @param page the default PageFormat presented to the + * @param page the default {@code PageFormat} presented to the * user for modification - * @return the original page object if the dialog - * is cancelled; a new PageFormat object + * @return the original {@code page} object if the dialog + * is cancelled; a new {@code PageFormat} object * containing the format indicated by the user if the * dialog is acknowledged. * @exception HeadlessException if GraphicsEnvironment.isHeadless() @@ -157,11 +157,11 @@ public final class CPrinterJob extends RasterPrinterJob { } /** - * Clones the PageFormat argument and alters the + * Clones the {@code PageFormat} argument and alters the * clone to describe a default page size and orientation. - * @param page the PageFormat to be cloned and altered - * @return clone of page, altered to describe a default - * PageFormat. + * @param page the {@code PageFormat} to be cloned and altered + * @return clone of {@code page}, altered to describe a default + * {@code PageFormat}. */ @Override public PageFormat defaultPage(PageFormat page) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java index e8bdb1fe6c8..940858e1d4f 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java @@ -73,7 +73,7 @@ class CRobot implements RobotPeer { * Presses one or more mouse buttons. * * @param buttons the button mask (combination of - * InputEvent.BUTTON1/2/3_MASK) + * {@code InputEvent.BUTTON1/2/3_MASK}) */ @Override public void mousePress(int buttons) { @@ -87,7 +87,7 @@ class CRobot implements RobotPeer { * Releases one or more mouse buttons. * * @param buttons the button mask (combination of - * InputEvent.BUTTON1/2/3_MASK) + * {@code InputEvent.BUTTON1/2/3_MASK}) */ @Override public void mouseRelease(int buttons) { @@ -133,14 +133,14 @@ class CRobot implements RobotPeer { * Presses a given key. *

* Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. *

* Assumes that the * peer implementations will throw an exception for other bogus * values e.g. -1, 999999 * - * @param keycode the key to press (e.g. KeyEvent.VK_A) + * @param keycode the key to press (e.g. {@code KeyEvent.VK_A}) */ @Override public void keyPress(final int keycode) { @@ -151,14 +151,14 @@ class CRobot implements RobotPeer { * Releases a given key. *

* Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. *

* Assumes that the * peer implementations will throw an exception for other bogus * values e.g. -1, 999999 * - * @param keycode the key to release (e.g. KeyEvent.VK_A) + * @param keycode the key to release (e.g. {@code KeyEvent.VK_A}) */ @Override public void keyRelease(final int keycode) { diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java index 0e0d0a475e0..2d82a2eb1c1 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/CTrayIcon.java @@ -214,7 +214,7 @@ public class CTrayIcon extends CFRetainedResource implements TrayIconPeer { jclickCount = nsEvent.getClickCount(); } - int jmodifiers = NSEvent.nsToJavaMouseModifiers(buttonNumber, + int jmodifiers = NSEvent.nsToJavaModifiers( nsEvent.getModifierFlags()); boolean isPopupTrigger = NSEvent.isPopupTrigger(jmodifiers); diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java index 8f9e1459103..cc3d345eb9f 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java @@ -515,13 +515,13 @@ public final class LWCToolkit extends LWToolkit { * key for menu shortcuts. *

* Menu shortcuts, which are embodied in the - * MenuShortcut class, are handled by the - * MenuBar class. + * {@code MenuShortcut} class, are handled by the + * {@code MenuBar} class. *

- * By default, this method returns Event.CTRL_MASK. + * By default, this method returns {@code Event.CTRL_MASK}. * Toolkit implementations should override this method if the * Control key isn't the correct key for accelerators. - * @return the modifier mask on the Event class + * @return the modifier mask on the {@code Event} class * that is used for menu shortcuts on this toolkit. * @see java.awt.MenuBar * @see java.awt.MenuShortcut diff --git a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java index d30a39cdfb9..290e52965a3 100644 --- a/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java +++ b/jdk/src/java.desktop/macosx/classes/sun/lwawt/macosx/NSEvent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -231,16 +231,14 @@ final class NSEvent { return jeventType; } - /* - * Converts NSEvent mouse modifiers to AWT mouse modifiers. + /** + * Converts NSEvent key modifiers to AWT key modifiers. Note that this + * method adds the current mouse state as a mouse modifiers. + * + * @param modifierFlags the NSEvent key modifiers + * @return the java key and mouse modifiers */ - static native int nsToJavaMouseModifiers(int buttonNumber, - int modifierFlags); - - /* - * Converts NSEvent key modifiers to AWT key modifiers. - */ - static native int nsToJavaKeyModifiers(int modifierFlags); + static native int nsToJavaModifiers(int modifierFlags); /* * Converts NSEvent key info to AWT key info. diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m index 51bacfcd5e4..07bb7fab938 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -579,7 +579,7 @@ NSUInteger JavaModifiersToNsKeyModifiers(jint javaModifiers, BOOL isExtMods) } -jint GetJavaMouseModifiers(NSInteger button, NSUInteger modifierFlags) +jint GetJavaMouseModifiers(NSUInteger modifierFlags) { // Mousing needs the key modifiers jint modifiers = NsKeyModifiersToJavaModifiers(modifierFlags, YES); @@ -632,38 +632,18 @@ Java_java_awt_AWTEvent_nativeSetSource /* * Class: sun_lwawt_macosx_NSEvent - * Method: nsToJavaMouseModifiers + * Method: nsToJavaModifiers * Signature: (II)I */ JNIEXPORT jint JNICALL -Java_sun_lwawt_macosx_NSEvent_nsToJavaMouseModifiers -(JNIEnv *env, jclass cls, jint buttonNumber, jint modifierFlags) -{ - jint jmodifiers = 0; - -JNF_COCOA_ENTER(env); - - jmodifiers = GetJavaMouseModifiers(buttonNumber, modifierFlags); - -JNF_COCOA_EXIT(env); - - return jmodifiers; -} - -/* - * Class: sun_lwawt_macosx_NSEvent - * Method: nsToJavaKeyModifiers - * Signature: (I)I - */ -JNIEXPORT jint JNICALL -Java_sun_lwawt_macosx_NSEvent_nsToJavaKeyModifiers +Java_sun_lwawt_macosx_NSEvent_nsToJavaModifiers (JNIEnv *env, jclass cls, jint modifierFlags) { jint jmodifiers = 0; JNF_COCOA_ENTER(env); - jmodifiers = NsKeyModifiersToJavaModifiers(modifierFlags, YES); + jmodifiers = GetJavaMouseModifiers(modifierFlags); JNF_COCOA_EXIT(env); diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m index 994bda41982..79cdf5bf7a3 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m @@ -562,6 +562,17 @@ CGGI_CreateImageForGlyph (CGGI_GlyphCanvas *canvas, const CGGlyph glyph, GlyphInfo *info, const CGGI_RenderingMode *mode) { + if (isnan(info->topLeftX) || isnan(info->topLeftY)) { + // Explicitly set glyphInfo width/height to be 0 to ensure + // zero length glyph image is copied into GlyphInfo from canvas + info->width = 0; + info->height = 0; + + // copy the "empty" glyph from the canvas into the info + (*mode->glyphDescriptor->copyFxnPtr)(canvas, info); + return; + } + // clean the canvas CGGI_ClearCanvas(canvas, info); @@ -570,7 +581,6 @@ CGGI_CreateImageForGlyph -info->topLeftX, canvas->image->height + info->topLeftY, &glyph, 1); - // copy the glyph from the canvas into the info (*mode->glyphDescriptor->copyFxnPtr)(canvas, info); } diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m index 29a579f66b4..4fde4a3825d 100644 --- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m +++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m @@ -259,6 +259,10 @@ AWTGetGlyphOutline(CGGlyph *glyphs, NSFont *font, OSStatus status = noErr; + if ( isnan(tx->a) || isnan(tx->b) || isnan(tx->c) || + isnan(tx->d) || isnan(tx->tx) || isnan(tx->ty)) { + return status; + } glyphs = glyphs + inStartIndex; // advanceArray = advanceArray + inStartIndex; // TODO(cpc): use advance diff --git a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader index 624dac1c026..f0536e70d0e 100644 --- a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader +++ b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileReader @@ -3,4 +3,5 @@ com.sun.media.sound.AuFileReader com.sun.media.sound.AiffFileReader com.sun.media.sound.WaveFileReader com.sun.media.sound.WaveFloatFileReader +com.sun.media.sound.WaveExtensibleFileReader com.sun.media.sound.SoftMidiAudioFileReader diff --git a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter index bd84a769a36..83ac2b98105 100644 --- a/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter +++ b/jdk/src/java.desktop/share/classes/META-INF/services/javax.sound.sampled.spi.AudioFileWriter @@ -2,3 +2,4 @@ com.sun.media.sound.AuFileWriter com.sun.media.sound.AiffFileWriter com.sun.media.sound.WaveFileWriter +com.sun.media.sound.WaveFloatFileWriter diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java index 27a935d715a..5809fff5f25 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageReader.java @@ -74,7 +74,7 @@ import com.sun.imageio.plugins.common.I18N; /** This class is the Java Image IO plugin reader for BMP images. * It may subsample the image, clip the image, select sub-bands, * and shift the decoded image origin if the proper decoding parameter - * are set in the provided ImageReadParam. + * are set in the provided {@code ImageReadParam}. * * This class supports Microsoft Windows Bitmap Version 3-5, * as well as OS/2 Bitmap Version 2.x (for single-image BMP file). @@ -159,8 +159,8 @@ public class BMPImageReader extends ImageReader implements BMPConstants { /** source and destination bands. */ private int[] sourceBands, destBands; - /** Constructs BMPImageReader from the provided - * ImageReaderSpi. + /** Constructs {@code BMPImageReader} from the provided + * {@code ImageReaderSpi}. */ public BMPImageReader(ImageReaderSpi originator) { super(originator); @@ -1681,8 +1681,8 @@ public class BMPImageReader extends ImageReader implements BMPConstants { /** Decodes the jpeg/png image embedded in the bitmap using any jpeg * ImageIO-style plugin. * - * @param bi The destination BufferedImage. - * @param bmpParam The ImageReadParam for decoding this + * @param bi The destination {@code BufferedImage}. + * @param bmpParam The {@code ImageReadParam} for decoding this * BMP image. The parameters for subregion, band selection and * subsampling are used in decoding the jpeg image. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java index fd90e2edbb7..164aa9769ae 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java @@ -69,7 +69,7 @@ import com.sun.imageio.plugins.common.I18N; * a BMP format. * * The encoding process may clip, subsample using the parameters - * specified in the ImageWriteParam. + * specified in the {@code ImageWriteParam}. * * @see javax.imageio.plugins.bmp.BMPImageWriteParam */ @@ -88,8 +88,8 @@ public class BMPImageWriter extends ImageWriter implements BMPConstants { private short[] spixels; private int[] ipixels; - /** Constructs BMPImageWriter based on the provided - * ImageWriterSpi. + /** Constructs {@code BMPImageWriter} based on the provided + * {@code ImageWriterSpi}. */ public BMPImageWriter(ImageWriterSpi originator) { super(originator); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java index 81924044610..b6f73efc712 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/BogusColorSpace.java @@ -28,7 +28,7 @@ package com.sun.imageio.plugins.common; import java.awt.color.ColorSpace; /** - * A dummy ColorSpace to enable ColorModel + * A dummy {@code ColorSpace} to enable {@code ColorModel} * for image data which do not have an innate color representation. */ @SuppressWarnings("serial") // JDK-implementation class @@ -37,8 +37,8 @@ public class BogusColorSpace extends ColorSpace { * Return the type given the number of components. * * @param numComponents The number of components in the - * ColorSpace. - * @exception IllegalArgumentException if numComponents + * {@code ColorSpace}. + * @exception IllegalArgumentException if {@code numComponents} * is less than 1. */ private static int getType(int numComponents) { @@ -62,11 +62,11 @@ public class BogusColorSpace extends ColorSpace { } /** - * Constructs a bogus ColorSpace. + * Constructs a bogus {@code ColorSpace}. * * @param numComponents The number of components in the - * ColorSpace. - * @exception IllegalArgumentException if numComponents + * {@code ColorSpace}. + * @exception IllegalArgumentException if {@code numComponents} * is less than 1. */ public BogusColorSpace(int numComponents) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java index 4c6d36ac695..c2885cf5a8e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/I18NImpl.java @@ -37,9 +37,9 @@ import java.net.URL; * the file from the jar as the package name is included automatically. * *

Extenders need only provide a static method - * getString(String) which calls the static method in this + * {@code getString(String)} which calls the static method in this * class with the name of the invoking class and returns a - * String. + * {@code String}. */ public class I18NImpl { /** diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java index ddaad6e78d6..b7fa186896b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ImageUtil.java @@ -58,35 +58,35 @@ import javax.imageio.spi.ImageWriterSpi; public class ImageUtil { /** - * Creates a ColorModel that may be used with the - * specified SampleModel. If a suitable - * ColorModel cannot be found, this method returns - * null. + * Creates a {@code ColorModel} that may be used with the + * specified {@code SampleModel}. If a suitable + * {@code ColorModel} cannot be found, this method returns + * {@code null}. * - *

Suitable ColorModels are guaranteed to exist - * for all instances of ComponentSampleModel. - * For 1- and 3- banded SampleModels, the returned - * ColorModel will be opaque. For 2- and 4-banded - * SampleModels, the output will use alpha transparency + *

Suitable {@code ColorModel}s are guaranteed to exist + * for all instances of {@code ComponentSampleModel}. + * For 1- and 3- banded {@code SampleModel}s, the returned + * {@code ColorModel} will be opaque. For 2- and 4-banded + * {@code SampleModel}s, the output will use alpha transparency * which is not premultiplied. 1- and 2-banded data will use a - * grayscale ColorSpace, and 3- and 4-banded data a sRGB - * ColorSpace. Data with 5 or more bands will have a - * BogusColorSpace.

+ * grayscale {@code ColorSpace}, and 3- and 4-banded data a sRGB + * {@code ColorSpace}. Data with 5 or more bands will have a + * {@code BogusColorSpace}.

* - *

An instance of DirectColorModel will be created for - * instances of SinglePixelPackedSampleModel with no more + *

An instance of {@code DirectColorModel} will be created for + * instances of {@code SinglePixelPackedSampleModel} with no more * than 4 bands.

* - *

An instance of IndexColorModel will be created for - * instances of MultiPixelPackedSampleModel. The colormap - * will be a grayscale ramp with 1 << numberOfBits + *

An instance of {@code IndexColorModel} will be created for + * instances of {@code MultiPixelPackedSampleModel}. The colormap + * will be a grayscale ramp with 1 << numberOfBits * entries ranging from zero to at most 255.

* - * @return An instance of ColorModel that is suitable for - * the supplied SampleModel, or null. + * @return An instance of {@code ColorModel} that is suitable for + * the supplied {@code SampleModel}, or {@code null}. * - * @throws IllegalArgumentException If sampleModel is - * null. + * @throws IllegalArgumentException If {@code sampleModel} is + * {@code null}. */ public static final ColorModel createColorModel(SampleModel sampleModel) { // Check the parameter. @@ -194,19 +194,19 @@ public class ImageUtil { } /** - * For the case of binary data (isBinary() returns - * true), return the binary data as a packed byte array. + * For the case of binary data ({@code isBinary()} returns + * {@code true}), return the binary data as a packed byte array. * The data will be packed as eight bits per byte with no bit offset, * i.e., the first bit in each image line will be the left-most of the * first byte of the line. The line stride in bytes will be - * (int)((getWidth()+7)/8). The length of the returned - * array will be the line stride multiplied by getHeight() + * {@code (int)((getWidth()+7)/8)}. The length of the returned + * array will be the line stride multiplied by {@code getHeight()} * * @return the binary data as a packed array of bytes with zero offset - * of null if the data are not binary. - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * of {@code null} if the data are not binary. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static byte[] getPackedBinaryData(Raster raster, Rectangle rect) { @@ -387,11 +387,11 @@ public class ImageUtil { /** * Returns the binary data unpacked into an array of bytes. - * The line stride will be the width of the Raster. + * The line stride will be the width of the {@code Raster}. * - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static byte[] getUnpackedBinaryData(Raster raster, Rectangle rect) { @@ -467,13 +467,13 @@ public class ImageUtil { } /** - * Sets the supplied Raster's data from an array + * Sets the supplied {@code Raster}'s data from an array * of packed binary data of the form returned by - * getPackedBinaryData(). + * {@code getPackedBinaryData()}. * - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static void setPackedBinaryData(byte[] binaryDataArray, WritableRaster raster, @@ -713,16 +713,16 @@ public class ImageUtil { } /** - * Copies data into the packed array of the Raster + * Copies data into the packed array of the {@code Raster} * from an array of unpacked data of the form returned by - * getUnpackedBinaryData(). + * {@code getUnpackedBinaryData()}. * *

If the data are binary, then the target bit will be set if * and only if the corresponding byte is non-zero. * - * @throws IllegalArgumentException if isBinary() returns - * false with the SampleModel of the - * supplied Raster as argument. + * @throws IllegalArgumentException if {@code isBinary()} returns + * {@code false} with the {@code SampleModel} of the + * supplied {@code Raster} as argument. */ public static void setUnpackedBinaryData(byte[] bdata, WritableRaster raster, @@ -983,7 +983,7 @@ public class ImageUtil { * @param g The green channel color indices. * @param b The blue channel color indices. * @return If all the indices have 256 entries, and are identical mappings, - * return true; otherwise, return false. + * return {@code true}; otherwise, return {@code false}. */ public static boolean isIndicesForGrayscale(byte[] r, byte[] g, byte[] b) { if (r.length != g.length || r.length != b.length) @@ -1004,7 +1004,7 @@ public class ImageUtil { return true; } - /** Converts the provided object to String */ + /** Converts the provided object to {@code String} */ public static String convertObjectToString(Object obj) { if (obj == null) return ""; @@ -1035,10 +1035,10 @@ public class ImageUtil { } - /** Checks that the provided ImageWriter can encode - * the provided ImageTypeSpecifier or not. If not, an - * IIOException will be thrown. - * @param writer The provided ImageWriter. + /** Checks that the provided {@code ImageWriter} can encode + * the provided {@code ImageTypeSpecifier} or not. If not, an + * {@code IIOException} will be thrown. + * @param writer The provided {@code ImageWriter}. * @param type The image to be tested. * @throws IIOException If the writer cannot encoded the provided image. */ @@ -1053,12 +1053,12 @@ public class ImageUtil { } } - /** Checks that the provided ImageWriter can encode - * the provided ColorModel and SampleModel. - * If not, an IIOException will be thrown. - * @param writer The provided ImageWriter. - * @param colorModel The provided ColorModel. - * @param sampleModel The provided SampleModel. + /** Checks that the provided {@code ImageWriter} can encode + * the provided {@code ColorModel} and {@code SampleModel}. + * If not, an {@code IIOException} will be thrown. + * @param writer The provided {@code ImageWriter}. + * @param colorModel The provided {@code ColorModel}. + * @param sampleModel The provided {@code SampleModel}. * @throws IIOException If the writer cannot encoded the provided image. */ public static final void canEncodeImage(ImageWriter writer, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java index c90ed4b2b44..645c8e7fc54 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/LZWStringTable.java @@ -31,9 +31,9 @@ import java.io.PrintStream; * General purpose LZW String Table. * Extracted from GIFEncoder by Adam Doppelt * Comments added by Robin Luiten - * expandCode added by Robin Luiten + * {@code expandCode} added by Robin Luiten * The strLen table to give quick access to the lenght of an expanded - * code for use by the expandCode method added by Robin. + * code for use by the {@code expandCode} method added by Robin. **/ public class LZWStringTable { /** codesize + Reserved Codes */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java index 35506ecdca5..4eae8a8f402 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/PaletteBuilder.java @@ -70,19 +70,19 @@ public class PaletteBuilder { /** * Creates an image representing given image - * src using IndexColorModel. + * {@code src} using {@code IndexColorModel}. * * Lossless conversion is not always possible (e.g. if number * of colors in the given image exceeds maximum palette size). * Result image then is an approximation constructed by octree * quantization method. * - * @exception IllegalArgumentException if src is - * null. + * @exception IllegalArgumentException if {@code src} is + * {@code null}. * * @exception UnsupportedOperationException if implemented method - * is unable to create approximation of src - * and canCreatePalette returns false. + * is unable to create approximation of {@code src} + * and {@code canCreatePalette} returns {@code false}. * * @see createIndexColorModel * @@ -97,15 +97,15 @@ public class PaletteBuilder { /** * Creates an palette representing colors from given image - * img. If number of colors in the given image exceeds + * {@code img}. If number of colors in the given image exceeds * maximum palette size closest colors would be merged. * - * @exception IllegalArgumentException if img is - * null. + * @exception IllegalArgumentException if {@code img} is + * {@code null}. * * @exception UnsupportedOperationException if implemented method - * is unable to create approximation of img - * and canCreatePalette returns false. + * is unable to create approximation of {@code img} + * and {@code canCreatePalette} returns {@code false}. * * @see createIndexedImage * @@ -119,17 +119,17 @@ public class PaletteBuilder { } /** - * Returns true if PaletteBuilder is able to create + * Returns {@code true} if PaletteBuilder is able to create * palette for given image type. * - * @param type an instance of ImageTypeSpecifier to be + * @param type an instance of {@code ImageTypeSpecifier} to be * indexed. * - * @return true if the PaletteBuilder + * @return {@code true} if the {@code PaletteBuilder} * is likely to be able to create palette for this image type. * - * @exception IllegalArgumentException if type - * is null. + * @exception IllegalArgumentException if {@code type} + * is {@code null}. */ public static boolean canCreatePalette(ImageTypeSpecifier type) { if (type == null) { @@ -139,17 +139,17 @@ public class PaletteBuilder { } /** - * Returns true if PaletteBuilder is able to create + * Returns {@code true} if PaletteBuilder is able to create * palette for given rendered image. * - * @param image an instance of RenderedImage to be + * @param image an instance of {@code RenderedImage} to be * indexed. * - * @return true if the PaletteBuilder + * @return {@code true} if the {@code PaletteBuilder} * is likely to be able to create palette for this image type. * - * @exception IllegalArgumentException if image - * is null. + * @exception IllegalArgumentException if {@code image} + * is {@code null}. */ public static boolean canCreatePalette(RenderedImage image) { if (image == null) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java index cedc428c3b4..0f8d1d66a28 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java @@ -134,25 +134,25 @@ public class ReaderUtil { * pixels that will be written during a particular decoding pass. * The intent is to simplify the work done by readers in combining * the source region, source subsampling, and destination offset - * information obtained from the ImageReadParam with + * information obtained from the {@code ImageReadParam} with * the offsets and periods of a progressive or interlaced decoding * pass. * - * @param sourceRegion a Rectangle containing the + * @param sourceRegion a {@code Rectangle} containing the * source region being read, offset by the source subsampling * offsets, and clipped against the source bounds, as returned by - * the getSourceRegion method. - * @param destinationOffset a Point containing the + * the {@code getSourceRegion} method. + * @param destinationOffset a {@code Point} containing the * coordinates of the upper-left pixel to be written in the * destination. * @param dstMinX the smallest X coordinate (inclusive) of the - * destination Raster. + * destination {@code Raster}. * @param dstMinY the smallest Y coordinate (inclusive) of the - * destination Raster. + * destination {@code Raster}. * @param dstMaxX the largest X coordinate (inclusive) of the destination - * Raster. + * {@code Raster}. * @param dstMaxY the largest Y coordinate (inclusive) of the destination - * Raster. + * {@code Raster}. * @param sourceXSubsampling the X subsampling factor. * @param sourceYSubsampling the Y subsampling factor. * @param passXStart the smallest source X coordinate (inclusive) @@ -168,7 +168,7 @@ public class ReaderUtil { * @param passPeriodY the Y period (vertical spacing between * pixels) of the current progressive pass. * - * @return an array of 6 ints containing the + * @return an array of 6 {@code int}s containing the * destination min X, min Y, width, height, X period and Y period * of the region that will be updated. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java index 82814627077..74ac23eb62e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java @@ -1017,7 +1017,7 @@ public class GIFImageReader extends ImageReader { /** * Remove all settings including global settings such as - * Locales and listeners, as well as stream settings. + * {@code Locale}s and listeners, as well as stream settings. */ public void reset() { super.reset(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java index 0c4fc02e038..afb81aa2307 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java @@ -70,7 +70,7 @@ public class GIFImageWriter extends ImageWriter { GIFWritableImageMetadata.NATIVE_FORMAT_NAME; /** - * The output case to an ImageOutputStream. + * The {@code output} case to an {@code ImageOutputStream}. */ private ImageOutputStream stream = null; @@ -272,7 +272,7 @@ public class GIFImageWriter extends ImageWriter { } /** - * Merges inData into outData. The supplied + * Merges {@code inData} into {@code outData}. The supplied * metadata format name is attempted first and failing that the standard * metadata format name is attempted. */ @@ -554,8 +554,8 @@ public class GIFImageWriter extends ImageWriter { * * @param writeHeader Whether to write the header. * @param writeTrailer Whether to write the trailer. - * @param sm The stream metadata or null if - * writeHeader is false. + * @param sm The stream metadata or {@code null} if + * {@code writeHeader} is {@code false}. * @param iioimage The image and image metadata. * @param p The write parameters. * @@ -564,10 +564,10 @@ public class GIFImageWriter extends ImageWriter { * greater than 8. * @throws IllegalArgumentException if the color component size is * greater than 8. - * @throws IllegalArgumentException if writeHeader is - * true and sm is null. - * @throws IllegalArgumentException if writeHeader is - * false and a sequence is not being written. + * @throws IllegalArgumentException if {@code writeHeader} is + * {@code true} and {@code sm} is {@code null}. + * @throws IllegalArgumentException if {@code writeHeader} is + * {@code false} and a sequence is not being written. */ private void write(boolean writeHeader, boolean writeTrailer, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java index 7e03f0fb98a..3aca0e5c356 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFMetadata.java @@ -32,7 +32,7 @@ import org.w3c.dom.Node; /** * Class which adds utility DOM element attribute access methods to - * IIOMetadata for subclass use. + * {@code IIOMetadata} for subclass use. */ abstract class GIFMetadata extends IIOMetadata { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java index c53cf35c865..d4a996ee3ee 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/COMMarkerSegment.java @@ -39,7 +39,7 @@ import org.w3c.dom.Node; * comment data as it is read from the stream. If the marker segment is * constructed from a String, then local default encoding is assumed * when creating the byte array. If the marker segment is created from - * an IIOMetadataNode, the user object, if present is + * an {@code IIOMetadataNode}, the user object, if present is * assumed to be a byte array containing the comment data. If there is * no user object then the comment attribute is used to create the * byte array, again assuming the default local encoding. @@ -49,7 +49,7 @@ class COMMarkerSegment extends MarkerSegment { /** * Constructs a marker segment from the given buffer, which contains - * data from an ImageInputStream. This is used when + * data from an {@code ImageInputStream}. This is used when * reading metadata from a stream. */ COMMarkerSegment(JPEGBuffer buffer) throws IOException { @@ -69,7 +69,7 @@ class COMMarkerSegment extends MarkerSegment { /** * Constructs a marker segment from a native tree node. If the node - * is an IIOMetadataNode and contains a user object, + * is an {@code IIOMetadataNode} and contains a user object, * that object is used rather than the string attribute. If the * string attribute is used, the default encoding is used. */ @@ -103,7 +103,7 @@ class COMMarkerSegment extends MarkerSegment { } /** - * Returns an IIOMetadataNode containing the data array + * Returns an {@code IIOMetadataNode} containing the data array * as a user object and a string encoded using ISO-8895-1, as an * attribute. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java index fb59d7b2119..b42eec68d10 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JFIFMarkerSegment.java @@ -90,7 +90,7 @@ class JFIFMarkerSegment extends MarkerSegment { private final boolean debug = false; /** - * Set to true when reading the chunks of an + * Set to {@code true} when reading the chunks of an * ICC profile. All chunks are consolidated to create a single * "segment" containing all the chunks. This flag is a state * variable identifying whether to construct a new segment or @@ -594,10 +594,10 @@ class JFIFMarkerSegment extends MarkerSegment { /** * Writes out a default JFIF marker segment to the given - * output stream. If thumbnails is not null, + * output stream. If {@code thumbnails} is not {@code null}, * writes out the set of thumbnail images as JFXX marker segments, or * incorporated into the JFIF segment if appropriate. - * If iccProfile is not null, + * If {@code iccProfile} is not {@code null}, * writes out the profile after the JFIF segment using as many APP2 * marker segments as necessary. */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java index e18e9509e22..8acbf84bd8a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEG.java @@ -36,7 +36,7 @@ import java.awt.color.ICC_ColorSpace; /** * A class containing JPEG-related constants, definitions, and * static methods. This class and its constants must be public so that - * JPEGImageWriteParam can see it. + * {@code JPEGImageWriteParam} can see it. */ public class JPEG { @@ -234,10 +234,10 @@ public class JPEG { public static final float DEFAULT_QUALITY = 0.75F; /** - * Returns true if the given ColorSpace + * Returns {@code true} if the given {@code ColorSpace} * object is an instance of ICC_ColorSpace but is not one of the - * standard ColorSpaces returned by - * ColorSpace.getInstance(). + * standard {@code ColorSpaces} returned by + * {@code ColorSpace.getInstance()}. */ static boolean isNonStandardICC(ColorSpace cs) { boolean retval = false; @@ -255,8 +255,8 @@ public class JPEG { /** - * Returns true if the given imageType can be used - * in a JFIF file. If input is true, then the + * Returns {@code true} if the given imageType can be used + * in a JFIF file. If {@code input} is true, then the * image type is considered before colorspace conversion. */ static boolean isJFIFcompliant(ImageTypeSpecifier imageType, @@ -295,7 +295,7 @@ public class JPEG { /** * Given an image type, return the Adobe transform corresponding to * that type, or ADOBE_IMPOSSIBLE if the image type is incompatible - * with an Adobe marker segment. If input is true, then + * with an Adobe marker segment. If {@code input} is true, then * the image type is considered before colorspace conversion. */ static int transformForType(ImageTypeSpecifier imageType, boolean input) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java index 60bdbf08772..9c2f8b26088 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGBuffer.java @@ -75,12 +75,12 @@ class JPEGBuffer { } /** - * Ensures that there are at least count bytes available + * Ensures that there are at least {@code count} bytes available * in the buffer, loading more data and moving any remaining * bytes to the front. A count of 0 means to just fill the buffer. * If the count is larger than the buffer size, just fills the buffer. * If the end of the stream is encountered before a non-0 count can - * be satisfied, an IIOException is thrown with the + * be satisfied, an {@code IIOException} is thrown with the * message "Image Format Error". */ void loadBuf(int count) throws IOException { @@ -122,7 +122,7 @@ class JPEGBuffer { * the buffer and then reading directly from the stream * if necessary. The buffer is left in an appropriate * state. If the end of the stream is encountered, an - * IIOException is thrown with the + * {@code IIOException} is thrown with the * message "Image Format Error". */ void readData(byte [] data) throws IOException { @@ -149,9 +149,9 @@ class JPEGBuffer { } /** - * Skips count bytes, leaving the buffer + * Skips {@code count} bytes, leaving the buffer * in an appropriate state. If the end of the stream is - * encountered, an IIOException is thrown with the + * encountered, an {@code IIOException} is thrown with the * message "Image Format Error". */ void skipData(int count) throws IOException { @@ -195,8 +195,8 @@ class JPEGBuffer { * the buffer as necessary. The buffer position is left * pointing to the first non-0xff byte after a run of * 0xff bytes. If the end of the stream is encountered, - * an EOI marker is inserted into the buffer and true - * is returned. Otherwise returns false. + * an EOI marker is inserted into the buffer and {@code true} + * is returned. Otherwise returns {@code false}. */ boolean scanForFF(JPEGImageReader reader) throws IOException { boolean retval = false; diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index 5a0e560f9ae..1773b200f65 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -544,7 +544,7 @@ public class JPEGImageReader extends ImageReader { } /** - * Returns true if there is an image beyond + * Returns {@code true} if there is an image beyond * the current stream position. Does not disturb the * stream position. */ @@ -614,13 +614,13 @@ public class JPEGImageReader extends ImageReader { /** * Read in the header information starting from the current - * stream position, returning true if the + * stream position, returning {@code true} if the * header was a tables-only image. After this call, the * native IJG decompression struct will contain the image * information required by most query calls below * (e.g. getWidth, getHeight, etc.), if the header was not * a tables-only image. - * If reset is true, the state of the IJG + * If reset is {@code true}, the state of the IJG * object is reset so that it can read a header again. * This happens automatically if the header was a tables-only * image. @@ -867,7 +867,7 @@ public class JPEGImageReader extends ImageReader { * Checks the implied color conversion between the stream and * the target image, altering the IJG output color space if necessary. * If a java color conversion is required, then this sets up - * convert. + * {@code convert}. * If bands are being rearranged at all (either source or destination * bands are specified in the param), then the default color * conversions are assumed to be correct. @@ -1394,7 +1394,7 @@ public class JPEGImageReader extends ImageReader { } /** - * Returns true if the read was aborted. + * Returns {@code true} if the read was aborted. */ private native boolean readImage(long structPointer, byte [] buffer, @@ -1788,6 +1788,8 @@ class ImageTypeProducer { case JPEG.JCS_GRAYSCALE: return ImageTypeSpecifier.createFromBufferedImageType (BufferedImage.TYPE_BYTE_GRAY); + case JPEG.JCS_YCbCr: + //there is no YCbCr raw type so by default we assume it as RGB case JPEG.JCS_RGB: return ImageTypeSpecifier.createInterleaved(JPEG.JCS.sRGB, JPEG.bOffsRGB, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java index bc24343f9ba..12b94711cff 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java @@ -1130,10 +1130,10 @@ public class JPEGImageWriter extends ImageWriter { /* * from jpeg_metadata.html: * If no stream metadata is supplied to - * ImageWriter.prepareWriteSequence, then no + * {@code ImageWriter.prepareWriteSequence}, then no * tables-only image is written. If stream metadata containing * no tables is supplied to - * ImageWriter.prepareWriteSequence, then a tables-only + * {@code ImageWriter.prepareWriteSequence}, then a tables-only * image containing default visually lossless tables is written. */ if (streamMetadata != null) { @@ -1699,7 +1699,7 @@ public class JPEGImageWriter extends ImageWriter { private native void setDest(long structPointer); /** - * Returns true if the write was aborted. + * Returns {@code true} if the write was aborted. */ private native boolean writeImage(long structPointer, byte [] data, diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java index 7975efda580..e560a53f3ca 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadata.java @@ -66,17 +66,17 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { private static final boolean debug = false; /** - * A copy of markerSequence, created the first time the - * markerSequence is modified. This is used by reset + * A copy of {@code markerSequence}, created the first time the + * {@code markerSequence} is modified. This is used by reset * to restore the original state. */ private List resetSequence = null; /** - * Set to true when reading a thumbnail stored as + * Set to {@code true} when reading a thumbnail stored as * JPEG. This is used to enforce the prohibition of JFIF thumbnails * containing any JFIF marker segments, and to ensure generation of - * a correct native subtree during getAsTree. + * a correct native subtree during {@code getAsTree}. */ private boolean inThumb = false; @@ -93,7 +93,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { /////// Package-access variables /** - * All data is a list of MarkerSegment objects. + * All data is a list of {@code MarkerSegment} objects. * When accessing the list, use the tag to identify the particular * subclass. Any JFIF marker segment must be the first element * of the list if it is present, and any JFXX or APP2ICC marker @@ -132,17 +132,17 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { } /* - * Constructs a JPEGMetadata object by reading the - * contents of an ImageInputStream. Has package-only + * Constructs a {@code JPEGMetadata} object by reading the + * contents of an {@code ImageInputStream}. Has package-only * access. * * @param isStream A boolean indicating whether this object will be * stream or image metadata. * @param isThumb A boolean indicating whether this metadata object * is for an image or for a thumbnail stored as JPEG. - * @param iis An ImageInputStream from which to read + * @param iis An {@code ImageInputStream} from which to read * the metadata. - * @param reader The JPEGImageReader calling this + * @param reader The {@code JPEGImageReader} calling this * constructor, to which warnings should be sent. */ JPEGMetadata(boolean isStream, @@ -365,7 +365,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { } /** - * Constructs a default stream JPEGMetadata object appropriate + * Constructs a default stream {@code JPEGMetadata} object appropriate * for the given write parameters. */ JPEGMetadata(ImageWriteParam param, JPEGImageWriter writer) { @@ -398,7 +398,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { } /** - * Constructs a default image JPEGMetadata object appropriate + * Constructs a default image {@code JPEGMetadata} object appropriate * for the given image type and write parameters. */ JPEGMetadata(ImageTypeSpecifier imageType, @@ -2248,7 +2248,7 @@ public class JPEGMetadata extends IIOMetadata implements Cloneable { /** * Check that this metadata object is in a consistent state and - * return true if it is or false + * return {@code true} if it is or {@code false} * otherwise. All the constructors and modifiers should call * this method at the end to guarantee that the data is always * consistent, as the writer relies on this. diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java index 63dce67b055..475cc36359e 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGMetadataFormat.java @@ -133,12 +133,12 @@ abstract class JPEGMetadataFormat extends IIOMetadataFormatImpl { } /** - * Returns true if the named element occurs in the + * Returns {@code true} if the named element occurs in the * subtree of the format starting with the node named by - * subtreeName, including the node - * itself. subtreeName may be any node in + * {@code subtreeName}, including the node + * itself. {@code subtreeName} may be any node in * the format. If it is not, an - * IllegalArgumentException is thrown. + * {@code IllegalArgumentException} is thrown. */ protected boolean isInSubtree(String elementName, String subtreeName) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java index 2952635b7f2..6f51fee8b8a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/MarkerSegment.java @@ -51,8 +51,8 @@ class MarkerSegment implements Cloneable { boolean unknown = false; // Set to true if the tag is not recognized /** - * Constructor for creating MarkerSegments by reading - * from an ImageInputStream. + * Constructor for creating {@code MarkerSegment}s by reading + * from an {@code ImageInputStream}. */ MarkerSegment(JPEGBuffer buffer) throws IOException { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java index 278882e5385..e58c7af8b18 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGImageWriter.java @@ -26,16 +26,13 @@ package com.sun.imageio.plugins.png; import java.awt.Rectangle; -import java.awt.image.ColorModel; import java.awt.image.IndexColorModel; import java.awt.image.Raster; import java.awt.image.WritableRaster; import java.awt.image.RenderedImage; import java.awt.image.SampleModel; import java.io.ByteArrayOutputStream; -import java.io.DataOutput; import java.io.IOException; -import java.io.OutputStream; import java.util.Iterator; import java.util.Locale; import java.util.zip.Deflater; @@ -46,14 +43,13 @@ import javax.imageio.ImageTypeSpecifier; import javax.imageio.ImageWriteParam; import javax.imageio.ImageWriter; import javax.imageio.metadata.IIOMetadata; -import javax.imageio.metadata.IIOMetadata; import javax.imageio.spi.ImageWriterSpi; import javax.imageio.stream.ImageOutputStream; import javax.imageio.stream.ImageOutputStreamImpl; -class CRC { +final class CRC { - private static int[] crcTable = new int[256]; + private static final int[] crcTable = new int[256]; private int crc = 0xffffffff; static { @@ -72,23 +68,25 @@ class CRC { } } - public CRC() {} + CRC() {} - public void reset() { + void reset() { crc = 0xffffffff; } - public void update(byte[] data, int off, int len) { + void update(byte[] data, int off, int len) { + int c = crc; for (int n = 0; n < len; n++) { - crc = crcTable[(crc ^ data[off + n]) & 0xff] ^ (crc >>> 8); + c = crcTable[(c ^ data[off + n]) & 0xff] ^ (c >>> 8); } + crc = c; } - public void update(int data) { + void update(int data) { crc = crcTable[(crc ^ data) & 0xff] ^ (crc >>> 8); } - public int getValue() { + int getValue() { return crc ^ 0xffffffff; } } @@ -96,11 +94,11 @@ class CRC { final class ChunkStream extends ImageOutputStreamImpl { - private ImageOutputStream stream; - private long startPos; - private CRC crc = new CRC(); + private final ImageOutputStream stream; + private final long startPos; + private final CRC crc = new CRC(); - public ChunkStream(int type, ImageOutputStream stream) throws IOException { + ChunkStream(int type, ImageOutputStream stream) throws IOException { this.stream = stream; this.startPos = stream.getStreamPosition(); @@ -108,25 +106,29 @@ final class ChunkStream extends ImageOutputStreamImpl { writeInt(type); } + @Override public int read() throws IOException { throw new RuntimeException("Method not available"); } + @Override public int read(byte[] b, int off, int len) throws IOException { throw new RuntimeException("Method not available"); } + @Override public void write(byte[] b, int off, int len) throws IOException { crc.update(b, off, len); stream.write(b, off, len); } + @Override public void write(int b) throws IOException { crc.update(b); stream.write(b); } - public void finish() throws IOException { + void finish() throws IOException { // Write CRC stream.writeInt(crc.getValue()); @@ -140,6 +142,7 @@ final class ChunkStream extends ImageOutputStreamImpl { stream.flushBefore(pos); } + @Override protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) @@ -150,24 +153,29 @@ final class ChunkStream extends ImageOutputStreamImpl { // fixed length. final class IDATOutputStream extends ImageOutputStreamImpl { - private static byte[] chunkType = { + private static final byte[] chunkType = { (byte)'I', (byte)'D', (byte)'A', (byte)'T' }; - private ImageOutputStream stream; - private int chunkLength; + private final ImageOutputStream stream; + private final int chunkLength; private long startPos; - private CRC crc = new CRC(); + private final CRC crc = new CRC(); - Deflater def = new Deflater(Deflater.BEST_COMPRESSION); - byte[] buf = new byte[512]; + private final Deflater def; + private final byte[] buf = new byte[512]; + // reused 1 byte[] array: + private final byte[] wbuf1 = new byte[1]; private int bytesRemaining; - public IDATOutputStream(ImageOutputStream stream, int chunkLength) - throws IOException { + IDATOutputStream(ImageOutputStream stream, int chunkLength, + int deflaterLevel) throws IOException + { this.stream = stream; this.chunkLength = chunkLength; + this.def = new Deflater(deflaterLevel); + startChunk(); } @@ -206,14 +214,17 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } + @Override public int read() throws IOException { throw new RuntimeException("Method not available"); } + @Override public int read(byte[] b, int off, int len) throws IOException { throw new RuntimeException("Method not available"); } + @Override public void write(byte[] b, int off, int len) throws IOException { if (len == 0) { return; @@ -227,7 +238,7 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } - public void deflate() throws IOException { + void deflate() throws IOException { int len = def.deflate(buf, 0, buf.length); int off = 0; @@ -247,13 +258,13 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } + @Override public void write(int b) throws IOException { - byte[] wbuf = new byte[1]; - wbuf[0] = (byte)b; - write(wbuf, 0, 1); + wbuf1[0] = (byte)b; + write(wbuf1, 0, 1); } - public void finish() throws IOException { + void finish() throws IOException { try { if (!def.finished()) { def.finish(); @@ -267,6 +278,7 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } } + @Override protected void finalize() throws Throwable { // Empty finalizer (for improved performance; no need to call // super.finalize() in this case) @@ -274,18 +286,76 @@ final class IDATOutputStream extends ImageOutputStreamImpl { } -class PNGImageWriteParam extends ImageWriteParam { +final class PNGImageWriteParam extends ImageWriteParam { - public PNGImageWriteParam(Locale locale) { + /** Default quality level = 0.5 ie medium compression */ + private static final float DEFAULT_QUALITY = 0.5f; + + private static final String[] compressionNames = {"Deflate"}; + private static final float[] qualityVals = { 0.00F, 0.30F, 0.75F, 1.00F }; + private static final String[] qualityDescs = { + "High compression", // 0.00 -> 0.30 + "Medium compression", // 0.30 -> 0.75 + "Low compression" // 0.75 -> 1.00 + }; + + PNGImageWriteParam(Locale locale) { super(); this.canWriteProgressive = true; this.locale = locale; + this.canWriteCompressed = true; + this.compressionTypes = compressionNames; + this.compressionType = compressionTypes[0]; + this.compressionMode = MODE_DEFAULT; + this.compressionQuality = DEFAULT_QUALITY; + } + + /** + * Removes any previous compression quality setting. + * + *

The default implementation resets the compression quality + * to 0.5F. + * + * @exception IllegalStateException if the compression mode is not + * MODE_EXPLICIT. + */ + @Override + public void unsetCompression() { + super.unsetCompression(); + this.compressionType = compressionTypes[0]; + this.compressionQuality = DEFAULT_QUALITY; + } + + /** + * Returns true since the PNG plug-in only supports + * lossless compression. + * + * @return true. + */ + @Override + public boolean isCompressionLossless() { + return true; + } + + @Override + public String[] getCompressionQualityDescriptions() { + super.getCompressionQualityDescriptions(); + return qualityDescs.clone(); + } + + @Override + public float[] getCompressionQualityValues() { + super.getCompressionQualityValues(); + return qualityVals.clone(); } } /** */ -public class PNGImageWriter extends ImageWriter { +public final class PNGImageWriter extends ImageWriter { + + /** Default compression level = 4 ie medium compression */ + private static final int DEFAULT_COMPRESSION_LEVEL = 4; ImageOutputStream stream = null; @@ -334,6 +404,7 @@ public class PNGImageWriter extends ImageWriter { super(originatingProvider); } + @Override public void setOutput(Object output) { super.setOutput(output); if (output != null) { @@ -346,16 +417,17 @@ public class PNGImageWriter extends ImageWriter { } } - private static int[] allowedProgressivePasses = { 1, 7 }; - + @Override public ImageWriteParam getDefaultWriteParam() { return new PNGImageWriteParam(getLocale()); } + @Override public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param) { return null; } + @Override public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) { PNGMetadata m = new PNGMetadata(); @@ -363,11 +435,13 @@ public class PNGImageWriter extends ImageWriter { return m; } + @Override public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param) { return null; } + @Override public IIOMetadata convertImageMetadata(IIOMetadata inData, ImageTypeSpecifier imageType, ImageWriteParam param) { @@ -934,8 +1008,11 @@ public class PNGImageWriter extends ImageWriter { } // Use sourceXOffset, etc. - private void write_IDAT(RenderedImage image) throws IOException { - IDATOutputStream ios = new IDATOutputStream(stream, 32768); + private void write_IDAT(RenderedImage image, int deflaterLevel) + throws IOException + { + IDATOutputStream ios = new IDATOutputStream(stream, 32768, + deflaterLevel); try { if (metadata.IHDR_interlaceMethod == 1) { for (int i = 0; i < 7; i++) { @@ -1028,6 +1105,7 @@ public class PNGImageWriter extends ImageWriter { } } + @Override public void write(IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) throws IIOException { @@ -1110,7 +1188,23 @@ public class PNGImageWriter extends ImageWriter { metadata = new PNGMetadata(); } + // reset compression level to default: + int deflaterLevel = DEFAULT_COMPRESSION_LEVEL; + if (param != null) { + switch(param.getCompressionMode()) { + case ImageWriteParam.MODE_DISABLED: + deflaterLevel = Deflater.NO_COMPRESSION; + break; + case ImageWriteParam.MODE_EXPLICIT: + float quality = param.getCompressionQuality(); + if (quality >= 0f && quality <= 1f) { + deflaterLevel = 9 - Math.round(9f * quality); + } + break; + default: + } + // Use Adam7 interlacing if set in write param switch (param.getProgressiveMode()) { case ImageWriteParam.MODE_DEFAULT: @@ -1119,8 +1213,9 @@ public class PNGImageWriter extends ImageWriter { case ImageWriteParam.MODE_DISABLED: metadata.IHDR_interlaceMethod = 0; break; - // MODE_COPY_FROM_METADATA should alreay be taken care of + // MODE_COPY_FROM_METADATA should already be taken care of // MODE_EXPLICIT is not allowed + default: } } @@ -1165,7 +1260,7 @@ public class PNGImageWriter extends ImageWriter { writeUnknownChunks(); - write_IDAT(im); + write_IDAT(im, deflaterLevel); if (abortRequested()) { processWriteAborted(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java index f02dd4391f0..2c7720c7f19 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/png/PNGMetadata.java @@ -254,7 +254,7 @@ public class PNGMetadata extends IIOMetadata implements Cloneable { /** * Sets the IHDR_bitDepth and IHDR_colorType variables. - * The numBands parameter is necessary since + * The {@code numBands} parameter is necessary since * we may only be writing a subset of the image bands. */ public void initialize(ImageTypeSpecifier imageType, int numBands) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java index e8f4a5d05b3..c60a98c793b 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFIFD.java @@ -362,9 +362,9 @@ public class TIFFIFD extends TIFFDirectory { offsets.add(f); } + List byteCounts = new ArrayList<>(); if (offsets.size() > 0) { // StripByteCounts - List byteCounts = new ArrayList<>(); f = getTIFFField(BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS); if (f != null) { if (f.getCount() != count) { @@ -415,6 +415,12 @@ public class TIFFIFD extends TIFFDirectory { } } + // Ensure there is at least a data pointer for JPEG interchange format or + // both data offsets and byte counts for other compression types. + if (jpegOffset == null && (offsets.size() == 0 || byteCounts.size() == 0)) { + throw new IIOException("Insufficient data offsets or byte counts"); + } + // JPEGQTables - one 64-byte table for each offset. f = getTIFFField(BaselineTIFFTagSet.TAG_JPEG_Q_TABLES); if (f != null) { @@ -480,14 +486,16 @@ public class TIFFIFD extends TIFFDirectory { stream.skipBytes(4); continue; } - int count = (int)stream.readUnsignedInt(); + long longCount = stream.readUnsignedInt(); // Get the associated TIFFTag. TIFFTag tag = getTag(tagNumber, tagSetList); - // Ignore unknown fields. + // Ignore unknown fields, fields with unknown type, and fields + // with count out of int range. if((tag == null && ignoreUnknownFields) - || (tag != null && !tag.isDataTypeOK(type))) { + || (tag != null && !tag.isDataTypeOK(type)) + || longCount > Integer.MAX_VALUE) { // Skip the value/offset so as to leave the stream // position at the start of the next IFD entry. stream.skipBytes(4); @@ -496,6 +504,8 @@ public class TIFFIFD extends TIFFDirectory { continue; } + int count = (int)longCount; + if (tag == null) { tag = new TIFFTag(TIFFTag.UNKNOWN_TAG_NAME, tagNumber, 1 << type, count); @@ -518,7 +528,14 @@ public class TIFFIFD extends TIFFDirectory { } } - int size = count*sizeOfType; + long longSize = longCount*sizeOfType; + if (longSize > Integer.MAX_VALUE) { + // Continue with the next IFD entry. + stream.skipBytes(4); + continue; + } + int size = (int)longSize; + if (size > 4 || tag.isIFDPointer()) { // The IFD entry value is a pointer to the actual field value. long offset = stream.readUnsignedInt(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java index 6a90e0677c9..ea819e9e968 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFImageWriter.java @@ -266,6 +266,8 @@ public class TIFFImageWriter extends ImageWriter { super.setOutput(output); if (output != null) { + reset(); + if (!(output instanceof ImageOutputStream)) { throw new IllegalArgumentException ("output not an ImageOutputStream!"); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java index 1bab31408c8..a9edc1e2c3a 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageReader.java @@ -50,7 +50,7 @@ import com.sun.imageio.plugins.common.ReaderUtil; /** This class is the Java Image IO plugin reader for WBMP images. * It may subsample the image, clip the image, * and shift the decoded image origin if the proper decoding parameter - * are set in the provided WBMPImageReadParam. + * are set in the provided {@code WBMPImageReadParam}. */ public class WBMPImageReader extends ImageReader { /** The input stream where reads from */ @@ -69,8 +69,8 @@ public class WBMPImageReader extends ImageReader { private WBMPMetadata metadata; - /** Constructs WBMPImageReader from the provided - * ImageReaderSpi. + /** Constructs {@code WBMPImageReader} from the provided + * {@code ImageReaderSpi}. */ public WBMPImageReader(ImageReaderSpi originator) { super(originator); diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java index 45d3187b2c8..8fd3a459fe1 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/wbmp/WBMPImageWriter.java @@ -57,7 +57,7 @@ import com.sun.imageio.plugins.common.I18N; * a WBMP format. * * The encoding process may clip, subsample using the parameters - * specified in the ImageWriteParam. + * specified in the {@code ImageWriteParam}. * * @see com.sun.media.imageio.plugins.WBMPImageWriteParam */ @@ -92,8 +92,8 @@ public class WBMPImageWriter extends ImageWriter { return multiBytes; } - /** Constructs WBMPImageWriter based on the provided - * ImageWriterSpi. + /** Constructs {@code WBMPImageWriter} based on the provided + * {@code ImageWriterSpi}. */ public WBMPImageWriter(ImageWriterSpi originator) { super(originator); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java index 5e9e3c45cce..0a4788df804 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AiffFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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,23 +25,22 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.SequenceInputStream; import java.util.Objects; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; //$$fb this class is buggy. Should be replaced in future. @@ -63,6 +62,7 @@ public final class AiffFileWriter extends SunFileWriter { // METHODS TO IMPLEMENT AudioFileWriter + @Override public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; @@ -84,6 +84,7 @@ public final class AiffFileWriter extends SunFileWriter { } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -106,6 +107,7 @@ public final class AiffFileWriter extends SunFileWriter { } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -160,6 +162,9 @@ public final class AiffFileWriter extends SunFileWriter { * Throws IllegalArgumentException if not supported. */ private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) { + if (!isFileTypeSupported(type, stream)) { + throw new IllegalArgumentException("File type " + type + " not supported."); + } AudioFormat format = null; AiffFileFormat fileFormat = null; @@ -177,10 +182,6 @@ public final class AiffFileWriter extends SunFileWriter { int fileSize; boolean convert8to16 = false; - if( !types[0].equals(type) ) { - throw new IllegalArgumentException("File type " + type + " not supported."); - } - if( (AudioFormat.Encoding.ALAW.equals(streamEncoding)) || (AudioFormat.Encoding.ULAW.equals(streamEncoding)) ) { diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java index fcc0e709f2b..e117348dbdf 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AlawCodec.java @@ -135,45 +135,48 @@ public final class AlawCodec extends SunCodec { AudioFormat sourceFormat = sourceStream.getFormat(); AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding(); + if( !isConversionSupported(targetEncoding,sourceStream.getFormat()) ) { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } if( sourceEncoding.equals( targetEncoding ) ) { return sourceStream; - } else { - AudioFormat targetFormat = null; - if( !isConversionSupported(targetEncoding,sourceStream.getFormat()) ) { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - if( sourceEncoding.equals( AudioFormat.Encoding.ALAW ) && - targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) ) { - - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 16, - sourceFormat.getChannels(), - 2*sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - sourceFormat.isBigEndian()); - - } else if( sourceEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) && - targetEncoding.equals( AudioFormat.Encoding.ALAW ) ) { - - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 8, - sourceFormat.getChannels(), - sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - false); - } else { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - return getAudioInputStream( targetFormat, sourceStream ); } + AudioFormat targetFormat = null; + if( sourceEncoding.equals( AudioFormat.Encoding.ALAW ) && + targetEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) ) { + + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 16, + sourceFormat.getChannels(), + 2*sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + sourceFormat.isBigEndian()); + + } else if( sourceEncoding.equals( AudioFormat.Encoding.PCM_SIGNED ) && + targetEncoding.equals( AudioFormat.Encoding.ALAW ) ) { + + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 8, + sourceFormat.getChannels(), + sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + false); + } else { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } + return getConvertedStream(targetFormat, sourceStream); } /** * use old code... */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){ + if (!isConversionSupported(targetFormat, sourceStream.getFormat())) + throw new IllegalArgumentException("Unsupported conversion: " + + sourceStream.getFormat().toString() + " to " + + targetFormat.toString()); return getConvertedStream( targetFormat, sourceStream ); } @@ -218,33 +221,28 @@ public final class AlawCodec extends SunCodec { Vector formats = new Vector<>(); AudioFormat format; - if ( AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { + if (inputFormat.getSampleSizeInBits() == 16 + && AudioFormat.Encoding.PCM_SIGNED.equals(inputFormat.getEncoding())) { format = new AudioFormat(AudioFormat.Encoding.ALAW, - inputFormat.getSampleRate(), - 8, + inputFormat.getSampleRate(), 8, inputFormat.getChannels(), inputFormat.getChannels(), - inputFormat.getSampleRate(), - false ); + inputFormat.getSampleRate(), false); formats.addElement(format); } - - if (AudioFormat.Encoding.ALAW.equals(inputFormat.getEncoding())) { + if (inputFormat.getSampleSizeInBits() == 8 + && AudioFormat.Encoding.ALAW.equals(inputFormat.getEncoding())) { format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - false ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), false); formats.addElement(format); format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - true ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), true); formats.addElement(format); } @@ -256,7 +254,7 @@ public final class AlawCodec extends SunCodec { } - final class AlawCodecStream extends AudioInputStream { + private final class AlawCodecStream extends AudioInputStream { // tempBuffer required only for encoding (when encode is true) private static final int tempBufferSize = 64; @@ -446,5 +444,12 @@ public final class AlawCodec extends SunCodec { return (i - off); } } + + @Override + public long skip(final long n) throws IOException { + // Implementation of this method assumes that we support + // encoding/decoding from/to 8/16 bits only + return encode ? super.skip(n * 2) / 2 : super.skip(n / 2) * 2; + } } // end class AlawCodecStream } // end class ALAW diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java index 185efb9e6b0..7a8c5bc6a68 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -25,24 +25,18 @@ package com.sun.media.sound; - import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; - /** * AU file format. * * @author Jan Borgersen */ - final class AuFileFormat extends AudioFileFormat { // magic numbers - static final int AU_SUN_MAGIC = 0x2e736e64; - static final int AU_SUN_INV_MAGIC = 0x646e732e; - static final int AU_DEC_MAGIC = 0x2e736400; - static final int AU_DEC_INV_MAGIC = 0x0064732e; + static final int AU_SUN_MAGIC = 0x2e736e64; // ".snd" // encodings static final int AU_ULAW_8 = 1; /* 8-bit ISDN u-law */ @@ -62,11 +56,6 @@ final class AuFileFormat extends AudioFileFormat { private int auType; - AuFileFormat( AudioFileFormat aff ) { - - this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() ); - } - AuFileFormat(AudioFileFormat.Type type, int lengthInBytes, AudioFormat format, int lengthInFrames) { super(type,lengthInBytes,format,lengthInFrames); @@ -94,12 +83,9 @@ final class AuFileFormat extends AudioFileFormat { auType = AU_LINEAR_32; } } - } public int getAuType() { - return auType; } - } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java index 7e83180dffa..180f45c9076 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileReader.java @@ -46,45 +46,25 @@ public final class AuFileReader extends SunFileReader { @Override public AudioFileFormat getAudioFileFormatImpl(final InputStream stream) throws UnsupportedAudioFileException, IOException { - boolean bigendian = false; - int headerSize = -1; - int dataSize = -1; - int encoding_local = -1; - int sampleRate = -1; - int frameRate = -1; - int frameSize = -1; - int channels = -1; - final int sampleSizeInBits; - int length = 0; - int nread = 0; - AudioFormat.Encoding encoding = null; - - DataInputStream dis = new DataInputStream( stream ); - - final int magic = dis.readInt(); nread += 4; - - if (! (magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC) || - (magic == AuFileFormat.AU_SUN_INV_MAGIC) || (magic == AuFileFormat.AU_DEC_INV_MAGIC) ) { + final DataInputStream dis = new DataInputStream(stream); + final int magic = dis.readInt(); + if (magic != AuFileFormat.AU_SUN_MAGIC) { // not AU, throw exception throw new UnsupportedAudioFileException("not an AU file"); } - if ((magic == AuFileFormat.AU_SUN_MAGIC) || (magic == AuFileFormat.AU_DEC_MAGIC)) { - bigendian = true; // otherwise little-endian - } - - headerSize = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - dataSize = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - encoding_local = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - sampleRate = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; - channels = (bigendian==true ? dis.readInt() : rllong(dis) ); nread += 4; + final int headerSize = dis.readInt(); + final int dataSize = dis.readInt(); + final int encoding_local = dis.readInt(); + final int sampleRate = dis.readInt(); + final int channels = dis.readInt(); if (channels <= 0) { throw new UnsupportedAudioFileException("Invalid number of channels"); } - frameRate = sampleRate; - + final int sampleSizeInBits; + final AudioFormat.Encoding encoding; switch (encoding_local) { case AuFileFormat.AU_ULAW_8: encoding = AudioFormat.Encoding.ULAW; @@ -138,24 +118,24 @@ public final class AuFileReader extends SunFileReader { break; */ default: - // unsupported filetype, throw exception - throw new UnsupportedAudioFileException("not a valid AU file"); + // unsupported filetype, throw exception + throw new UnsupportedAudioFileException("not a valid AU file"); } - frameSize = calculatePCMFrameSize(sampleSizeInBits, channels); + final int frameSize = calculatePCMFrameSize(sampleSizeInBits, channels); //$$fb 2002-11-02: fix for 4629669: AU file reader: problems with empty files - if( dataSize < 0 ) { + final int length; + if (dataSize < 0) { length = AudioSystem.NOT_SPECIFIED; } else { //$$fb 2003-10-20: fix for 4940459: AudioInputStream.getFrameLength() returns 0 instead of NOT_SPECIFIED length = dataSize / frameSize; } // now seek past the header - dis.skipBytes(headerSize - nread); - AudioFormat format = new AudioFormat(encoding, sampleRate, - sampleSizeInBits, channels, - frameSize, (float) frameRate, - bigendian); + dis.skipBytes(headerSize - AuFileFormat.AU_HEADERSIZE); + final AudioFormat format = new AudioFormat(encoding, sampleRate, + sampleSizeInBits, channels, + frameSize, sampleRate, true); return new AuFileFormat(AudioFileFormat.Type.AU, dataSize + headerSize, format, length); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java index 1c2ccf5b74c..b498c916435 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AuFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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,26 +25,24 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.SequenceInputStream; import java.util.Objects; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; - /** * AU file writer. * @@ -52,8 +50,10 @@ import javax.sound.sampled.AudioSystem; */ public final class AuFileWriter extends SunFileWriter { - //$$fb value for length field if length is not known - public static final int UNKNOWN_SIZE=-1; + /** + * Value for length field if length is not known. + */ + private static final int UNKNOWN_SIZE = -1; /** * Constructs a new AuFileWriter object. @@ -62,6 +62,7 @@ public final class AuFileWriter extends SunFileWriter { super(new AudioFileFormat.Type[]{AudioFileFormat.Type.AU}); } + @Override public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; @@ -82,7 +83,7 @@ public final class AuFileWriter extends SunFileWriter { return new AudioFileFormat.Type[0]; } - + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -96,13 +97,10 @@ public final class AuFileWriter extends SunFileWriter { // throws IllegalArgumentException if not supported AuFileFormat auFileFormat = (AuFileFormat)getAudioFileFormat(fileType, stream); - - int bytesWritten = writeAuFile(stream, auFileFormat, out); - return bytesWritten; + return writeAuFile(stream, auFileFormat, out); } - - + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -137,7 +135,6 @@ public final class AuFileWriter extends SunFileWriter { return bytesWritten; } - // ------------------------------------------------------------- /** @@ -145,6 +142,9 @@ public final class AuFileWriter extends SunFileWriter { * Throws IllegalArgumentException if not supported. */ private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) { + if (!isFileTypeSupported(type, stream)) { + throw new IllegalArgumentException("File type " + type + " not supported."); + } AudioFormat format = null; AuFileFormat fileFormat = null; @@ -154,17 +154,9 @@ public final class AuFileWriter extends SunFileWriter { AudioFormat.Encoding streamEncoding = streamFormat.getEncoding(); - float sampleRate; int sampleSizeInBits; - int channels; - int frameSize; - float frameRate; int fileSize; - if( !types[0].equals(type) ) { - throw new IllegalArgumentException("File type " + type + " not supported."); - } - if( (AudioFormat.Encoding.ALAW.equals(streamEncoding)) || (AudioFormat.Encoding.ULAW.equals(streamEncoding)) ) { @@ -206,14 +198,12 @@ public final class AuFileWriter extends SunFileWriter { return fileFormat; } - - private InputStream getFileStream(AuFileFormat auFileFormat, InputStream audioStream) throws IOException { + private InputStream getFileStream(AuFileFormat auFileFormat, AudioInputStream audioStream) throws IOException { // private method ... assumes auFileFormat is a supported file type AudioFormat format = auFileFormat.getFormat(); - int magic = AuFileFormat.AU_SUN_MAGIC; int headerSize = AuFileFormat.AU_HEADERSIZE; long dataSize = auFileFormat.getFrameLength(); //$$fb fix for Bug 4351296 @@ -225,9 +215,6 @@ public final class AuFileWriter extends SunFileWriter { int encoding_local = auFileFormat.getAuType(); int sampleRate = (int)format.getSampleRate(); int channels = format.getChannels(); - //$$fb below is the fix for 4297100. - //boolean bigendian = format.isBigEndian(); - boolean bigendian = true; // force bigendian byte header[] = null; ByteArrayInputStream headerStream = null; @@ -243,54 +230,37 @@ public final class AuFileWriter extends SunFileWriter { codedAudioStream = audioStream; - if( audioStream instanceof AudioInputStream ) { + audioStreamFormat = audioStream.getFormat(); + encoding = audioStreamFormat.getEncoding(); + + //$$ fb 2001-07-13: Bug 4391108 + if( (AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding)) || + (AudioFormat.Encoding.PCM_SIGNED.equals(encoding) + && !audioStreamFormat.isBigEndian()) ) { + // We always write big endian au files, this is by far the standard + codedAudioStream = AudioSystem.getAudioInputStream( new AudioFormat ( + AudioFormat.Encoding.PCM_SIGNED, + audioStreamFormat.getSampleRate(), + audioStreamFormat.getSampleSizeInBits(), + audioStreamFormat.getChannels(), + audioStreamFormat.getFrameSize(), + audioStreamFormat.getFrameRate(), + true), + audioStream ); - audioStreamFormat = ((AudioInputStream)audioStream).getFormat(); - encoding = audioStreamFormat.getEncoding(); - - //$$ fb 2001-07-13: Bug 4391108 - if( (AudioFormat.Encoding.PCM_UNSIGNED.equals(encoding)) || - (AudioFormat.Encoding.PCM_SIGNED.equals(encoding) - && bigendian != audioStreamFormat.isBigEndian()) ) { - - // plug in the transcoder to convert to PCM_SIGNED, bigendian - // NOTE: little endian AU is not common, so we're always converting - // to big endian unless the passed in audioFileFormat is little. - // $$fb this NOTE is superseded. We always write big endian au files, this is by far the standard. - codedAudioStream = AudioSystem.getAudioInputStream( new AudioFormat ( - AudioFormat.Encoding.PCM_SIGNED, - audioStreamFormat.getSampleRate(), - audioStreamFormat.getSampleSizeInBits(), - audioStreamFormat.getChannels(), - audioStreamFormat.getFrameSize(), - audioStreamFormat.getFrameRate(), - bigendian), - (AudioInputStream)audioStream ); - - - } } baos = new ByteArrayOutputStream(); dos = new DataOutputStream(baos); - if (bigendian) { - dos.writeInt(AuFileFormat.AU_SUN_MAGIC); - dos.writeInt(headerSize); - dos.writeInt((int)dataSizeInBytes); - dos.writeInt(encoding_local); - dos.writeInt(sampleRate); - dos.writeInt(channels); - } else { - dos.writeInt(AuFileFormat.AU_SUN_INV_MAGIC); - dos.writeInt(big2little(headerSize)); - dos.writeInt(big2little((int)dataSizeInBytes)); - dos.writeInt(big2little(encoding_local)); - dos.writeInt(big2little(sampleRate)); - dos.writeInt(big2little(channels)); - } + dos.writeInt(AuFileFormat.AU_SUN_MAGIC); + dos.writeInt(headerSize); + dos.writeInt((int)dataSizeInBytes); + dos.writeInt(encoding_local); + dos.writeInt(sampleRate); + dos.writeInt(channels); // Now create a new InputStream from headerStream and the InputStream // in audioStream @@ -304,7 +274,7 @@ public final class AuFileWriter extends SunFileWriter { return auStream; } - private int writeAuFile(InputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException { + private int writeAuFile(AudioInputStream in, AuFileFormat auFileFormat, OutputStream out) throws IOException { int bytesRead = 0; int bytesWritten = 0; @@ -332,6 +302,4 @@ public final class AuFileWriter extends SunFileWriter { return bytesWritten; } - - } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java index a1e522afb40..21ee186cb71 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.media.sound; import java.io.IOException; @@ -475,6 +476,11 @@ public final class AudioFloatFormatConverter extends FormatConversionProvider { public AudioInputStream getAudioInputStream(Encoding targetEncoding, AudioInputStream sourceStream) { + if (!isConversionSupported(targetEncoding, sourceStream.getFormat())) { + throw new IllegalArgumentException( + "Unsupported conversion: " + sourceStream.getFormat() + .toString() + " to " + targetEncoding.toString()); + } if (sourceStream.getFormat().getEncoding().equals(targetEncoding)) return sourceStream; AudioFormat format = sourceStream.getFormat(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java index 786b7ba97bf..7479357c580 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizer.java @@ -32,9 +32,9 @@ import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.SourceDataLine; /** - * AudioSynthesizer is a Synthesizer - * which renders it's output audio into SourceDataLine - * or AudioInputStream. + * {@code AudioSynthesizer} is a {@code Synthesizer} + * which renders it's output audio into {@code SourceDataLine} + * or {@code AudioInputStream}. * * @see MidiSystem#getSynthesizer * @see Synthesizer @@ -59,7 +59,7 @@ public interface AudioSynthesizer extends Synthesizer { * Gets information about the possible properties for the synthesizer. * * @param info a proposed list of tag/value pairs that will be sent on open. - * @return an array of AudioSynthesizerPropertyInfo objects + * @return an array of {@code AudioSynthesizerPropertyInfo} objects * describing possible properties. This array may be an empty array if * no properties are required. */ @@ -68,7 +68,7 @@ public interface AudioSynthesizer extends Synthesizer { /** * Opens the synthesizer and starts rendering audio into - * SourceDataLine. + * {@code SourceDataLine}. * *

An application opening a synthesizer explicitly with this call * has to close the synthesizer by calling {@link #close}. This is @@ -77,13 +77,13 @@ public interface AudioSynthesizer extends Synthesizer { * *

Note that some synthesizers, once closed, cannot be reopened. * Attempts to reopen such a synthesizer will always result in - * a MidiUnavailableException. + * a {@code MidiUnavailableException}. * - * @param line which AudioSynthesizer writes output audio into. - * If line is null, then line from system default mixer is used. - * @param info a Map object containing + * @param line which {@code AudioSynthesizer} writes output audio into. + * If {@code line} is null, then line from system default mixer is used. + * @param info a {@code Map} object containing * properties for additional configuration supported by synthesizer. - * If info is null then default settings are used. + * If {@code info} is null then default settings are used. * * @throws MidiUnavailableException thrown if the synthesizer cannot be * opened due to resource restrictions. @@ -98,7 +98,7 @@ public interface AudioSynthesizer extends Synthesizer { /** * Opens the synthesizer and renders audio into returned - * AudioInputStream. + * {@code AudioInputStream}. * *

An application opening a synthesizer explicitly with this call * has to close the synthesizer by calling {@link #close}. This is @@ -107,13 +107,13 @@ public interface AudioSynthesizer extends Synthesizer { * *

Note that some synthesizers, once closed, cannot be reopened. * Attempts to reopen such a synthesizer will always result in - * a MidiUnavailableException. + * a {@code MidiUnavailableException}. * - * @param targetFormat specifies the AudioFormat - * used in returned AudioInputStream. - * @param info a Map object containing + * @param targetFormat specifies the {@code AudioFormat} + * used in returned {@code AudioInputStream}. + * @param info a {@code Map} object containing * properties for additional configuration supported by synthesizer. - * If info is null then default settings are used. + * If {@code info} is null then default settings are used. * * @throws MidiUnavailableException thrown if the synthesizer cannot be * opened due to resource restrictions. diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java index 16bfaa20790..3fadc82e448 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/AudioSynthesizerPropertyInfo.java @@ -25,16 +25,16 @@ package com.sun.media.sound; /** - * Information about property used in opening AudioSynthesizer. + * Information about property used in opening {@code AudioSynthesizer}. * * @author Karl Helgason */ public final class AudioSynthesizerPropertyInfo { /** - * Constructs a AudioSynthesizerPropertyInfo object with a given - * name and value. The description and choices - * are initialized by null values. + * Constructs a {@code AudioSynthesizerPropertyInfo} object with a given + * name and value. The {@code description} and {@code choices} + * are initialized by {@code null} values. * * @param name the name of the property * @param value the current value or class used for values. @@ -60,18 +60,18 @@ public final class AudioSynthesizerPropertyInfo { */ public String description = null; /** - * The value field specifies the current value of + * The {@code value} field specifies the current value of * the property. */ public Object value = null; /** - * The valueClass field specifies class - * used in value field. + * The {@code valueClass} field specifies class + * used in {@code value} field. */ public Class valueClass = null; /** * An array of possible values if the value for the field - * AudioSynthesizerPropertyInfo.value may be selected + * {@code AudioSynthesizerPropertyInfo.value} may be selected * from a particular set of values; otherwise null. */ public Object[] choices = null; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java index a56b5eca48e..b68750ad416 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/MidiUtils.java @@ -250,7 +250,7 @@ public final class MidiUtils { /** * Binary search for the event indexes of the track * - * @param tick - tick number of index to be found in array + * @param tick tick number of index to be found in array * @return index in track which is on or after "tick". * if no entries are found that follow after tick, track.size() is returned */ diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java index 6ef8268f34c..5ba0558099d 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/PCMtoPCMCodec.java @@ -33,7 +33,6 @@ import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; - /** * Converts among signed/unsigned and little/big endianness of sampled. * @@ -52,11 +51,6 @@ public final class PCMtoPCMCodec extends SunCodec { AudioFormat.Encoding.PCM_UNSIGNED, }; - - - private static final int tempBufferSize = 64; - private byte tempBuffer [] = null; - /** * Constructs a new PCMtoPCM codec object. */ @@ -67,21 +61,31 @@ public final class PCMtoPCMCodec extends SunCodec { // NEW CODE + public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) { - /** - */ - public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat){ - - if( sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_SIGNED ) || - sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_UNSIGNED ) ) { - - AudioFormat.Encoding encs[] = new AudioFormat.Encoding[2]; - encs[0] = AudioFormat.Encoding.PCM_SIGNED; - encs[1] = AudioFormat.Encoding.PCM_UNSIGNED; - return encs; - } else { - return new AudioFormat.Encoding[0]; + final int sampleSize = sourceFormat.getSampleSizeInBits(); + AudioFormat.Encoding encoding = sourceFormat.getEncoding(); + if (sampleSize == 8) { + if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED)) { + return new AudioFormat.Encoding[]{ + AudioFormat.Encoding.PCM_UNSIGNED + }; } + if (encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED)) { + return new AudioFormat.Encoding[]{ + AudioFormat.Encoding.PCM_SIGNED + }; + } + } else if (sampleSize == 16) { + if (encoding.equals(AudioFormat.Encoding.PCM_SIGNED) + || encoding.equals(AudioFormat.Encoding.PCM_UNSIGNED)) { + return new AudioFormat.Encoding[]{ + AudioFormat.Encoding.PCM_UNSIGNED, + AudioFormat.Encoding.PCM_SIGNED + }; + } + } + return new AudioFormat.Encoding[0]; } @@ -125,7 +129,7 @@ public final class PCMtoPCMCodec extends SunCodec { sourceFormat.getFrameRate(), sourceFormat.isBigEndian() ); - return getAudioInputStream( targetFormat, sourceStream ); + return getConvertedStream(targetFormat, sourceStream); } else { throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString() ); @@ -136,7 +140,10 @@ public final class PCMtoPCMCodec extends SunCodec { * use old code */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){ - + if (!isConversionSupported(targetFormat, sourceStream.getFormat())) + throw new IllegalArgumentException("Unsupported conversion: " + + sourceStream.getFormat().toString() + " to " + + targetFormat.toString()); return getConvertedStream( targetFormat, sourceStream ); } @@ -166,7 +173,6 @@ public final class PCMtoPCMCodec extends SunCodec { } else { cs = (AudioInputStream) (new PCMtoPCMCodecStream(stream, outputFormat)); - tempBuffer = new byte[tempBufferSize]; } return cs; } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java index 85b3d276c71..e36295742c8 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftControl.java @@ -25,7 +25,7 @@ package com.sun.media.sound; /** - * SoftControl are the basic controls + * {@code SoftControl} are the basic controls * used for control-rate processing. * * @author Karl Helgason diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java index caf80f0e737..715cfcf9e76 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SoftMidiAudioFileReader.java @@ -25,6 +25,7 @@ package com.sun.media.sound; +import java.io.EOFException; import java.io.IOException; import java.io.InputStream; @@ -131,7 +132,8 @@ public final class SoftMidiAudioFileReader extends SunFileReader { stream.mark(200); try { return getAudioInputStream(MidiSystem.getSequence(stream)); - } catch (final InvalidMidiDataException ignored) { + } catch (InvalidMidiDataException | EOFException ignored) { + // stream is unsupported or the header is less than was expected stream.reset(); throw new UnsupportedAudioFileException(); } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java index 232789352c5..773fea0e515 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunCodec.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -26,11 +26,8 @@ package com.sun.media.sound; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioInputStream; - import javax.sound.sampled.spi.FormatConversionProvider; - /** * A codec can encode and/or decode audio data. It provides an * AudioInputStream from which processed data may be read. @@ -73,23 +70,4 @@ abstract class SunCodec extends FormatConversionProvider { System.arraycopy(outputEncodings, 0, encodings, 0, outputEncodings.length); return encodings; } - - /** - */ - public abstract AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat); - - - /** - */ - public abstract AudioFormat[] getTargetFormats(AudioFormat.Encoding targetEncoding, AudioFormat sourceFormat); - - - /** - */ - public abstract AudioInputStream getAudioInputStream(AudioFormat.Encoding targetEncoding, AudioInputStream sourceStream); - /** - */ - public abstract AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream); - - } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java index bca1a5616ce..a9e40ff33c5 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileReader.java @@ -27,6 +27,7 @@ package com.sun.media.sound; import java.io.BufferedInputStream; import java.io.DataInputStream; +import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -51,6 +52,9 @@ abstract class SunFileReader extends AudioFileReader { stream.mark(200); // The biggest value which was historically used try { return getAudioFileFormatImpl(stream); + } catch (final EOFException ignored) { + // the header is less than was expected + throw new UnsupportedAudioFileException(); } finally { stream.reset(); } @@ -61,6 +65,9 @@ abstract class SunFileReader extends AudioFileReader { throws UnsupportedAudioFileException, IOException { try (InputStream is = url.openStream()) { return getAudioFileFormatImpl(new BufferedInputStream(is)); + } catch (final EOFException ignored) { + // the header is less than was expected + throw new UnsupportedAudioFileException(); } } @@ -69,6 +76,9 @@ abstract class SunFileReader extends AudioFileReader { throws UnsupportedAudioFileException, IOException { try (InputStream is = new FileInputStream(file)) { return getAudioFileFormatImpl(new BufferedInputStream(is)); + } catch (final EOFException ignored) { + // the header is less than was expected + throw new UnsupportedAudioFileException(); } } @@ -82,9 +92,10 @@ abstract class SunFileReader extends AudioFileReader { // beginning of the audio data, so return an AudioInputStream return new AudioInputStream(stream, fileFormat.getFormat(), fileFormat.getFrameLength()); - } catch (final UnsupportedAudioFileException e) { + } catch (UnsupportedAudioFileException | EOFException ignored) { + // stream is unsupported or the header is less than was expected stream.reset(); - throw e; + throw new UnsupportedAudioFileException(); } } @@ -125,6 +136,9 @@ abstract class SunFileReader extends AudioFileReader { * @throws UnsupportedAudioFileException if the stream does not point to * valid audio file data recognized by the system * @throws IOException if an I/O exception occurs + * @throws EOFException is used incorrectly by our readers instead of + * UnsupportedAudioFileException if the header is less than was + * expected */ abstract AudioFileFormat getAudioFileFormatImpl(InputStream stream) throws UnsupportedAudioFileException, IOException; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java index d771bad119e..8e9cf96889d 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/SunFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -25,19 +25,13 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; import java.io.DataInputStream; +import java.io.IOException; +import java.io.InputStream; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.spi.AudioFileWriter; - - - /** * Abstract File Writer class. * @@ -75,14 +69,6 @@ abstract class SunFileWriter extends AudioFileWriter { return localArray; } - - public abstract AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream); - - public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException; - - public abstract int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException; - - // HELPER METHODS diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java index dc088ee459c..9dfcb444efd 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/UlawCodec.java @@ -26,13 +26,12 @@ package com.sun.media.sound; import java.io.IOException; - import java.util.Objects; import java.util.Vector; import javax.sound.sampled.AudioFormat; -import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; /** @@ -126,43 +125,46 @@ public final class UlawCodec extends SunCodec { AudioFormat sourceFormat = sourceStream.getFormat(); AudioFormat.Encoding sourceEncoding = sourceFormat.getEncoding(); + if (!isConversionSupported(targetEncoding,sourceStream.getFormat())) { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } if (sourceEncoding.equals(targetEncoding)) { return sourceStream; - } else { - AudioFormat targetFormat = null; - if (!isConversionSupported(targetEncoding,sourceStream.getFormat())) { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - if (AudioFormat.Encoding.ULAW.equals(sourceEncoding) && - AudioFormat.Encoding.PCM_SIGNED.equals(targetEncoding) ) { - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 16, - sourceFormat.getChannels(), - 2*sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - sourceFormat.isBigEndian()); - } else if (AudioFormat.Encoding.PCM_SIGNED.equals(sourceEncoding) && - AudioFormat.Encoding.ULAW.equals(targetEncoding)) { - targetFormat = new AudioFormat( targetEncoding, - sourceFormat.getSampleRate(), - 8, - sourceFormat.getChannels(), - sourceFormat.getChannels(), - sourceFormat.getSampleRate(), - false); - } else { - throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); - } - - return getAudioInputStream( targetFormat, sourceStream ); } + AudioFormat targetFormat = null; + if (AudioFormat.Encoding.ULAW.equals(sourceEncoding) && + AudioFormat.Encoding.PCM_SIGNED.equals(targetEncoding) ) { + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 16, + sourceFormat.getChannels(), + 2*sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + sourceFormat.isBigEndian()); + } else if (AudioFormat.Encoding.PCM_SIGNED.equals(sourceEncoding) && + AudioFormat.Encoding.ULAW.equals(targetEncoding)) { + targetFormat = new AudioFormat( targetEncoding, + sourceFormat.getSampleRate(), + 8, + sourceFormat.getChannels(), + sourceFormat.getChannels(), + sourceFormat.getSampleRate(), + false); + } else { + throw new IllegalArgumentException("Unsupported conversion: " + sourceStream.getFormat().toString() + " to " + targetEncoding.toString()); + } + + return getConvertedStream(targetFormat, sourceStream); } /** * use old code... */ public AudioInputStream getAudioInputStream(AudioFormat targetFormat, AudioInputStream sourceStream){ + if (!isConversionSupported(targetFormat, sourceStream.getFormat())) + throw new IllegalArgumentException("Unsupported conversion: " + + sourceStream.getFormat().toString() + " to " + + targetFormat.toString()); return getConvertedStream(targetFormat, sourceStream); } @@ -215,24 +217,20 @@ public final class UlawCodec extends SunCodec { false ); formats.addElement(format); } - - if (AudioFormat.Encoding.ULAW.equals(inputFormat.getEncoding())) { + if (inputFormat.getSampleSizeInBits() == 8 + && AudioFormat.Encoding.ULAW.equals(inputFormat.getEncoding())) { format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - false ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), false); formats.addElement(format); format = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, - inputFormat.getSampleRate(), - 16, + inputFormat.getSampleRate(), 16, inputFormat.getChannels(), - inputFormat.getChannels()*2, - inputFormat.getSampleRate(), - true ); + inputFormat.getChannels() * 2, + inputFormat.getSampleRate(), true); formats.addElement(format); } @@ -244,7 +242,7 @@ public final class UlawCodec extends SunCodec { } - class UlawCodecStream extends AudioInputStream { + private final class UlawCodecStream extends AudioInputStream { private static final int tempBufferSize = 64; private byte tempBuffer [] = null; @@ -416,6 +414,12 @@ public final class UlawCodec extends SunCodec { return (i - off); } } - } // end class UlawCodecStream + @Override + public long skip(final long n) throws IOException { + // Implementation of this method assumes that we support + // encoding/decoding from/to 8/16 bits only + return encode ? super.skip(n * 2) / 2 : super.skip(n / 2) * 2; + } + } // end class UlawCodecStream } // end class ULAW diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java index b238e9da66e..240c6d27c58 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveExtensibleFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -124,7 +124,6 @@ public final class WaveExtensibleFileReader extends SunFileReader { return false; return true; } - } private static final String[] channelnames = { "FL", "FR", "FC", "LF", @@ -196,9 +195,9 @@ public final class WaveExtensibleFileReader extends SunFileReader { fmt_found = true; int format = chunk.readUnsignedShort(); - if (format != 0xFFFE) - throw new UnsupportedAudioFileException(); // WAVE_FORMAT_EXTENSIBLE - // only + if (format != WaveFileFormat.WAVE_FORMAT_EXTENSIBLE) { + throw new UnsupportedAudioFileException(); + } channels = chunk.readUnsignedShort(); samplerate = chunk.readUnsignedInt(); /* framerate = */chunk.readUnsignedInt(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java index af9c7160e7e..9bf8c9200ad 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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,13 +28,11 @@ package com.sun.media.sound; import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; - /** * WAVE file format class. * * @author Jan Borgersen */ - final class WaveFileFormat extends AudioFileFormat { /** @@ -53,15 +51,16 @@ final class WaveFileFormat extends AudioFileFormat { private static final int STANDARD_FMT_CHUNK_SIZE = 16; // magic numbers - static final int RIFF_MAGIC = 1380533830; - static final int WAVE_MAGIC = 1463899717; - static final int FMT_MAGIC = 0x666d7420; // "fmt " - static final int DATA_MAGIC = 0x64617461; // "data" + static final int RIFF_MAGIC = 1380533830; + static final int WAVE_MAGIC = 1463899717; + static final int FMT_MAGIC = 0x666d7420; // "fmt " + static final int DATA_MAGIC = 0x64617461; // "data" // encodings static final int WAVE_FORMAT_UNKNOWN = 0x0000; static final int WAVE_FORMAT_PCM = 0x0001; static final int WAVE_FORMAT_ADPCM = 0x0002; + static final int WAVE_FORMAT_IEEE_FLOAT= 0x0003; static final int WAVE_FORMAT_ALAW = 0x0006; static final int WAVE_FORMAT_MULAW = 0x0007; static final int WAVE_FORMAT_OKI_ADPCM = 0x0010; @@ -72,12 +71,7 @@ final class WaveFileFormat extends AudioFileFormat { static final int WAVE_IBM_FORMAT_ADPCM = 0x0103; static final int WAVE_FORMAT_DVI_ADPCM = 0x0011; static final int WAVE_FORMAT_SX7383 = 0x1C07; - - - WaveFileFormat( AudioFileFormat aff ) { - - this( aff.getType(), aff.getByteLength(), aff.getFormat(), aff.getFrameLength() ); - } + static final int WAVE_FORMAT_EXTENSIBLE= 0xFFFE; WaveFileFormat(AudioFileFormat.Type type, int lengthInBytes, AudioFormat format, int lengthInFrames) { @@ -98,7 +92,6 @@ final class WaveFileFormat extends AudioFileFormat { } int getWaveType() { - return waveType; } diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java index 199364c94f4..752afc512c9 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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,23 +25,22 @@ package com.sun.media.sound; -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.IOException; - import java.io.BufferedOutputStream; -import java.io.DataOutputStream; -import java.io.FileOutputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.io.SequenceInputStream; import java.util.Objects; import javax.sound.sampled.AudioFileFormat; -import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; //$$fb this class is buggy. Should be replaced in future. @@ -53,27 +52,6 @@ import javax.sound.sampled.AudioSystem; */ public final class WaveFileWriter extends SunFileWriter { - // magic numbers - static final int RIFF_MAGIC = 1380533830; - static final int WAVE_MAGIC = 1463899717; - static final int FMT_MAGIC = 0x666d7420; // "fmt " - static final int DATA_MAGIC = 0x64617461; // "data" - - // encodings - static final int WAVE_FORMAT_UNKNOWN = 0x0000; - static final int WAVE_FORMAT_PCM = 0x0001; - static final int WAVE_FORMAT_ADPCM = 0x0002; - static final int WAVE_FORMAT_ALAW = 0x0006; - static final int WAVE_FORMAT_MULAW = 0x0007; - static final int WAVE_FORMAT_OKI_ADPCM = 0x0010; - static final int WAVE_FORMAT_DIGISTD = 0x0015; - static final int WAVE_FORMAT_DIGIFIX = 0x0016; - static final int WAVE_IBM_FORMAT_MULAW = 0x0101; - static final int WAVE_IBM_FORMAT_ALAW = 0x0102; - static final int WAVE_IBM_FORMAT_ADPCM = 0x0103; - static final int WAVE_FORMAT_DVI_ADPCM = 0x0011; - static final int WAVE_FORMAT_SX7383 = 0x1C07; - /** * Constructs a new WaveFileWriter object. */ @@ -81,10 +59,7 @@ public final class WaveFileWriter extends SunFileWriter { super(new AudioFileFormat.Type[]{AudioFileFormat.Type.WAVE}); } - - // METHODS TO IMPLEMENT AudioFileWriter - - + @Override public AudioFileFormat.Type[] getAudioFileTypes(AudioInputStream stream) { AudioFileFormat.Type[] filetypes = new AudioFileFormat.Type[types.length]; @@ -106,6 +81,7 @@ public final class WaveFileWriter extends SunFileWriter { } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -125,11 +101,11 @@ public final class WaveFileWriter extends SunFileWriter { throw new IOException("stream length not specified"); } - int bytesWritten = writeWaveFile(stream, waveFileFormat, out); - return bytesWritten; + return writeWaveFile(stream, waveFileFormat, out); } + @Override public int write(AudioInputStream stream, AudioFileFormat.Type fileType, File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); @@ -173,6 +149,9 @@ public final class WaveFileWriter extends SunFileWriter { * Throws IllegalArgumentException if not supported. */ private AudioFileFormat getAudioFileFormat(AudioFileFormat.Type type, AudioInputStream stream) { + if (!isFileTypeSupported(type, stream)) { + throw new IllegalArgumentException("File type " + type + " not supported."); + } AudioFormat format = null; WaveFileFormat fileFormat = null; AudioFormat.Encoding encoding = AudioFormat.Encoding.PCM_SIGNED; @@ -187,9 +166,6 @@ public final class WaveFileWriter extends SunFileWriter { float frameRate; int fileSize; - if (!types[0].equals(type)) { - throw new IllegalArgumentException("File type " + type + " not supported."); - } int waveType = WaveFileFormat.WAVE_FORMAT_PCM; if( AudioFormat.Encoding.ALAW.equals(streamEncoding) || @@ -198,9 +174,9 @@ public final class WaveFileWriter extends SunFileWriter { encoding = streamEncoding; sampleSizeInBits = streamFormat.getSampleSizeInBits(); if (streamEncoding.equals(AudioFormat.Encoding.ALAW)) { - waveType = WAVE_FORMAT_ALAW; + waveType = WaveFileFormat.WAVE_FORMAT_ALAW; } else { - waveType = WAVE_FORMAT_MULAW; + waveType = WaveFileFormat.WAVE_FORMAT_MULAW; } } else if ( streamFormat.getSampleSizeInBits()==8 ) { encoding = AudioFormat.Encoding.PCM_UNSIGNED; diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java index 3fe278fc70c..afecd0e34be 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,8 +67,9 @@ public final class WaveFloatFileReader extends SunFileReader { fmt_found = true; int format = chunk.readUnsignedShort(); - if (format != 3) // WAVE_FORMAT_IEEE_FLOAT only + if (format != WaveFileFormat.WAVE_FORMAT_IEEE_FLOAT) { throw new UnsupportedAudioFileException(); + } channels = chunk.readUnsignedShort(); samplerate = chunk.readUnsignedInt(); /* framerate = */chunk.readUnsignedInt(); diff --git a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java index 2845083384a..b2529f48f5c 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/media/sound/WaveFloatFileWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * 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,18 +22,20 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package com.sun.media.sound; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.Objects; import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioFileFormat.Type; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioFormat.Encoding; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; -import javax.sound.sampled.AudioFileFormat.Type; import javax.sound.sampled.spi.AudioFileWriter; /** @@ -43,10 +45,12 @@ import javax.sound.sampled.spi.AudioFileWriter; */ public final class WaveFloatFileWriter extends AudioFileWriter { + @Override public Type[] getAudioFileTypes() { - return new Type[] { Type.WAVE }; + return new Type[]{Type.WAVE}; } + @Override public Type[] getAudioFileTypes(AudioInputStream stream) { if (!stream.getFormat().getEncoding().equals(Encoding.PCM_FLOAT)) @@ -92,18 +96,22 @@ public final class WaveFloatFileWriter extends AudioFileWriter { this.out = out; } + @Override public void write(int b) throws IOException { out.write(b); } + @Override public void flush() throws IOException { out.flush(); } + @Override public void write(byte[] b, int off, int len) throws IOException { out.write(b, off, len); } + @Override public void write(byte[] b) throws IOException { out.write(b); } @@ -118,8 +126,12 @@ public final class WaveFloatFileWriter extends AudioFileWriter { return AudioSystem.getAudioInputStream(targetFormat, ais); } + @Override public int write(AudioInputStream stream, Type fileType, OutputStream out) throws IOException { + Objects.requireNonNull(stream); + Objects.requireNonNull(fileType); + Objects.requireNonNull(out); checkFormat(fileType, stream); if (stream.getFormat().isBigEndian()) @@ -131,8 +143,13 @@ public final class WaveFloatFileWriter extends AudioFileWriter { return fpointer; } + @Override public int write(AudioInputStream stream, Type fileType, File out) throws IOException { + Objects.requireNonNull(stream); + Objects.requireNonNull(fileType); + Objects.requireNonNull(out); + checkFormat(fileType, stream); if (stream.getFormat().isBigEndian()) stream = toLittleEndian(stream); @@ -142,5 +159,4 @@ public final class WaveFloatFileWriter extends AudioFileWriter { writer.close(); return fpointer; } - } diff --git a/jdk/src/java.desktop/share/classes/java/applet/Applet.java b/jdk/src/java.desktop/share/classes/java/applet/Applet.java index aed6eae421b..0e02c9cb054 100644 --- a/jdk/src/java.desktop/share/classes/java/applet/Applet.java +++ b/jdk/src/java.desktop/share/classes/java/applet/Applet.java @@ -38,9 +38,9 @@ import javax.accessibility.*; * An applet is a small program that is intended not to be run on * its own, but rather to be embedded inside another application. *

- * The Applet class must be the superclass of any + * The {@code Applet} class must be the superclass of any * applet that is to be embedded in a Web page or viewed by the Java - * Applet Viewer. The Applet class provides a standard + * Applet Viewer. The {@code Applet} class provides a standard * interface between applets and their environment. * * @author Arthur van Hoff @@ -52,10 +52,10 @@ public class Applet extends Panel { /** * Constructs a new Applet. *

- * Note: Many methods in java.applet.Applet + * Note: Many methods in {@code java.applet.Applet} * may be invoked by the applet only after the applet is * fully constructed; applet should avoid calling methods - * in java.applet.Applet in the constructor. + * in {@code java.applet.Applet} in the constructor. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -88,8 +88,8 @@ public class Applet extends Panel { * Read an applet from an object input stream. * @param s an object input stream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @serial * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.4 @@ -104,9 +104,9 @@ public class Applet extends Panel { /** * Sets this applet's stub. This is done automatically by the system. - *

If there is a security manager, its checkPermission + *

If there is a security manager, its {@code checkPermission} * method is called with the - * AWTPermission("setAppletStub") + * {@code AWTPermission("setAppletStub")} * permission if a stub has already been set. * @param stub the new stub. * @exception SecurityException if the caller cannot set the stub @@ -123,11 +123,11 @@ public class Applet extends Panel { /** * Determines if this applet is active. An applet is marked active - * just before its start method is called. It becomes - * inactive just before its stop method is called. + * just before its {@code start} method is called. It becomes + * inactive just before its {@code stop} method is called. * - * @return true if the applet is active; - * false otherwise. + * @return {@code true} if the applet is active; + * {@code false} otherwise. * @see java.applet.Applet#start() * @see java.applet.Applet#stop() */ @@ -179,14 +179,14 @@ public class Applet extends Panel { * </applet> * *

- * then a call to getParameter("Color") returns the - * value "blue". + * then a call to {@code getParameter("Color")} returns the + * value {@code "blue"}. *

- * The name argument is case insensitive. + * The {@code name} argument is case insensitive. * * @param name a parameter name. * @return the value of the named parameter, - * or null if not set. + * or {@code null} if not set. */ public String getParameter(String name) { return stub.getParameter(name); @@ -260,8 +260,8 @@ public class Applet extends Panel { } /** - * Returns an Image object that can then be painted on - * the screen. The url that is passed as an argument + * Returns an {@code Image} object that can then be painted on + * the screen. The {@code url} that is passed as an argument * must specify an absolute URL. *

* This method always returns immediately, whether or not the image @@ -278,10 +278,10 @@ public class Applet extends Panel { } /** - * Returns an Image object that can then be painted on - * the screen. The url argument must specify an absolute - * URL. The name argument is a specifier that is - * relative to the url argument. + * Returns an {@code Image} object that can then be painted on + * the screen. The {@code url} argument must specify an absolute + * URL. The {@code name} argument is a specifier that is + * relative to the {@code url} argument. *

* This method always returns immediately, whether or not the image * exists. When this applet attempts to draw the image on the screen, @@ -290,7 +290,7 @@ public class Applet extends Panel { * * @param url an absolute URL giving the base location of the image. * @param name the location of the image, relative to the - * url argument. + * {@code url} argument. * @return the image at the specified URL. * @see java.awt.Image */ @@ -315,8 +315,8 @@ public class Applet extends Panel { } /** - * Returns the AudioClip object specified by the - * URL argument. + * Returns the {@code AudioClip} object specified by the + * {@code URL} argument. *

* This method always returns immediately, whether or not the audio * clip exists. When this applet attempts to play the audio clip, the @@ -331,8 +331,8 @@ public class Applet extends Panel { } /** - * Returns the AudioClip object specified by the - * URL and name arguments. + * Returns the {@code AudioClip} object specified by the + * {@code URL} and {@code name} arguments. *

* This method always returns immediately, whether or not the audio * clip exists. When this applet attempts to play the audio clip, the @@ -341,7 +341,7 @@ public class Applet extends Panel { * @param url an absolute URL giving the base location of the * audio clip. * @param name the location of the audio clip, relative to the - * url argument. + * {@code url} argument. * @return the audio clip at the specified URL. * @see java.applet.AudioClip */ @@ -355,11 +355,11 @@ public class Applet extends Panel { /** * Returns information about this applet. An applet should override - * this method to return a String containing information + * this method to return a {@code String} containing information * about the author, version, and copyright of the applet. *

* The implementation of this method provided by the - * Applet class returns null. + * {@code Applet} class returns {@code null}. * * @return a string containing information about the author, version, and * copyright of the applet. @@ -388,10 +388,10 @@ public class Applet extends Panel { /** * Returns information about the parameters that are understood by * this applet. An applet should override this method to return an - * array of Strings describing these parameters. + * array of {@code Strings} describing these parameters. *

* Each element of the array should be a set of three - * Strings containing the name, the type, and a + * {@code Strings} containing the name, the type, and a * description. For example: *

      * String pinfo[][] = {
@@ -402,7 +402,7 @@ public class Applet extends Panel {
      * 
*

* The implementation of this method provided by the - * Applet class returns null. + * {@code Applet} class returns {@code null}. * * @return an array describing the parameters this applet looks for. */ @@ -430,7 +430,7 @@ public class Applet extends Panel { * @param url an absolute URL giving the base location of the * audio clip. * @param name the location of the audio clip, relative to the - * url argument. + * {@code url} argument. */ public void play(URL url, String name) { AudioClip clip = getAudioClip(url, name); @@ -442,16 +442,16 @@ public class Applet extends Panel { /** * Called by the browser or applet viewer to inform * this applet that it has been loaded into the system. It is always - * called before the first time that the start method is + * called before the first time that the {@code start} method is * called. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has initialization to perform. For example, an applet with - * threads would use the init method to create the - * threads and the destroy method to kill them. + * threads would use the {@code init} method to create the + * threads and the {@code destroy} method to kill them. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#destroy() * @see java.applet.Applet#start() @@ -463,25 +463,25 @@ public class Applet extends Panel { /** * Called by the browser or applet viewer to inform * this applet that it should start its execution. It is called after - * the init method and each time the applet is revisited + * the {@code init} method and each time the applet is revisited * in a Web page. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has any operation that it wants to perform each time the Web * page containing it is visited. For example, an applet with - * animation might want to use the start method to - * resume animation, and the stop method to suspend the + * animation might want to use the {@code start} method to + * resume animation, and the {@code stop} method to suspend the * animation. *

- * Note: some methods, such as getLocationOnScreen, can only + * Note: some methods, such as {@code getLocationOnScreen}, can only * provide meaningful results if the applet is showing. Because - * isShowing returns false when the applet's - * start is first called, methods requiring - * isShowing to return true should be called from - * a ComponentListener. + * {@code isShowing} returns {@code false} when the applet's + * {@code start} is first called, methods requiring + * {@code isShowing} to return {@code true} should be called from + * a {@code ComponentListener}. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#destroy() * @see java.applet.Applet#init() @@ -498,15 +498,15 @@ public class Applet extends Panel { * the Web page that contains this applet has been replaced by * another page, and also just before the applet is to be destroyed. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has any operation that it wants to perform each time the Web * page containing it is no longer visible. For example, an applet - * with animation might want to use the start method to - * resume animation, and the stop method to suspend the + * with animation might want to use the {@code start} method to + * resume animation, and the {@code stop} method to suspend the * animation. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#destroy() * @see java.applet.Applet#init() @@ -517,17 +517,17 @@ public class Applet extends Panel { /** * Called by the browser or applet viewer to inform * this applet that it is being reclaimed and that it should destroy - * any resources that it has allocated. The stop method - * will always be called before destroy. + * any resources that it has allocated. The {@code stop} method + * will always be called before {@code destroy}. *

- * A subclass of Applet should override this method if + * A subclass of {@code Applet} should override this method if * it has any operation that it wants to perform before it is * destroyed. For example, an applet with threads would use the - * init method to create the threads and the - * destroy method to kill them. + * {@code init} method to create the threads and the + * {@code destroy} method to kill them. *

* The implementation of this method provided by the - * Applet class does nothing. + * {@code Applet} class does nothing. * * @see java.applet.Applet#init() * @see java.applet.Applet#start() @@ -561,7 +561,7 @@ public class Applet extends Panel { /** * This class implements accessibility support for the - * Applet class. It provides an implementation of the + * {@code Applet} class. It provides an implementation of the * Java Accessibility API appropriate to applet user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java b/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java index 8356e492e49..f935fa4965b 100644 --- a/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java +++ b/jdk/src/java.desktop/share/classes/java/applet/AudioClip.java @@ -26,8 +26,8 @@ package java.applet; /** - * The AudioClip interface is a simple abstraction for - * playing a sound clip. Multiple AudioClip items can be + * The {@code AudioClip} interface is a simple abstraction for + * playing a sound clip. Multiple {@code AudioClip} items can be * playing at the same time, and the resulting sound is mixed * together to produce a composite. * diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTError.java b/jdk/src/java.desktop/share/classes/java/awt/AWTError.java index 1110a6450c0..6ea6a2adb97 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTError.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTError.java @@ -38,7 +38,7 @@ public class AWTError extends Error { private static final long serialVersionUID = -1819846354050686206L; /** - * Constructs an instance of AWTError with the specified + * Constructs an instance of {@code AWTError} with the specified * detail message. * @param msg the detail message. * @since 1.0 diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java index 04c4effeafa..1c723aeb133 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTEvent.java @@ -410,11 +410,11 @@ public abstract class AWTEvent extends EventObject { } /** - * Returns a string representing the state of this Event. + * Returns a string representing the state of this {@code Event}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return a string representation of this event */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java b/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java index 8297188f1f9..a9f102643f4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java @@ -122,9 +122,9 @@ public class AWTEventMulticaster implements /** * Creates an event multicaster instance which chains listener-a - * with listener-b. Input parameters a and b - * should not be null, though implementations may vary in - * choosing whether or not to throw NullPointerException + * with listener-b. Input parameters {@code a} and {@code b} + * should not be {@code null}, though implementations may vary in + * choosing whether or not to throw {@code NullPointerException} * in that case. * @param a listener-a * @param b listener-b @@ -1078,30 +1078,30 @@ public class AWTEventMulticaster implements /** * Returns an array of all the objects chained as * FooListeners by the specified - * java.util.EventListener. + * {@code java.util.EventListener}. * FooListeners are chained by the - * AWTEventMulticaster using the + * {@code AWTEventMulticaster} using the * addFooListener method. - * If a null listener is specified, this method returns an + * If a {@code null} listener is specified, this method returns an * empty array. If the specified listener is not an instance of - * AWTEventMulticaster, this method returns an array which + * {@code AWTEventMulticaster}, this method returns an array which * contains only the specified listener. If no such listeners are chained, * this method returns an empty array. * * @param the listener type - * @param l the specified java.util.EventListener + * @param l the specified {@code java.util.EventListener} * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects chained as * FooListeners by the specified multicast * listener, or an empty array if no such listeners have been * chained by the specified multicast listener * @exception NullPointerException if the specified * {@code listenertype} parameter is {@code null} - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @since 1.4 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTException.java b/jdk/src/java.desktop/share/classes/java/awt/AWTException.java index 0ffe52cd00a..5518643b3f5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTException.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTException.java @@ -38,9 +38,9 @@ public class AWTException extends Exception { private static final long serialVersionUID = -1900414231151323879L; /** - * Constructs an instance of AWTException with the + * Constructs an instance of {@code AWTException} with the * specified detail message. A detail message is an - * instance of String that describes this particular + * instance of {@code String} that describes this particular * exception. * @param msg the detail message * @since 1.0 diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java index f49b16badd2..6e85f2b1bbf 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTKeyStroke.java @@ -37,22 +37,22 @@ import java.lang.reflect.Field; import sun.swing.SwingAccessor; /** - * An AWTKeyStroke represents a key action on the - * keyboard, or equivalent input device. AWTKeyStrokes + * An {@code AWTKeyStroke} represents a key action on the + * keyboard, or equivalent input device. {@code AWTKeyStroke}s * can correspond to only a press or release of a - * particular key, just as KEY_PRESSED and - * KEY_RELEASED KeyEvents do; + * particular key, just as {@code KEY_PRESSED} and + * {@code KEY_RELEASED KeyEvent}s do; * alternately, they can correspond to typing a specific Java character, just - * as KEY_TYPED KeyEvents do. - * In all cases, AWTKeyStrokes can specify modifiers + * as {@code KEY_TYPED KeyEvent}s do. + * In all cases, {@code AWTKeyStroke}s can specify modifiers * (alt, shift, control, meta, altGraph, or a combination thereof) which must be present * during the action for an exact match. *

- * AWTKeyStrokes are immutable, and are intended + * {@code AWTKeyStrokes} are immutable, and are intended * to be unique. Client code should never create an - * AWTKeyStroke on its own, but should instead use - * a variant of getAWTKeyStroke. Client use of these factory - * methods allows the AWTKeyStroke implementation + * {@code AWTKeyStroke} on its own, but should instead use + * a variant of {@code getAWTKeyStroke}. Client use of these factory + * methods allows the {@code AWTKeyStroke} implementation * to cache and share instances efficiently. * * @see #getAWTKeyStroke @@ -88,17 +88,17 @@ public class AWTKeyStroke implements Serializable { } /** - * Constructs an AWTKeyStroke with default values. + * Constructs an {@code AWTKeyStroke} with default values. * The default values used are: * * * * - * + * * * * - * + * * * * @@ -106,12 +106,12 @@ public class AWTKeyStroke implements Serializable { * * * - * + * * *
PropertyDefault Value
Key CharKeyEvent.CHAR_UNDEFINED{@code KeyEvent.CHAR_UNDEFINED}
Key CodeKeyEvent.VK_UNDEFINED{@code KeyEvent.VK_UNDEFINED}
Modifiers
On key release?false{@code false}
* - * AWTKeyStrokes should not be constructed - * by client code. Use a variant of getAWTKeyStroke + * {@code AWTKeyStroke}s should not be constructed + * by client code. Use a variant of {@code getAWTKeyStroke} * instead. * * @see #getAWTKeyStroke @@ -120,17 +120,17 @@ public class AWTKeyStroke implements Serializable { } /** - * Constructs an AWTKeyStroke with the specified - * values. AWTKeyStrokes should not be constructed - * by client code. Use a variant of getAWTKeyStroke + * Constructs an {@code AWTKeyStroke} with the specified + * values. {@code AWTKeyStroke}s should not be constructed + * by client code. Use a variant of {@code getAWTKeyStroke} * instead. * * @param keyChar the character value for a keyboard key - * @param keyCode the key code for this AWTKeyStroke + * @param keyCode the key code for this {@code AWTKeyStroke} * @param modifiers a bitwise-ored combination of any modifiers - * @param onKeyRelease true if this - * AWTKeyStroke corresponds - * to a key release; false otherwise + * @param onKeyRelease {@code true} if this + * {@code AWTKeyStroke} corresponds + * to a key release; {@code false} otherwise * @see #getAWTKeyStroke */ protected AWTKeyStroke(char keyChar, int keyCode, int modifiers, @@ -185,12 +185,12 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a shared instance of an AWTKeyStroke - * that represents a KEY_TYPED event for the + * Returns a shared instance of an {@code AWTKeyStroke} + * that represents a {@code KEY_TYPED} event for the * specified character. * * @param keyChar the character value for a keyboard key - * @return an AWTKeyStroke object for that key + * @return an {@code AWTKeyStroke} object for that key */ public static AWTKeyStroke getAWTKeyStroke(char keyChar) { return getCachedStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, false); @@ -202,7 +202,7 @@ public class AWTKeyStroke implements Serializable { * specified Character object and a set of modifiers. Note * that the first parameter is of type Character rather than * char. This is to avoid inadvertent clashes with - * calls to getAWTKeyStroke(int keyCode, int modifiers). + * calls to {@code getAWTKeyStroke(int keyCode, int modifiers)}. * * The modifiers consist of any combination of following:

    *
  • java.awt.event.InputEvent.SHIFT_DOWN_MASK @@ -227,9 +227,9 @@ public class AWTKeyStroke implements Serializable { * * @param keyChar the Character object for a keyboard character * @param modifiers a bitwise-ored combination of any modifiers - * @return an AWTKeyStroke object for that key - * @throws IllegalArgumentException if keyChar is - * null + * @return an {@code AWTKeyStroke} object for that key + * @throws IllegalArgumentException if {@code keyChar} is + * {@code null} * * @see java.awt.event.InputEvent */ @@ -243,19 +243,19 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a shared instance of an AWTKeyStroke, + * Returns a shared instance of an {@code AWTKeyStroke}, * given a numeric key code and a set of modifiers, specifying * whether the key is activated when it is pressed or released. *

    * The "virtual key" constants defined in - * java.awt.event.KeyEvent can be + * {@code java.awt.event.KeyEvent} can be * used to specify the key code. For example:

      - *
    • java.awt.event.KeyEvent.VK_ENTER - *
    • java.awt.event.KeyEvent.VK_TAB - *
    • java.awt.event.KeyEvent.VK_SPACE + *
    • {@code java.awt.event.KeyEvent.VK_ENTER} + *
    • {@code java.awt.event.KeyEvent.VK_TAB} + *
    • {@code java.awt.event.KeyEvent.VK_SPACE} *
    * Alternatively, the key code may be obtained by calling - * java.awt.event.KeyEvent.getExtendedKeyCodeForChar. + * {@code java.awt.event.KeyEvent.getExtendedKeyCodeForChar}. * * The modifiers consist of any combination of:
      *
    • java.awt.event.InputEvent.SHIFT_DOWN_MASK @@ -279,8 +279,8 @@ public class AWTKeyStroke implements Serializable { * * @param keyCode an int specifying the numeric code for a keyboard key * @param modifiers a bitwise-ored combination of any modifiers - * @param onKeyRelease true if the AWTKeyStroke - * should represent a key release; false otherwise + * @param onKeyRelease {@code true} if the {@code AWTKeyStroke} + * should represent a key release; {@code false} otherwise * @return an AWTKeyStroke object for that key * * @see java.awt.event.KeyEvent @@ -293,16 +293,16 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a shared instance of an AWTKeyStroke, + * Returns a shared instance of an {@code AWTKeyStroke}, * given a numeric key code and a set of modifiers. The returned - * AWTKeyStroke will correspond to a key press. + * {@code AWTKeyStroke} will correspond to a key press. *

      * The "virtual key" constants defined in - * java.awt.event.KeyEvent can be + * {@code java.awt.event.KeyEvent} can be * used to specify the key code. For example:

        - *
      • java.awt.event.KeyEvent.VK_ENTER - *
      • java.awt.event.KeyEvent.VK_TAB - *
      • java.awt.event.KeyEvent.VK_SPACE + *
      • {@code java.awt.event.KeyEvent.VK_ENTER} + *
      • {@code java.awt.event.KeyEvent.VK_TAB} + *
      • {@code java.awt.event.KeyEvent.VK_SPACE} *
      * The modifiers consist of any combination of:
        *
      • java.awt.event.InputEvent.SHIFT_DOWN_MASK @@ -326,7 +326,7 @@ public class AWTKeyStroke implements Serializable { * * @param keyCode an int specifying the numeric code for a keyboard key * @param modifiers a bitwise-ored combination of any modifiers - * @return an AWTKeyStroke object for that key + * @return an {@code AWTKeyStroke} object for that key * * @see java.awt.event.KeyEvent * @see java.awt.event.InputEvent @@ -337,18 +337,18 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns an AWTKeyStroke which represents the - * stroke which generated a given KeyEvent. + * Returns an {@code AWTKeyStroke} which represents the + * stroke which generated a given {@code KeyEvent}. *

        - * This method obtains the keyChar from a KeyTyped - * event, and the keyCode from a KeyPressed or - * KeyReleased event. The KeyEvent modifiers are - * obtained for all three types of KeyEvent. + * This method obtains the keyChar from a {@code KeyTyped} + * event, and the keyCode from a {@code KeyPressed} or + * {@code KeyReleased} event. The {@code KeyEvent} modifiers are + * obtained for all three types of {@code KeyEvent}. * - * @param anEvent the KeyEvent from which to - * obtain the AWTKeyStroke - * @throws NullPointerException if anEvent is null - * @return the AWTKeyStroke that precipitated the event + * @param anEvent the {@code KeyEvent} from which to + * obtain the {@code AWTKeyStroke} + * @throws NullPointerException if {@code anEvent} is null + * @return the {@code AWTKeyStroke} that precipitated the event */ public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent anEvent) { int id = anEvent.getID(); @@ -371,7 +371,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Parses a string and returns an AWTKeyStroke. + * Parses a string and returns an {@code AWTKeyStroke}. * The string must have the following syntax: *

              *    <modifiers>* (<typedID> | <pressedReleasedID>)
        @@ -393,8 +393,8 @@ public class AWTKeyStroke implements Serializable {
              * 
        * * @param s a String formatted as described above - * @return an AWTKeyStroke object for that String - * @throws IllegalArgumentException if s is null, + * @return an {@code AWTKeyStroke} object for that String + * @throws IllegalArgumentException if {@code s} is {@code null}, * or is formatted incorrectly */ public static AWTKeyStroke getAWTKeyStroke(String s) { @@ -500,8 +500,8 @@ public class AWTKeyStroke implements Serializable { } /** * Returns the integer constant for the KeyEvent.VK field named - * key. This will throw an - * IllegalArgumentException if key is + * {@code key}. This will throw an + * {@code IllegalArgumentException} if {@code key} is * not a valid constant. */ private static int getVKValue(String key) { @@ -527,7 +527,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the character for this AWTKeyStroke. + * Returns the character for this {@code AWTKeyStroke}. * * @return a char value * @see #getAWTKeyStroke(char) @@ -538,7 +538,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the numeric key code for this AWTKeyStroke. + * Returns the numeric key code for this {@code AWTKeyStroke}. * * @return an int containing the key code value * @see #getAWTKeyStroke(int,int) @@ -549,7 +549,7 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the modifier keys for this AWTKeyStroke. + * Returns the modifier keys for this {@code AWTKeyStroke}. * * @return an int containing the modifiers * @see #getAWTKeyStroke(int,int) @@ -559,10 +559,10 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns whether this AWTKeyStroke represents a key release. + * Returns whether this {@code AWTKeyStroke} represents a key release. * - * @return true if this AWTKeyStroke - * represents a key release; false otherwise + * @return {@code true} if this {@code AWTKeyStroke} + * represents a key release; {@code false} otherwise * @see #getAWTKeyStroke(int,int,boolean) */ public final boolean isOnKeyRelease() { @@ -570,12 +570,12 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns the type of KeyEvent which corresponds to - * this AWTKeyStroke. + * Returns the type of {@code KeyEvent} which corresponds to + * this {@code AWTKeyStroke}. * - * @return KeyEvent.KEY_PRESSED, - * KeyEvent.KEY_TYPED, - * or KeyEvent.KEY_RELEASED + * @return {@code KeyEvent.KEY_PRESSED}, + * {@code KeyEvent.KEY_TYPED}, + * or {@code KeyEvent.KEY_RELEASED} * @see java.awt.event.KeyEvent */ public final int getKeyEventType() { @@ -617,8 +617,8 @@ public class AWTKeyStroke implements Serializable { /** * Returns a string that displays and identifies this object's properties. - * The String returned by this method can be passed - * as a parameter to getAWTKeyStroke(String) to produce + * The {@code String} returned by this method can be passed + * as a parameter to {@code getAWTKeyStroke(String)} to produce * a key stroke equal to this key stroke. * * @return a String representation of this object @@ -695,8 +695,8 @@ public class AWTKeyStroke implements Serializable { } /** - * Returns a cached instance of AWTKeyStroke (or a subclass of - * AWTKeyStroke) which is equal to this instance. + * Returns a cached instance of {@code AWTKeyStroke} (or a subclass of + * {@code AWTKeyStroke}) which is equal to this instance. * * @return a cached instance which is equal to this instance * @throws java.io.ObjectStreamException if a serialization problem occurs diff --git a/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java b/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java index a201670bec8..5eedadb383b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AWTPermission.java @@ -29,7 +29,7 @@ import java.security.BasicPermission; /** * This class is for AWT permissions. - * An AWTPermission contains a target name but + * An {@code AWTPermission} contains a target name but * no actions list; you either have the named permission * or you don't. * @@ -39,7 +39,7 @@ import java.security.BasicPermission; * Also, an asterisk could be used to represent all AWT permissions. * *

        - * The following table lists all the possible AWTPermission + * The following table lists all the possible {@code AWTPermission} * target names, and for each provides a description of what the * permission allows and a discussion of the risks of granting code * the permission. @@ -125,12 +125,12 @@ import java.security.BasicPermission; * * * replaceKeyboardFocusManager - * Sets the KeyboardFocusManager for + * Sets the {@code KeyboardFocusManager} for * a particular thread. - * When SecurityManager is installed, the invoking + * When {@code SecurityManager} is installed, the invoking * thread must be granted this permission in order to replace - * the current KeyboardFocusManager. If permission - * is not granted, a SecurityException will be thrown. + * the current {@code KeyboardFocusManager}. If permission + * is not granted, a {@code SecurityException} will be thrown. * * * @@ -201,15 +201,15 @@ public final class AWTPermission extends BasicPermission { private static final long serialVersionUID = 8890392402588814465L; /** - * Creates a new AWTPermission with the specified name. - * The name is the symbolic name of the AWTPermission, + * Creates a new {@code AWTPermission} with the specified name. + * The name is the symbolic name of the {@code AWTPermission}, * such as "topLevelWindow", "systemClipboard", etc. An asterisk * may be used to indicate all AWT permissions. * * @param name the name of the AWTPermission * - * @throws NullPointerException if name is null. - * @throws IllegalArgumentException if name is empty. + * @throws NullPointerException if {@code name} is {@code null}. + * @throws IllegalArgumentException if {@code name} is empty. */ public AWTPermission(String name) @@ -218,15 +218,15 @@ public final class AWTPermission extends BasicPermission { } /** - * Creates a new AWTPermission object with the specified name. - * The name is the symbolic name of the AWTPermission, and the - * actions string is currently unused and should be null. + * Creates a new {@code AWTPermission} object with the specified name. + * The name is the symbolic name of the {@code AWTPermission}, and the + * actions string is currently unused and should be {@code null}. * - * @param name the name of the AWTPermission - * @param actions should be null + * @param name the name of the {@code AWTPermission} + * @param actions should be {@code null} * - * @throws NullPointerException if name is null. - * @throws IllegalArgumentException if name is empty. + * @throws NullPointerException if {@code name} is {@code null}. + * @throws IllegalArgumentException if {@code name} is empty. */ public AWTPermission(String name, String actions) diff --git a/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java b/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java index e7dbd875938..857eea54668 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ActiveEvent.java @@ -28,19 +28,19 @@ package java.awt; /** * An interface for events that know how to dispatch themselves. * By implementing this interface an event can be placed upon the event - * queue and its dispatch() method will be called when the event - * is dispatched, using the EventDispatchThread. + * queue and its {@code dispatch()} method will be called when the event + * is dispatched, using the {@code EventDispatchThread}. *

        * This is a very useful mechanism for avoiding deadlocks. If * a thread is executing in a critical section (i.e., it has entered * one or more monitors), calling other synchronized code may * cause deadlocks. To avoid the potential deadlocks, an - * ActiveEvent can be created to run the second section of + * {@code ActiveEvent} can be created to run the second section of * code at later time. If there is contention on the monitor, * the second thread will simply block until the first thread * has finished its work and exited its monitors. *

        - * For security reasons, it is often desirable to use an ActiveEvent + * For security reasons, it is often desirable to use an {@code ActiveEvent} * to avoid calling untrusted code from a critical thread. For * instance, peer implementations can use this facility to avoid * making calls into user code from a system thread. Doing so avoids diff --git a/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java b/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java index 6193a07c965..916dbf0b28f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Adjustable.java @@ -39,25 +39,25 @@ import java.lang.annotation.Native; public interface Adjustable { /** - * Indicates that the Adjustable has horizontal orientation. + * Indicates that the {@code Adjustable} has horizontal orientation. */ @Native public static final int HORIZONTAL = 0; /** - * Indicates that the Adjustable has vertical orientation. + * Indicates that the {@code Adjustable} has vertical orientation. */ @Native public static final int VERTICAL = 1; /** - * Indicates that the Adjustable has no orientation. + * Indicates that the {@code Adjustable} has no orientation. */ @Native public static final int NO_ORIENTATION = 2; /** * Gets the orientation of the adjustable object. * @return the orientation of the adjustable object; - * either HORIZONTAL, VERTICAL, - * or NO_ORIENTATION + * either {@code HORIZONTAL}, {@code VERTICAL}, + * or {@code NO_ORIENTATION} */ int getOrientation(); @@ -124,15 +124,15 @@ public interface Adjustable { /** * Sets the current value of the adjustable object. If - * the value supplied is less than minimum - * or greater than maximum - visibleAmount, + * the value supplied is less than {@code minimum} + * or greater than {@code maximum} - {@code visibleAmount}, * then one of those values is substituted, as appropriate. *

        * Calling this method does not fire an - * AdjustmentEvent. + * {@code AdjustmentEvent}. * - * @param v the current value, between minimum - * and maximum - visibleAmount + * @param v the current value, between {@code minimum} + * and {@code maximum} - {@code visibleAmount} */ void setValue(int v); diff --git a/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java b/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java index 1c5b7426986..dc650632d08 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java +++ b/jdk/src/java.desktop/share/classes/java/awt/AlphaComposite.java @@ -30,7 +30,7 @@ import java.lang.annotation.Native; import sun.java2d.SunCompositeContext; /** - * The AlphaComposite class implements basic alpha + * The {@code AlphaComposite} class implements basic alpha * compositing rules for combining source and destination colors * to achieve blending and transparency effects with graphics and * images. @@ -44,7 +44,7 @@ import sun.java2d.SunCompositeContext; *

        * This class extends the standard equations defined by Porter and * Duff to include one additional factor. - * An instance of the AlphaComposite class can contain + * An instance of the {@code AlphaComposite} class can contain * an alpha value that is used to modify the opacity or coverage of * every source pixel before it is used in the blending equations. * @@ -52,7 +52,7 @@ import sun.java2d.SunCompositeContext; * It is important to note that the equations defined by the Porter * and Duff paper are all defined to operate on color components * that are premultiplied by their corresponding alpha components. - * Since the ColorModel and Raster classes + * Since the {@code ColorModel} and {@code Raster} classes * allow the storage of pixel data in either premultiplied or * non-premultiplied form, all input data must be normalized into * premultiplied form before applying the equations and all results @@ -96,7 +96,7 @@ import sun.java2d.SunCompositeContext; * that specify visual effects. * For example, * the description for - * SRC_OVER + * {@code SRC_OVER} * specifies that Fs = 1 and Fd = (1-As). * Once a set of equations for determining the blending factors is * known they can then be applied to each pixel to produce a result @@ -128,12 +128,12 @@ import sun.java2d.SunCompositeContext; *

        Preparing Inputs

        * *

        - * The AlphaComposite class defines an additional alpha + * The {@code AlphaComposite} class defines an additional alpha * value that is applied to the source alpha. * This value is applied as if an implicit SRC_IN rule were first * applied to the source pixel against a pixel with the indicated * alpha by multiplying both the raw source alpha and the raw - * source colors by the alpha in the AlphaComposite. + * source colors by the alpha in the {@code AlphaComposite}. * This leads to the following equation for producing the alpha * used in the Porter and Duff blending equation: * @@ -141,7 +141,7 @@ import sun.java2d.SunCompositeContext; * As = Asr * Aac * * All of the raw source color components need to be multiplied - * by the alpha in the AlphaComposite instance. + * by the alpha in the {@code AlphaComposite} instance. * Additionally, if the source was not in premultiplied form * then the color components also need to be multiplied by the * source alpha. @@ -196,11 +196,11 @@ import sun.java2d.SunCompositeContext; * *

        * For performance reasons, it is preferable that - * Raster objects passed to the compose + * {@code Raster} objects passed to the {@code compose} * method of a {@link CompositeContext} object created by the - * AlphaComposite class have premultiplied data. - * If either the source Raster - * or the destination Raster + * {@code AlphaComposite} class have premultiplied data. + * If either the source {@code Raster} + * or the destination {@code Raster} * is not premultiplied, however, * appropriate conversions are performed before and after the compositing * operation. @@ -210,7 +210,7 @@ import sun.java2d.SunCompositeContext; *

          *
        • * Many sources, such as some of the opaque image types listed - * in the BufferedImage class, do not store alpha values + * in the {@code BufferedImage} class, do not store alpha values * for their pixels. Such sources supply an alpha of 1.0 for * all of their pixels. * @@ -237,7 +237,7 @@ import sun.java2d.SunCompositeContext; * that does not separately store * color components is not a * good candidate for any type of translucent blending. - * For example, BufferedImage.TYPE_BYTE_INDEXED + * For example, {@code BufferedImage.TYPE_BYTE_INDEXED} * should not be used as a destination for a blending operation * because every operation * can introduce large errors, due to @@ -277,7 +277,7 @@ import sun.java2d.SunCompositeContext; *

          * If integer math were being used and this value were being * composited in - * SRC + * {@code SRC} * mode with no extra alpha, then the math would * indicate that the results were (in integer format): * @@ -510,21 +510,21 @@ public final class AlphaComposite implements Composite { @Native public static final int XOR = 12; /** - * AlphaComposite object that implements the opaque CLEAR rule + * {@code AlphaComposite} object that implements the opaque CLEAR rule * with an alpha of 1.0f. * @see #CLEAR */ public static final AlphaComposite Clear = new AlphaComposite(CLEAR); /** - * AlphaComposite object that implements the opaque SRC rule + * {@code AlphaComposite} object that implements the opaque SRC rule * with an alpha of 1.0f. * @see #SRC */ public static final AlphaComposite Src = new AlphaComposite(SRC); /** - * AlphaComposite object that implements the opaque DST rule + * {@code AlphaComposite} object that implements the opaque DST rule * with an alpha of 1.0f. * @see #DST * @since 1.4 @@ -532,49 +532,49 @@ public final class AlphaComposite implements Composite { public static final AlphaComposite Dst = new AlphaComposite(DST); /** - * AlphaComposite object that implements the opaque SRC_OVER rule + * {@code AlphaComposite} object that implements the opaque SRC_OVER rule * with an alpha of 1.0f. * @see #SRC_OVER */ public static final AlphaComposite SrcOver = new AlphaComposite(SRC_OVER); /** - * AlphaComposite object that implements the opaque DST_OVER rule + * {@code AlphaComposite} object that implements the opaque DST_OVER rule * with an alpha of 1.0f. * @see #DST_OVER */ public static final AlphaComposite DstOver = new AlphaComposite(DST_OVER); /** - * AlphaComposite object that implements the opaque SRC_IN rule + * {@code AlphaComposite} object that implements the opaque SRC_IN rule * with an alpha of 1.0f. * @see #SRC_IN */ public static final AlphaComposite SrcIn = new AlphaComposite(SRC_IN); /** - * AlphaComposite object that implements the opaque DST_IN rule + * {@code AlphaComposite} object that implements the opaque DST_IN rule * with an alpha of 1.0f. * @see #DST_IN */ public static final AlphaComposite DstIn = new AlphaComposite(DST_IN); /** - * AlphaComposite object that implements the opaque SRC_OUT rule + * {@code AlphaComposite} object that implements the opaque SRC_OUT rule * with an alpha of 1.0f. * @see #SRC_OUT */ public static final AlphaComposite SrcOut = new AlphaComposite(SRC_OUT); /** - * AlphaComposite object that implements the opaque DST_OUT rule + * {@code AlphaComposite} object that implements the opaque DST_OUT rule * with an alpha of 1.0f. * @see #DST_OUT */ public static final AlphaComposite DstOut = new AlphaComposite(DST_OUT); /** - * AlphaComposite object that implements the opaque SRC_ATOP rule + * {@code AlphaComposite} object that implements the opaque SRC_ATOP rule * with an alpha of 1.0f. * @see #SRC_ATOP * @since 1.4 @@ -582,7 +582,7 @@ public final class AlphaComposite implements Composite { public static final AlphaComposite SrcAtop = new AlphaComposite(SRC_ATOP); /** - * AlphaComposite object that implements the opaque DST_ATOP rule + * {@code AlphaComposite} object that implements the opaque DST_ATOP rule * with an alpha of 1.0f. * @see #DST_ATOP * @since 1.4 @@ -590,7 +590,7 @@ public final class AlphaComposite implements Composite { public static final AlphaComposite DstAtop = new AlphaComposite(DST_ATOP); /** - * AlphaComposite object that implements the opaque XOR rule + * {@code AlphaComposite} object that implements the opaque XOR rule * with an alpha of 1.0f. * @see #XOR * @since 1.4 @@ -620,11 +620,11 @@ public final class AlphaComposite implements Composite { } /** - * Creates an AlphaComposite object with the specified rule. + * Creates an {@code AlphaComposite} object with the specified rule. * * @param rule the compositing rule * @return the {@code AlphaComposite} object created - * @throws IllegalArgumentException if rule is not one of + * @throws IllegalArgumentException if {@code rule} is not one of * the following: {@link #CLEAR}, {@link #SRC}, {@link #DST}, * {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN}, * {@link #DST_IN}, {@link #SRC_OUT}, {@link #DST_OUT}, @@ -662,19 +662,19 @@ public final class AlphaComposite implements Composite { } /** - * Creates an AlphaComposite object with the specified rule and + * Creates an {@code AlphaComposite} object with the specified rule and * the constant alpha to multiply with the alpha of the source. * The source is multiplied with the specified alpha before being composited * with the destination. * * @param rule the compositing rule * @param alpha the constant alpha to be multiplied with the alpha of - * the source. alpha must be a floating point number in the + * the source. {@code alpha} must be a floating point number in the * inclusive range [0.0, 1.0]. * @return the {@code AlphaComposite} object created * @throws IllegalArgumentException if - * alpha is less than 0.0 or greater than 1.0, or if - * rule is not one of + * {@code alpha} is less than 0.0 or greater than 1.0, or if + * {@code rule} is not one of * the following: {@link #CLEAR}, {@link #SRC}, {@link #DST}, * {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN}, * {@link #DST_IN}, {@link #SRC_OUT}, {@link #DST_OUT}, @@ -692,8 +692,8 @@ public final class AlphaComposite implements Composite { * The context contains state that is used in performing * the compositing operation. * @param srcColorModel the {@link ColorModel} of the source - * @param dstColorModel the ColorModel of the destination - * @return the CompositeContext object to be used to perform + * @param dstColorModel the {@code ColorModel} of the destination + * @return the {@code CompositeContext} object to be used to perform * compositing operations. */ public CompositeContext createContext(ColorModel srcColorModel, @@ -703,32 +703,32 @@ public final class AlphaComposite implements Composite { } /** - * Returns the alpha value of this AlphaComposite. If this - * AlphaComposite does not have an alpha value, 1.0 is returned. - * @return the alpha value of this AlphaComposite. + * Returns the alpha value of this {@code AlphaComposite}. If this + * {@code AlphaComposite} does not have an alpha value, 1.0 is returned. + * @return the alpha value of this {@code AlphaComposite}. */ public float getAlpha() { return extraAlpha; } /** - * Returns the compositing rule of this AlphaComposite. - * @return the compositing rule of this AlphaComposite. + * Returns the compositing rule of this {@code AlphaComposite}. + * @return the compositing rule of this {@code AlphaComposite}. */ public int getRule() { return rule; } /** - * Returns a similar AlphaComposite object that uses + * Returns a similar {@code AlphaComposite} object that uses * the specified compositing rule. * If this object already uses the specified compositing rule, * this object is returned. - * @return an AlphaComposite object derived from + * @return an {@code AlphaComposite} object derived from * this object that uses the specified compositing rule. * @param rule the compositing rule * @throws IllegalArgumentException if - * rule is not one of + * {@code rule} is not one of * the following: {@link #CLEAR}, {@link #SRC}, {@link #DST}, * {@link #SRC_OVER}, {@link #DST_OVER}, {@link #SRC_IN}, * {@link #DST_IN}, {@link #SRC_OUT}, {@link #DST_OUT}, @@ -742,17 +742,17 @@ public final class AlphaComposite implements Composite { } /** - * Returns a similar AlphaComposite object that uses + * Returns a similar {@code AlphaComposite} object that uses * the specified alpha value. * If this object already has the specified alpha value, * this object is returned. - * @return an AlphaComposite object derived from + * @return an {@code AlphaComposite} object derived from * this object that uses the specified alpha value. * @param alpha the constant alpha to be multiplied with the alpha of - * the source. alpha must be a floating point number in the + * the source. {@code alpha} must be a floating point number in the * inclusive range [0.0, 1.0]. * @throws IllegalArgumentException if - * alpha is less than 0.0 or greater than 1.0 + * {@code alpha} is less than 0.0 or greater than 1.0 * @since 1.6 */ public AlphaComposite derive(float alpha) { @@ -771,16 +771,16 @@ public final class AlphaComposite implements Composite { /** * Determines whether the specified object is equal to this - * AlphaComposite. + * {@code AlphaComposite}. *

          - * The result is true if and only if - * the argument is not null and is an - * AlphaComposite object that has the same + * The result is {@code true} if and only if + * the argument is not {@code null} and is an + * {@code AlphaComposite} object that has the same * compositing rule and alpha value as this object. * - * @param obj the Object to test for equality - * @return true if obj equals this - * AlphaComposite; false otherwise. + * @param obj the {@code Object} to test for equality + * @return {@code true} if {@code obj} equals this + * {@code AlphaComposite}; {@code false} otherwise. */ public boolean equals(Object obj) { if (!(obj instanceof AlphaComposite)) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java b/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java index 4720e895892..4b23f936ad3 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/BorderLayout.java @@ -33,8 +33,8 @@ import java.util.Hashtable; * north, south, east, west, and center. * Each region may contain no more than one component, and * is identified by a corresponding constant: - * NORTH, SOUTH, EAST, - * WEST, and CENTER. When adding a + * {@code NORTH}, {@code SOUTH}, {@code EAST}, + * {@code WEST}, and {@code CENTER}. When adding a * component to a container with a border layout, use one of these * five constants, for example: *

          @@ -42,55 +42,55 @@ import java.util.Hashtable;
            *    p.setLayout(new BorderLayout());
            *    p.add(new Button("Okay"), BorderLayout.SOUTH);
            * 
          - * As a convenience, BorderLayout interprets the + * As a convenience, {@code BorderLayout} interprets the * absence of a string specification the same as the constant - * CENTER: + * {@code CENTER}: *
            *    Panel p2 = new Panel();
            *    p2.setLayout(new BorderLayout());
            *    p2.add(new TextArea());  // Same as p.add(new TextArea(), BorderLayout.CENTER);
            * 
          *

          - * In addition, BorderLayout supports the relative - * positioning constants, PAGE_START, PAGE_END, - * LINE_START, and LINE_END. - * In a container whose ComponentOrientation is set to - * ComponentOrientation.LEFT_TO_RIGHT, these constants map to - * NORTH, SOUTH, WEST, and - * EAST, respectively. + * In addition, {@code BorderLayout} supports the relative + * positioning constants, {@code PAGE_START}, {@code PAGE_END}, + * {@code LINE_START}, and {@code LINE_END}. + * In a container whose {@code ComponentOrientation} is set to + * {@code ComponentOrientation.LEFT_TO_RIGHT}, these constants map to + * {@code NORTH}, {@code SOUTH}, {@code WEST}, and + * {@code EAST}, respectively. *

          - * For compatibility with previous releases, BorderLayout - * also includes the relative positioning constants BEFORE_FIRST_LINE, - * AFTER_LAST_LINE, BEFORE_LINE_BEGINS and - * AFTER_LINE_ENDS. These are equivalent to - * PAGE_START, PAGE_END, LINE_START - * and LINE_END respectively. For + * For compatibility with previous releases, {@code BorderLayout} + * also includes the relative positioning constants {@code BEFORE_FIRST_LINE}, + * {@code AFTER_LAST_LINE}, {@code BEFORE_LINE_BEGINS} and + * {@code AFTER_LINE_ENDS}. These are equivalent to + * {@code PAGE_START}, {@code PAGE_END}, {@code LINE_START} + * and {@code LINE_END} respectively. For * consistency with the relative positioning constants used by other * components, the latter constants are preferred. *

          * Mixing both absolute and relative positioning constants can lead to * unpredictable results. If * you use both types, the relative constants will take precedence. - * For example, if you add components using both the NORTH - * and PAGE_START constants in a container whose - * orientation is LEFT_TO_RIGHT, only the - * PAGE_START will be laid out. + * For example, if you add components using both the {@code NORTH} + * and {@code PAGE_START} constants in a container whose + * orientation is {@code LEFT_TO_RIGHT}, only the + * {@code PAGE_START} will be laid out. *

          * NOTE: Currently (in the Java 2 platform v1.2), - * BorderLayout does not support vertical - * orientations. The isVertical setting on the container's - * ComponentOrientation is not respected. + * {@code BorderLayout} does not support vertical + * orientations. The {@code isVertical} setting on the container's + * {@code ComponentOrientation} is not respected. *

          * The components are laid out according to their * preferred sizes and the constraints of the container's size. - * The NORTH and SOUTH components may - * be stretched horizontally; the EAST and - * WEST components may be stretched vertically; - * the CENTER component may stretch both horizontally + * The {@code NORTH} and {@code SOUTH} components may + * be stretched horizontally; the {@code EAST} and + * {@code WEST} components may be stretched vertically; + * the {@code CENTER} component may stretch both horizontally * and vertically to fill any space left over. *

          * Here is an example of five buttons in an applet laid out using - * the BorderLayout layout manager: + * the {@code BorderLayout} layout manager: *

          * Diagram of an applet demonstrating BorderLayout.
@@ -126,7 +126,7 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Constructs a border layout with the horizontal gaps
      * between components.
-     * The horizontal gap is specified by <code>hgap</code>.
+     * The horizontal gap is specified by {@code hgap}.
      *
      * @see #getHgap()
      * @see #setHgap(int)
@@ -138,7 +138,7 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Constructs a border layout with the vertical gaps
      * between components.
-     * The vertical gap is specified by <code>vgap</code>.
+     * The vertical gap is specified by {@code vgap}.
      *
      * @see #getVgap()
      * @see #setVgap(int)
@@ -208,10 +208,10 @@ public class BorderLayout implements LayoutManager2,
      * north, south, east, west or center.
      * mixing the two types of constants can lead to unpredictable results.  If
      * you use both types, the relative constants will take precedence.
-     * For example, if you add components using both the <code>NORTH</code>
-     * and <code>BEFORE_FIRST_LINE</code> constants in a container whose
-     * orientation is <code>LEFT_TO_RIGHT</code>, only the
-     * <code>BEFORE_FIRST_LINE</code> will be laid out.
+     * For example, if you add components using both the {@code NORTH}
+     * and {@code BEFORE_FIRST_LINE} constants in a container whose
+     * orientation is {@code LEFT_TO_RIGHT}, only the
+     * {@code BEFORE_FIRST_LINE} will be laid out.
      * This will be the same for lastLine, firstItem, lastItem.
      * @serial
      */
@@ -355,8 +355,8 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Constructs a border layout with the specified gaps
      * between components.
-     * The horizontal gap is specified by <code>hgap</code>
-     * and the vertical gap is specified by <code>vgap</code>.
+     * The horizontal gap is specified by {@code hgap}
+     * and the vertical gap is specified by {@code vgap}.
      * @param   hgap   the horizontal gap.
      * @param   vgap   the vertical gap.
      */
@@ -408,13 +408,13 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Adds the specified component to the layout, using the specified
      * constraint object.  For border layouts, the constraint must be
-     * one of the following constants:  <code>NORTH</code>,
-     * <code>SOUTH</code>, <code>EAST</code>,
-     * <code>WEST</code>, or <code>CENTER</code>.
+     * one of the following constants:  {@code NORTH},
+     * {@code SOUTH}, {@code EAST},
+     * {@code WEST}, or {@code CENTER}.
      * <p>
      * Most applications do not call this method directly. This method
      * is called when a component is added to a container using the
-     * <code>Container.add</code> method with the same argument types.
+     * {@code Container.add} method with the same argument types.
      * @param   comp         the component to be added.
      * @param   constraints  an object that specifies how and where
      *                       the component is added to the layout.
@@ -434,7 +434,7 @@ public class BorderLayout implements LayoutManager2,
     }
 
     /**
-     * @deprecated  replaced by <code>addLayoutComponent(Component, Object)</code>.
+     * @deprecated  replaced by {@code addLayoutComponent(Component, Object)}.
      */
     @Deprecated
     public void addLayoutComponent(String name, Component comp) {
@@ -472,8 +472,8 @@ public class BorderLayout implements LayoutManager2,
 
     /**
      * Removes the specified component from this border layout. This
-     * method is called when a container calls its <code>remove</code> or
-     * <code>removeAll</code> methods. Most applications do not call this
+     * method is called when a container calls its {@code remove} or
+     * {@code removeAll} methods. Most applications do not call this
      * method directly.
      * @param   comp   the component to be removed.
      * @see     java.awt.Container#remove(java.awt.Component)
@@ -507,12 +507,12 @@ public class BorderLayout implements LayoutManager2,
     /**
      * Gets the component that was added using the given constraint
      *
-     * @param   constraints  the desired constraint, one of <code>CENTER</code>,
-     *                       <code>NORTH</code>, <code>SOUTH</code>,
-     *                       <code>WEST</code>, <code>EAST</code>,
-     *                       <code>PAGE_START</code>, <code>PAGE_END</code>,
-     *                       <code>LINE_START</code>, <code>LINE_END</code>
-     * @return  the component at the given location, or <code>null</code> if
+     * @param   constraints  the desired constraint, one of {@code CENTER},
+     *                       {@code NORTH}, {@code SOUTH},
+     *                       {@code WEST}, {@code EAST},
+     *                       {@code PAGE_START}, {@code PAGE_END},
+     *                       {@code LINE_START}, {@code LINE_END}
+     * @return  the component at the given location, or {@code null} if
      *          the location is empty
      * @exception   IllegalArgumentException  if the constraint object is
      *              not one of the nine specified constants
@@ -546,21 +546,21 @@ public class BorderLayout implements LayoutManager2,
 
     /**
      * Returns the component that corresponds to the given constraint location
-     * based on the target <code>Container</code>'s component orientation.
-     * Components added with the relative constraints <code>PAGE_START</code>,
-     * <code>PAGE_END</code>, <code>LINE_START</code>, and <code>LINE_END</code>
+     * based on the target {@code Container}'s component orientation.
+     * Components added with the relative constraints {@code PAGE_START},
+     * {@code PAGE_END}, {@code LINE_START}, and {@code LINE_END}
      * take precedence over components added with the explicit constraints
-     * <code>NORTH</code>, <code>SOUTH</code>, <code>WEST</code>, and <code>EAST</code>.
-     * The <code>Container</code>'s component orientation is used to determine the location of components
-     * added with <code>LINE_START</code> and <code>LINE_END</code>.
+     * {@code NORTH}, {@code SOUTH}, {@code WEST}, and {@code EAST}.
+     * The {@code Container}'s component orientation is used to determine the location of components
+     * added with {@code LINE_START} and {@code LINE_END}.
      *
-     * @param   constraints     the desired absolute position, one of <code>CENTER</code>,
-     *                          <code>NORTH</code>, <code>SOUTH</code>,
-     *                          <code>EAST</code>, <code>WEST</code>
+     * @param   constraints     the desired absolute position, one of {@code CENTER},
+     *                          {@code NORTH}, {@code SOUTH},
+     *                          {@code EAST}, {@code WEST}
      * @param   target     the {@code Container} used to obtain
      *                     the constraint location based on the target
      *                     {@code Container}'s component orientation.
-     * @return  the component at the given location, or <code>null</code> if
+     * @return  the component at the given location, or {@code null} if
      *          the location is empty
      * @exception   IllegalArgumentException  if the constraint object is
      *              not one of the five specified constants
@@ -634,11 +634,11 @@ public class BorderLayout implements LayoutManager2,
     }
 
     /**
-     * Determines the minimum size of the <code>target</code> container
+     * Determines the minimum size of the {@code target} container
      * using this layout manager.
      * <p>
      * This method is called when a container calls its
-     * <code>getMinimumSize</code> method. Most applications do not call
+     * {@code getMinimumSize} method. Most applications do not call
      * this method directly.
      * @param   target   the container in which to do the layout.
      * @return  the minimum dimensions needed to lay out the subcomponents
@@ -689,12 +689,12 @@ public class BorderLayout implements LayoutManager2,
     }
 
     /**
-     * Determines the preferred size of the <code>target</code>
+     * Determines the preferred size of the {@code target}
      * container using this layout manager, based on the components
      * in the container.
      * <p>
      * Most applications do not call this method directly. This method
-     * is called when a container calls its <code>getPreferredSize</code>
+     * is called when a container calls its {@code getPreferredSize}
      * method.
      * @param   target   the container in which to do the layout.
      * @return  the preferred dimensions to lay out the subcomponents
@@ -790,16 +790,16 @@ public class BorderLayout implements LayoutManager2,
      * <p>
      * This method actually reshapes the components in the specified
      * container in order to satisfy the constraints of this
-     * <code>BorderLayout</code> object. The <code>NORTH</code>
-     * and <code>SOUTH</code> components, if any, are placed at
+     * {@code BorderLayout} object. The {@code NORTH}
+     * and {@code SOUTH} components, if any, are placed at
      * the top and bottom of the container, respectively. The
-     * <code>WEST</code> and <code>EAST</code> components are
+     * {@code WEST} and {@code EAST} components are
      * then placed on the left and right, respectively. Finally,
-     * the <code>CENTER</code> object is placed in any remaining
+     * the {@code CENTER} object is placed in any remaining
      * space in the middle.
      * <p>
      * Most applications do not call this method directly. This method
-     * is called when a container calls its <code>doLayout</code> method.
+     * is called when a container calls its {@code doLayout} method.
      * @param   target   the container in which to do the layout.
      * @see     java.awt.Container
      * @see     java.awt.Container#doLayout()
diff --git a/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java b/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java
index 2da7ac335bc..1b3b5576d83 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/BufferCapabilities.java
@@ -42,13 +42,13 @@ public class BufferCapabilities implements Cloneable {
     /**
      * Creates a new object for specifying buffering capabilities
      * @param frontCaps the capabilities of the front buffer; cannot be
-     * <code>null</code>
+     * {@code null}
      * @param backCaps the capabilities of the back and intermediate buffers;
-     * cannot be <code>null</code>
+     * cannot be {@code null}
      * @param flipContents the contents of the back buffer after page-flipping,
-     * <code>null</code> if page flipping is not used (implies blitting)
+     * {@code null} if page flipping is not used (implies blitting)
      * @exception IllegalArgumentException if frontCaps or backCaps are
-     * <code>null</code>
+     * {@code null}
      */
     public BufferCapabilities(ImageCapabilities frontCaps,
         ImageCapabilities backCaps, FlipContents flipContents) {
@@ -83,8 +83,8 @@ public class BufferCapabilities implements Cloneable {
      * more back buffers by switching the video pointer (or by copying memory
      * internally).  A non-flipping set of
      * buffers uses blitting to copy the contents from one buffer to
-     * another; when this is the case, <code>getFlipContents</code> returns
-     * <code>null</code>
+     * another; when this is the case, {@code getFlipContents} returns
+     * {@code null}
      */
     public boolean isPageFlipping() {
         return (getFlipContents() != null);
@@ -92,12 +92,12 @@ public class BufferCapabilities implements Cloneable {
 
     /**
      * @return the resulting contents of the back buffer after page-flipping.
-     * This value is <code>null</code> when the <code>isPageFlipping</code>
-     * returns <code>false</code>, implying blitting.  It can be one of
-     * <code>FlipContents.UNDEFINED</code>
-     * (the assumed default), <code>FlipContents.BACKGROUND</code>,
-     * <code>FlipContents.PRIOR</code>, or
-     * <code>FlipContents.COPIED</code>.
+     * This value is {@code null} when the {@code isPageFlipping}
+     * returns {@code false}, implying blitting.  It can be one of
+     * {@code FlipContents.UNDEFINED}
+     * (the assumed default), {@code FlipContents.BACKGROUND},
+     * {@code FlipContents.PRIOR}, or
+     * {@code FlipContents.COPIED}.
      * @see #isPageFlipping
      * @see FlipContents#UNDEFINED
      * @see FlipContents#BACKGROUND
@@ -110,7 +110,7 @@ public class BufferCapabilities implements Cloneable {
 
     /**
      * @return whether page flipping is only available in full-screen mode.  If this
-     * is <code>true</code>, full-screen exclusive mode is required for
+     * is {@code true}, full-screen exclusive mode is required for
      * page-flipping.
      * @see #isPageFlipping
      * @see GraphicsDevice#setFullScreenWindow
@@ -158,7 +158,7 @@ public class BufferCapabilities implements Cloneable {
             { UNDEFINED, the + * When flip contents are {@code UNDEFINED}, the * contents of the back buffer are undefined after flipping. * @see #isPageFlipping * @see #getFlipContents @@ -170,7 +170,7 @@ public class BufferCapabilities implements Cloneable { new FlipContents(I_UNDEFINED); /** - * When flip contents are BACKGROUND, the + * When flip contents are {@code BACKGROUND}, the * contents of the back buffer are cleared with the background color after * flipping. * @see #isPageFlipping @@ -183,7 +183,7 @@ public class BufferCapabilities implements Cloneable { new FlipContents(I_BACKGROUND); /** - * When flip contents are PRIOR, the + * When flip contents are {@code PRIOR}, the * contents of the back buffer are the prior contents of the front buffer * (a true page flip). * @see #isPageFlipping @@ -196,7 +196,7 @@ public class BufferCapabilities implements Cloneable { new FlipContents(I_PRIOR); /** - * When flip contents are COPIED, the + * When flip contents are {@code COPIED}, the * contents of the back buffer are copied to the front buffer when * flipping. * @see #isPageFlipping diff --git a/jdk/src/java.desktop/share/classes/java/awt/Button.java b/jdk/src/java.desktop/share/classes/java/awt/Button.java index faa8068cf8c..66cbc8cbbe9 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Button.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Button.java @@ -37,7 +37,7 @@ import javax.accessibility.*; /** * This class creates a labeled button. The application can cause * some action to happen when the button is pushed. This image - * depicts three views of a "Quit" button as it appears + * depicts three views of a "{@code Quit}" button as it appears * under the Solaris operating system: *

          * The following context describes the graphic * The gesture of clicking on a button with the mouse - * is associated with one instance of ActionEvent, + * is associated with one instance of {@code ActionEvent}, * which is sent out when the mouse is both pressed and released * over the button. If an application is interested in knowing * when the button has been pressed but not released, as a separate - * gesture, it can specialize processMouseEvent, + * gesture, it can specialize {@code processMouseEvent}, * or it can register itself as a listener for mouse events by - * calling addMouseListener. Both of these methods are - * defined by Component, the abstract superclass of + * calling {@code addMouseListener}. Both of these methods are + * defined by {@code Component}, the abstract superclass of * all components. *

          * When a button is pressed and released, AWT sends an instance - * of ActionEvent to the button, by calling - * processEvent on the button. The button's - * processEvent method receives all events + * of {@code ActionEvent} to the button, by calling + * {@code processEvent} on the button. The button's + * {@code processEvent} method receives all events * for the button; it passes an action event along by - * calling its own processActionEvent method. + * calling its own {@code processActionEvent} method. * The latter method passes the action event on to any action * listeners that have registered an interest in action * events generated by this button. *

          * If an application wants to perform some action based on * a button being pressed and released, it should implement - * ActionListener and register the new listener + * {@code ActionListener} and register the new listener * to receive events from this button, by calling the button's - * addActionListener method. The application can + * {@code addActionListener} method. The application can * make use of the button's action command as a messaging protocol. * * @author Sami Shaio @@ -144,7 +144,7 @@ public class Button extends Component implements Accessible { * Constructs a button with the specified label. * * @param label a string label for the button, or - * null for no label + * {@code null} for no label * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -182,7 +182,7 @@ public class Button extends Component implements Accessible { /** * Gets the label of this button. * - * @return the button's label, or null + * @return the button's label, or {@code null} * if the button has no label. * @see java.awt.Button#setLabel */ @@ -193,7 +193,7 @@ public class Button extends Component implements Accessible { /** * Sets the button's label to be the specified string. * - * @param label the new label, or null + * @param label the new label, or {@code null} * if the button has no label. * @see java.awt.Button#getLabel */ @@ -225,7 +225,7 @@ public class Button extends Component implements Accessible { * * @param command a string used to set the button's * action command. - * If the string is null then the action command + * If the string is {@code null} then the action command * is set to match the label of the button. * @see java.awt.event.ActionEvent * @since 1.1 @@ -236,7 +236,7 @@ public class Button extends Component implements Accessible { /** * Returns the command name of the action event fired by this button. - * If the command name is null (default) then this method + * If the command name is {@code null} (default) then this method * returns the label of the button. * * @return the action command name (or label) for this button @@ -292,7 +292,7 @@ public class Button extends Component implements Accessible { * Returns an array of all the action listeners * registered on this button. * - * @return all of this button's ActionListeners + * @return all of this button's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -308,16 +308,16 @@ public class Button extends Component implements Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Button. + * upon this {@code Button}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Button b + * {@code Button b} * for its action listeners with the following code: * *

          ActionListener[] als = (ActionListener[])(b.getListeners(ActionListener.class));
          @@ -326,14 +326,14 @@ public class Button extends Component implements Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this button, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getActionListeners * @since 1.3 @@ -362,10 +362,10 @@ public class Button extends Component implements Accessible { /** * Processes events on this button. If an event is - * an instance of ActionEvent, this method invokes - * the processActionEvent method. Otherwise, - * it invokes processEvent on the superclass. - *

          Note that if the event parameter is null + * an instance of {@code ActionEvent}, this method invokes + * the {@code processActionEvent} method. Otherwise, + * it invokes {@code processEvent} on the superclass. + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -385,17 +385,17 @@ public class Button extends Component implements Accessible { /** * Processes action events occurring on this button * by dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. *

          * This method is not called unless action events are * enabled for this button. Action events are enabled * when one of the following occurs: *

            - *
          • An ActionListener object is registered - * via addActionListener. - *
          • Action events are enabled via enableEvents. + *
          • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
          • Action events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -413,11 +413,11 @@ public class Button extends Component implements Accessible { } /** - * Returns a string representing the state of this Button. + * Returns a string representing the state of this {@code Button}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this button */ @@ -437,19 +437,19 @@ public class Button extends Component implements Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ActionListeners + * a list of serializable {@code ActionListeners} * as optional data. The non-serializable - * ActionListeners are detected and + * {@code ActionListeners} are detected and * no attempt is made to serialize them. * - * @serialData null terminated sequence of 0 or - * more pairs: the pair consists of a String - * and an Object; the String + * @serialData {@code null} terminated sequence of 0 or + * more pairs: the pair consists of a {@code String} + * and an {@code Object}; the {@code String} * indicates the type of object and is one of the following: - * actionListenerK indicating an - * ActionListener object + * {@code actionListenerK} indicating an + * {@code ActionListener} object * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#actionListenerK * @see #readObject(ObjectInputStream) @@ -464,15 +464,15 @@ public class Button extends Component implements Accessible { } /** - * Reads the ObjectInputStream and if - * it isn't null adds a listener to + * Reads the {@code ObjectInputStream} and if + * it isn't {@code null} adds a listener to * receive action events fired by the button. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see #removeActionListener(ActionListener) * @see #addActionListener(ActionListener) @@ -503,15 +503,15 @@ public class Button extends Component implements Accessible { //////////////// /** - * Gets the AccessibleContext associated with - * this Button. For buttons, the - * AccessibleContext takes the form of an - * AccessibleAWTButton. - * A new AccessibleAWTButton instance is + * Gets the {@code AccessibleContext} associated with + * this {@code Button}. For buttons, the + * {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTButton}. + * A new {@code AccessibleAWTButton} instance is * created if necessary. * - * @return an AccessibleAWTButton that serves as the - * AccessibleContext of this Button + * @return an {@code AccessibleAWTButton} that serves as the + * {@code AccessibleContext} of this {@code Button} * @since 1.3 */ @BeanProperty(expert = true, description @@ -525,7 +525,7 @@ public class Button extends Component implements Accessible { /** * This class implements accessibility support for the - * Button class. It provides an implementation of the + * {@code Button} class. It provides an implementation of the * Java Accessibility API appropriate to button user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Canvas.java b/jdk/src/java.desktop/share/classes/java/awt/Canvas.java index 166d664a31b..9d1762f0674 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Canvas.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Canvas.java @@ -29,13 +29,13 @@ import java.awt.peer.CanvasPeer; import javax.accessibility.*; /** - * A Canvas component represents a blank rectangular + * A {@code Canvas} component represents a blank rectangular * area of the screen onto which the application can draw or from * which the application can trap input events from the user. *

          - * An application must subclass the Canvas class in + * An application must subclass the {@code Canvas} class in * order to get useful functionality such as creating a custom - * component. The paint method must be overridden + * component. The {@code paint} method must be overridden * in order to perform custom graphics on the canvas. * * @author Sami Shaio @@ -108,7 +108,7 @@ public class Canvas extends Component implements Accessible { /** * Paints this canvas. *

          - * Most applications that subclass Canvas should + * Most applications that subclass {@code Canvas} should * override this method in order to perform some useful operation * (typically, custom painting of the canvas). * The default operation is simply to clear the canvas. @@ -126,10 +126,10 @@ public class Canvas extends Component implements Accessible { /** * Updates this canvas. *

          - * This method is called in response to a call to repaint. + * This method is called in response to a call to {@code repaint}. * The canvas is first cleared by filling it with the background * color, and then completely redrawn by calling this canvas's - * paint method. + * {@code paint} method. * Note: applications that override this method should either call * super.update(g) or incorporate the functionality described * above into their own code. @@ -151,7 +151,7 @@ public class Canvas extends Component implements Accessible { * Creates a new strategy for multi-buffering on this component. * Multi-buffering is useful for rendering performance. This method * attempts to create the best strategy available with the number of - * buffers supplied. It will always create a BufferStrategy + * buffers supplied. It will always create a {@code BufferStrategy} * with that number of buffers. * A page-flipping strategy is attempted first, then a blitting strategy * using accelerated buffers. Finally, an unaccelerated blitting @@ -180,13 +180,13 @@ public class Canvas extends Component implements Accessible { * is called, the existing buffer strategy for this component is discarded. * @param numBuffers number of buffers to create * @param caps the required capabilities for creating the buffer strategy; - * cannot be null + * cannot be {@code null} * @exception AWTException if the capabilities supplied could not be * supported or met; this may happen, for example, if there is not enough * accelerated memory currently available, or if page flipping is specified * but not possible. * @exception IllegalArgumentException if numBuffers is less than 1, or if - * caps is null + * caps is {@code null} * @see #getBufferStrategy * @since 1.4 */ @@ -196,8 +196,8 @@ public class Canvas extends Component implements Accessible { } /** - * Returns the BufferStrategy used by this component. This - * method will return null if a BufferStrategy has not yet + * Returns the {@code BufferStrategy} used by this component. This + * method will return null if a {@code BufferStrategy} has not yet * been created or has been disposed. * * @return the buffer strategy used by this component @@ -232,7 +232,7 @@ public class Canvas extends Component implements Accessible { /** * This class implements accessibility support for the - * Canvas class. It provides an implementation of the + * {@code Canvas} class. It provides an implementation of the * Java Accessibility API appropriate to canvas user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java b/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java index 9f14d622a15..e7523e1921e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/CardLayout.java @@ -36,15 +36,15 @@ import java.io.ObjectStreamField; import java.io.IOException; /** - * A CardLayout object is a layout manager for a + * A {@code CardLayout} object is a layout manager for a * container. It treats each component in the container as a card. * Only one card is visible at a time, and the container acts as * a stack of cards. The first component added to a - * CardLayout object is the visible component when the + * {@code CardLayout} object is the visible component when the * container is first displayed. *

          * The ordering of cards is determined by the container's own internal - * ordering of its component objects. CardLayout + * ordering of its component objects. {@code CardLayout} * defines a set of methods that allow an application to flip * through these cards sequentially, or to show a specified card. * The {@link CardLayout#addLayoutComponent} @@ -188,10 +188,10 @@ public class CardLayout implements LayoutManager2, /** * Adds the specified component to this card layout's internal - * table of names. The object specified by constraints + * table of names. The object specified by {@code constraints} * must be a string. The card layout stores this string as a key-value * pair that can be used for random access to a particular card. - * By calling the show method, an application can + * By calling the {@code show} method, an application can * display the component with the specified name. * @param comp the component to be added. * @param constraints a tag that identifies a particular @@ -214,7 +214,7 @@ public class CardLayout implements LayoutManager2, /** * @deprecated replaced by - * addLayoutComponent(Component, Object). + * {@code addLayoutComponent(Component, Object)}. */ @Deprecated public void addLayoutComponent(String name, Component comp) { @@ -365,7 +365,7 @@ public class CardLayout implements LayoutManager2, /** * Lays out the specified container using this card layout. *

          - * Each component in the parent container is reshaped + * Each component in the {@code parent} container is reshaped * to be the size of the container, minus space for surrounding * insets, horizontal gaps, and vertical gaps. * @@ -515,7 +515,7 @@ public class CardLayout implements LayoutManager2, /** * Flips to the component that was added to this layout with the - * specified name, using addLayoutComponent. + * specified {@code name}, using {@code addLayoutComponent}. * If no such component exists, then nothing happens. * @param parent the parent container in which to do the layout * @param name the component name diff --git a/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java b/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java index 4604b6262a6..bf7f9406158 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Checkbox.java @@ -35,7 +35,7 @@ import javax.accessibility.*; /** * A check box is a graphical component that can be in either an - * "on" (true) or "off" (false) state. + * "on" ({@code true}) or "off" ({@code false}) state. * Clicking on a check box changes its state from * "on" to "off," or from "off" to "on." *

          @@ -55,14 +55,14 @@ import javax.accessibility.*; * The following context describes the graphic. *

          - * The button labeled one is in the "on" state, and the + * The button labeled {@code one} is in the "on" state, and the * other two are in the "off" state. In this example, which uses the - * GridLayout class, the states of the three check + * {@code GridLayout} class, the states of the three check * boxes are set independently. *

          * Alternatively, several check boxes can be grouped together under * the control of a single object, using the - * CheckboxGroup class. + * {@code CheckboxGroup} class. * In a check box group, at most one button can be in the "on" * state at any given time. Clicking on a check box to turn it on * forces any other check box in the same group that is on @@ -93,7 +93,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { String label; /** - * The state of the Checkbox. + * The state of the {@code Checkbox}. * @serial * @see #getState() * @see #setState(boolean) @@ -150,10 +150,10 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * any check box group. * * @param label a string label for this check box, - * or null for no label. + * or {@code null} for no label. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ public Checkbox(String label) throws HeadlessException { @@ -166,11 +166,11 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * This check box is not part of any check box group. * * @param label a string label for this check box, - * or null for no label + * or {@code null} for no label * @param state the initial state of this check box * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ public Checkbox(String label, boolean state) throws HeadlessException { @@ -182,13 +182,13 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * specified state, and in the specified check box group. * * @param label a string label for this check box, - * or null for no label. + * or {@code null} for no label. * @param state the initial state of this check box. * @param group a check box group for this check box, - * or null for no group. + * or {@code null} for no group. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.1 */ @@ -208,13 +208,13 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * check box group, and set to the specified state. * * @param label a string label for this check box, - * or null for no label. + * or {@code null} for no label. * @param group a check box group for this check box, - * or null for no group. + * or {@code null} for no group. * @param state the initial state of this check box. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.1 */ @@ -225,7 +225,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Constructs a name for this component. Called by - * getName when the name is null. + * {@code getName} when the name is {@code null}. * * @return a name for this component */ @@ -252,7 +252,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Gets the label of this check box. * - * @return the label of this check box, or null + * @return the label of this check box, or {@code null} * if this check box has no label. * @see #setLabel(String) */ @@ -264,7 +264,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * Sets this check box's label to be the string argument. * * @param label a string to set as the new label, or - * null for no label. + * {@code null} for no label. * @see #getLabel */ public void setLabel(String label) { @@ -290,8 +290,8 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Determines whether this check box is in the "on" or "off" state. - * The boolean value true indicates the "on" state, - * and false indicates the "off" state. + * The boolean value {@code true} indicates the "on" state, + * and {@code false} indicates the "off" state. * * @return the state of this check box, as a boolean value * @see #setState @@ -302,14 +302,14 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Sets the state of this check box to the specified state. - * The boolean value true indicates the "on" state, - * and false indicates the "off" state. + * The boolean value {@code true} indicates the "on" state, + * and {@code false} indicates the "off" state. * *

          Note that this method should be primarily used to * initialize the state of the checkbox. Programmatically * setting the state of the checkbox will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param state the boolean state of the check box * @see #getState @@ -343,7 +343,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Determines this check box's group. - * @return this check box's group, or null + * @return this check box's group, or {@code null} * if the check box is not part of a check box group. * @see #setCheckboxGroup(CheckboxGroup) */ @@ -356,14 +356,14 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * If this check box is already in a different check box group, * it is first taken out of that group. *

          - * If the state of this check box is true and the new + * If the state of this check box is {@code true} and the new * group already has a check box selected, this check box's state - * is changed to false. If the state of this check - * box is true and the new group has no check box + * is changed to {@code false}. If the state of this check + * box is {@code true} and the new group has no check box * selected, this check box becomes the selected checkbox for - * the new group and its state is true. + * the new group and its state is {@code true}. * - * @param g the new check box group, or null + * @param g the new check box group, or {@code null} * to remove this check box from any check box group * @see #getCheckboxGroup */ @@ -458,7 +458,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * Returns an array of all the item listeners * registered on this checkbox. * - * @return all of this checkbox's ItemListeners + * @return all of this checkbox's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -475,16 +475,16 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Checkbox. + * upon this {@code Checkbox}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Checkbox c + * {@code Checkbox c} * for its item listeners with the following code: * *

          ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
          @@ -493,14 +493,14 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this checkbox, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -529,10 +529,10 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Processes events on this check box. - * If the event is an instance of ItemEvent, - * this method invokes the processItemEvent method. - * Otherwise, it calls its superclass's processEvent method. - *

          Note that if the event parameter is null + * If the event is an instance of {@code ItemEvent}, + * this method invokes the {@code processItemEvent} method. + * Otherwise, it calls its superclass's {@code processEvent} method. + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -552,17 +552,17 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Processes item events occurring on this check box by * dispatching them to any registered - * ItemListener objects. + * {@code ItemListener} objects. *

          * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: *

            - *
          • An ItemListener object is registered - * via addItemListener. - *
          • Item events are enabled via enableEvents. + *
          • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
          • Item events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -581,11 +581,11 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { } /** - * Returns a string representing the state of this Checkbox. + * Returns a string representing the state of this {@code Checkbox}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this check box */ @@ -610,18 +610,18 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners + * a list of serializable {@code ItemListeners} * as optional data. The non-serializable - * ItemListeners are detected and + * {@code ItemListeners} are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * itemListenerK indicating an - * ItemListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK @@ -637,15 +637,15 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * item events fired by the Checkbox. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * item events fired by the {@code Checkbox}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see #removeItemListener(ItemListener) * @see #addItemListener(ItemListener) @@ -700,7 +700,7 @@ public class Checkbox extends Component implements ItemSelectable, Accessible { /** * This class implements accessibility support for the - * Checkbox class. It provides an implementation of the + * {@code Checkbox} class. It provides an implementation of the * Java Accessibility API appropriate to checkbox user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java index aba3f37798e..470ad9a17d0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java +++ b/jdk/src/java.desktop/share/classes/java/awt/CheckboxMenuItem.java @@ -40,20 +40,20 @@ import sun.awt.AWTAccessor; * "on" to "off" or from "off" to "on." *

          * The following picture depicts a menu which contains an instance - * of CheckBoxMenuItem: + * of {@code CheckBoxMenuItem}: *

          * Menu labeled Examples, containing items Basic, Simple, Check, and More Examples. The Check item is a CheckBoxMenuItem instance, in the off state. *

          - * The item labeled Check shows a check box menu item + * The item labeled {@code Check} shows a check box menu item * in its "off" state. *

          * When a check box menu item is selected, AWT sends an item event to - * the item. Since the event is an instance of ItemEvent, - * the processEvent method examines the event and passes - * it along to processItemEvent. The latter method redirects - * the event to any ItemListener objects that have + * the item. Since the event is an instance of {@code ItemEvent}, + * the {@code processEvent} method examines the event and passes + * it along to {@code processItemEvent}. The latter method redirects + * the event to any {@code ItemListener} objects that have * registered an interest in item events generated by this menu item. * * @author Sami Shaio @@ -113,7 +113,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * The item's state is initially set to "off." * @param label a string label for the check box menu item, - * or null for an unlabeled menu item. + * or {@code null} for an unlabeled menu item. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -125,10 +125,10 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Create a check box menu item with the specified label and state. * @param label a string label for the check box menu item, - * or null for an unlabeled menu item. + * or {@code null} for an unlabeled menu item. * @param state the initial state of the menu item, where - * true indicates "on" and - * false indicates "off." + * {@code true} indicates "on" and + * {@code false} indicates "off." * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -170,8 +170,8 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * is "on" or "off." * * @return the state of this check box menu item, where - * true indicates "on" and - * false indicates "off" + * {@code true} indicates "on" and + * {@code false} indicates "off" * @see #setState */ public boolean getState() { @@ -180,18 +180,18 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Sets this check box menu item to the specified state. - * The boolean value true indicates "on" while - * false indicates "off." + * The boolean value {@code true} indicates "on" while + * {@code false} indicates "off." * *

          Note that this method should be primarily used to * initialize the state of the check box menu item. * Programmatically setting the state of the check box * menu item will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * - * @param b true if the check box - * menu item is on, otherwise false + * @param b {@code true} if the check box + * menu item is on, otherwise {@code false} * @see #getState */ public synchronized void setState(boolean b) { @@ -265,7 +265,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * Returns an array of all the item listeners * registered on this checkbox menuitem. * - * @return all of this checkbox menuitem's ItemListeners + * @return all of this checkbox menuitem's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -282,16 +282,16 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Returns an array of all the objects currently registered * as FooListeners - * upon this CheckboxMenuItem. + * upon this {@code CheckboxMenuItem}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * CheckboxMenuItem c + * {@code CheckboxMenuItem c} * for its item listeners with the following code: * *

          ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
          @@ -300,14 +300,14 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this checkbox menuitem, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -336,13 +336,13 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Processes events on this check box menu item. - * If the event is an instance of ItemEvent, - * this method invokes the processItemEvent method. + * If the event is an instance of {@code ItemEvent}, + * this method invokes the {@code processItemEvent} method. * If the event is not an item event, - * it invokes processEvent on the superclass. + * it invokes {@code processEvent} on the superclass. *

          * Check box menu items currently support only item events. - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -361,17 +361,17 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Processes item events occurring on this check box menu item by - * dispatching them to any registered ItemListener objects. + * dispatching them to any registered {@code ItemListener} objects. *

          * This method is not called unless item events are * enabled for this menu item. Item events are enabled * when one of the following occurs: *

            - *
          • An ItemListener object is registered - * via addItemListener. - *
          • Item events are enabled via enableEvents. + *
          • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
          • Item events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -403,11 +403,11 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Returns a string representing the state of this - * CheckBoxMenuItem. This + * {@code CheckBoxMenuItem}. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this check box menu item */ @@ -426,18 +426,18 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners + * a list of serializable {@code ItemListeners} * as optional data. The non-serializable - * ItemListeners are detected and + * {@code ItemListeners} are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of - * 0 or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of + * 0 or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * itemListenerK indicating an - * ItemListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK @@ -453,12 +453,12 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access } /* - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * item events fired by the Checkbox menu item. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * item events fired by the {@code Checkbox} menu item. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @serial * @see removeActionListener() * @see addActionListener() @@ -515,7 +515,7 @@ public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Access * subclassed by menu component developers. *

          * This class implements accessibility support for the - * CheckboxMenuItem class. It provides an implementation + * {@code CheckboxMenuItem} class. It provides an implementation * of the Java Accessibility API appropriate to checkbox menu item * user-interface elements. * @since 1.3 diff --git a/jdk/src/java.desktop/share/classes/java/awt/Choice.java b/jdk/src/java.desktop/share/classes/java/awt/Choice.java index d638e45a7a7..e12beb142c2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Choice.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Choice.java @@ -36,7 +36,7 @@ import javax.accessibility.*; /** - * The Choice class presents a pop-up menu of choices. + * The {@code Choice} class presents a pop-up menu of choices. * The current choice is displayed as the title of the menu. *

          * The following code example produces a pop-up menu: @@ -54,17 +54,17 @@ import javax.accessibility.*; * The following text describes the graphic *

          - * In the picture, "Green" is the current choice. + * In the picture, {@code "Green"} is the current choice. * Pushing the mouse button down on the object causes a menu to * appear with the current choice highlighted. *

          * Some native platforms do not support arbitrary resizing of - * Choice components and the behavior of - * setSize()/getSize() is bound by + * {@code Choice} components and the behavior of + * {@code setSize()/getSize()} is bound by * such limitations. - * Native GUI Choice components' size are often bound by such + * Native GUI {@code Choice} components' size are often bound by such * attributes as font size and length of items contained within - * the Choice. + * the {@code Choice}. * * @author Sami Shaio * @author Arthur van Hoff @@ -72,8 +72,8 @@ import javax.accessibility.*; */ public class Choice extends Component implements ItemSelectable, Accessible { /** - * The items for the Choice. - * This can be a null value. + * The items for the {@code Choice}. + * This can be a {@code null} value. * @serial * @see #add(String) * @see #addItem(String) @@ -85,7 +85,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { Vector pItems; /** - * The index of the current choice for this Choice + * The index of the current choice for this {@code Choice} * or -1 if nothing is selected. * @serial * @see #getSelectedItem() @@ -117,7 +117,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { *

          * By default, the first item added to the choice menu becomes the * selected item, until a different selection is made by the user - * by calling one of the select methods. + * by calling one of the {@code select} methods. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -131,7 +131,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Constructs a name for this component. Called by - * getName when the name is null. + * {@code getName} when the name is {@code null}. */ String constructComponentName() { synchronized (Choice.class) { @@ -140,9 +140,9 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Creates the Choice's peer. This peer allows us + * Creates the {@code Choice}'s peer. This peer allows us * to change the look - * of the Choice without changing its functionality. + * of the {@code Choice} without changing its functionality. * @see java.awt.Component#getToolkit() */ public void addNotify() { @@ -154,9 +154,9 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Returns the number of items in this Choice menu. + * Returns the number of items in this {@code Choice} menu. * - * @return the number of items in this Choice menu + * @return the number of items in this {@code Choice} menu * @see #getItem * @since 1.1 */ @@ -169,7 +169,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * * @return the number of items in this {@code Choice} menu * @deprecated As of JDK version 1.1, - * replaced by getItemCount(). + * replaced by {@code getItemCount()}. */ @Deprecated public int countItems() { @@ -178,7 +178,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Gets the string at the specified index in this - * Choice menu. + * {@code Choice} menu. * * @param index the index at which to begin * @return the item at the specified index @@ -197,10 +197,10 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Adds an item to this Choice menu. + * Adds an item to this {@code Choice} menu. * @param item the item to be added * @exception NullPointerException if the item's value is - * null + * {@code null} * @since 1.1 */ public void add(String item) { @@ -209,12 +209,12 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Obsolete as of Java 2 platform v1.1. Please use the - * add method instead. + * {@code add} method instead. *

          - * Adds an item to this Choice menu. + * Adds an item to this {@code Choice} menu. * @param item the item to be added * @exception NullPointerException if the item's value is equal to - * null + * {@code null} */ public void addItem(String item) { synchronized (this) { @@ -226,14 +226,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Inserts an item to this Choice, - * but does not invalidate the Choice. + * Inserts an item to this {@code Choice}, + * but does not invalidate the {@code Choice}. * Client methods must provide their own synchronization before * invoking this method. * @param item the item to be added * @param index the new item position * @exception NullPointerException if the item's value is equal to - * null + * {@code null} */ private void insertNoInvalidate(String item, int index) { if (item == null) { @@ -255,10 +255,10 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Inserts the item into this choice at the specified position. * Existing items at an index greater than or equal to - * index are shifted up by one to accommodate - * the new item. If index is greater than or + * {@code index} are shifted up by one to accommodate + * the new item. If {@code index} is greater than or * equal to the number of items in this choice, - * item is added to the end of this choice. + * {@code item} is added to the end of this choice. *

          * If the item is the first one being added to the choice, * then the item becomes selected. Otherwise, if the @@ -266,7 +266,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * item in the choice becomes the selected item. If the * selected item was no among those shifted, it remains * the selected item. - * @param item the non-null item to be inserted + * @param item the non-{@code null} item to be inserted * @param index the position at which the item should be inserted * @exception IllegalArgumentException if index is less than 0 */ @@ -286,14 +286,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Removes the first occurrence of item - * from the Choice menu. If the item + * Removes the first occurrence of {@code item} + * from the {@code Choice} menu. If the item * being removed is the currently selected item, * then the first item in the choice becomes the * selected item. Otherwise, the currently selected * item remains selected (and the selected index is * updated accordingly). - * @param item the item to remove from this Choice menu + * @param item the item to remove from this {@code Choice} menu * @exception IllegalArgumentException if the item doesn't * exist in the choice menu * @since 1.1 @@ -336,8 +336,8 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Removes an item from the Choice at the - * specified position, but does not invalidate the Choice. + * Removes an item from the {@code Choice} at the + * specified position, but does not invalidate the {@code Choice}. * Client methods must provide their * own synchronization before invoking this method. * @param position the position of the item @@ -389,7 +389,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Returns an array (length 1) containing the currently selected - * item. If this choice has no items, returns null. + * item. If this choice has no items, returns {@code null}. * @see ItemSelectable */ public synchronized Object[] getSelectedObjects() { @@ -414,14 +414,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Sets the selected item in this Choice menu to be the + * Sets the selected item in this {@code Choice} menu to be the * item at the specified position. * *

          Note that this method should be primarily used to * initially select an item in this component. * Programmatically calling this method will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param pos the position of the selected item * @exception IllegalArgumentException if the specified @@ -444,7 +444,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Sets the selected item in this Choice menu + * Sets the selected item in this {@code Choice} menu * to be the item whose name is equal to the specified string. * If more than one item matches (is equal to) the specified string, * the one with the smallest index is selected. @@ -452,8 +452,8 @@ public class Choice extends Component implements ItemSelectable, Accessible { *

          Note that this method should be primarily used to * initially select an item in this component. * Programmatically calling this method will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param str the specified string * @see #getSelectedItem @@ -468,9 +468,9 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Adds the specified item listener to receive item events from - * this Choice menu. Item events are sent in response - * to user input, but not in response to calls to select. - * If l is null, no exception is thrown and no action + * this {@code Choice} menu. Item events are sent in response + * to user input, but not in response to calls to {@code select}. + * If l is {@code null}, no exception is thrown and no action * is performed. *

          Refer to AWT Threading Issues for details on AWT's threading model. @@ -492,8 +492,8 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Removes the specified item listener so that it no longer receives - * item events from this Choice menu. - * If l is null, no exception is thrown and no + * item events from this {@code Choice} menu. + * If l is {@code null}, no exception is thrown and no * action is performed. *

          Refer to AWT Threading Issues for details on AWT's threading model. @@ -515,7 +515,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { * Returns an array of all the item listeners * registered on this choice. * - * @return all of this choice's ItemListeners + * @return all of this choice's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -532,16 +532,16 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Choice. + * upon this {@code Choice}. * FooListeners are registered using the * addFooListener method. * *

          - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Choice c + * {@code Choice c} * for its item listeners with the following code: * *

          ItemListener[] ils = (ItemListener[])(c.getListeners(ItemListener.class));
          @@ -550,14 +550,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this choice, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -586,10 +586,10 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Processes events on this choice. If the event is an - * instance of ItemEvent, it invokes the - * processItemEvent method. Otherwise, it calls its - * superclass's processEvent method. - *

          Note that if the event parameter is null + * instance of {@code ItemEvent}, it invokes the + * {@code processItemEvent} method. Otherwise, it calls its + * superclass's {@code processEvent} method. + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -607,19 +607,19 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Processes item events occurring on this Choice + * Processes item events occurring on this {@code Choice} * menu by dispatching them to any registered - * ItemListener objects. + * {@code ItemListener} objects. *

          * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: *

            - *
          • An ItemListener object is registered - * via addItemListener. - *
          • Item events are enabled via enableEvents. + *
          • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
          • Item events are enabled via {@code enableEvents}. *
          - *

          Note that if the event parameter is null + *

          Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -638,13 +638,13 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Returns a string representing the state of this Choice + * Returns a string representing the state of this {@code Choice} * menu. This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * - * @return the parameter string of this Choice menu + * @return the parameter string of this {@code Choice} menu */ protected String paramString() { return super.paramString() + ",current=" + getSelectedItem(); @@ -662,18 +662,18 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners + * a list of serializable {@code ItemListeners} * as optional data. The non-serializable - * ItemListeners are detected and + * {@code ItemListeners} are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * itemListenerK indicating an - * ItemListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK @@ -689,15 +689,15 @@ public class Choice extends Component implements ItemSelectable, Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * item events fired by the Choice item. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * item events fired by the {@code Choice} item. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see #removeItemListener(ItemListener) * @see #addItemListener(ItemListener) @@ -733,14 +733,14 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** - * Gets the AccessibleContext associated with this - * Choice. For Choice components, - * the AccessibleContext takes the form of an - * AccessibleAWTChoice. A new AccessibleAWTChoice + * Gets the {@code AccessibleContext} associated with this + * {@code Choice}. For {@code Choice} components, + * the {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTChoice}. A new {@code AccessibleAWTChoice} * instance is created if necessary. * - * @return an AccessibleAWTChoice that serves as the - * AccessibleContext of this Choice + * @return an {@code AccessibleAWTChoice} that serves as the + * {@code AccessibleContext} of this {@code Choice} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -752,7 +752,7 @@ public class Choice extends Component implements ItemSelectable, Accessible { /** * This class implements accessibility support for the - * Choice class. It provides an implementation of the + * {@code Choice} class. It provides an implementation of the * Java Accessibility API appropriate to choice user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Color.java b/jdk/src/java.desktop/share/classes/java/awt/Color.java index da62fc631da..559a429ef22 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Color.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Color.java @@ -32,7 +32,7 @@ import java.awt.geom.Rectangle2D; import java.awt.color.ColorSpace; /** - * The Color class is used to encapsulate colors in the default + * The {@code Color} class is used to encapsulate colors in the default * sRGB color space or colors in arbitrary color spaces identified by a * {@link ColorSpace}. Every color has an implicit alpha value of 1.0 or * an explicit one provided in the constructor. The alpha value @@ -41,8 +41,8 @@ import java.awt.color.ColorSpace; * An alpha value of 1.0 or 255 means that the color is completely * opaque and an alpha value of 0 or 0.0 means that the color is * completely transparent. - * When constructing a Color with an explicit alpha or - * getting the color/alpha components of a Color, the color + * When constructing a {@code Color} with an explicit alpha or + * getting the color/alpha components of a {@code Color}, the color * components are never premultiplied by the alpha component. *

          * The default color space for the Java 2D(tm) API is sRGB, a proposed @@ -210,11 +210,11 @@ public class Color implements Paint, java.io.Serializable { int value; /** - * The color value in the default sRGB ColorSpace as - * float components (no alpha). - * If null after object construction, this must be an + * The color value in the default sRGB {@code ColorSpace} as + * {@code float} components (no alpha). + * If {@code null} after object construction, this must be an * sRGB color constructed with 8-bit precision, so compute from the - * int color value. + * {@code int} color value. * @serial * @see #getRGBColorComponents * @see #getRGBComponents @@ -222,11 +222,11 @@ public class Color implements Paint, java.io.Serializable { private float frgbvalue[] = null; /** - * The color value in the native ColorSpace as - * float components (no alpha). - * If null after object construction, this must be an + * The color value in the native {@code ColorSpace} as + * {@code float} components (no alpha). + * If {@code null} after object construction, this must be an * sRGB color constructed with 8-bit precision, so compute from the - * int color value. + * {@code int} color value. * @serial * @see #getRGBColorComponents * @see #getRGBComponents @@ -234,9 +234,9 @@ public class Color implements Paint, java.io.Serializable { private float fvalue[] = null; /** - * The alpha value as a float component. - * If frgbvalue is null, this is not valid - * data, so compute from the int color value. + * The alpha value as a {@code float} component. + * If {@code frgbvalue} is {@code null}, this is not valid + * data, so compute from the {@code int} color value. * @serial * @see #getRGBComponents * @see #getComponents @@ -244,7 +244,7 @@ public class Color implements Paint, java.io.Serializable { private float falpha = 0.0f; /** - * The ColorSpace. If null, then it's + * The {@code ColorSpace}. If {@code null}, then it's * default is sRGB. * @serial * @see #getColor @@ -313,9 +313,9 @@ public class Color implements Paint, java.io.Serializable { } /** - * Checks the color float components supplied for + * Checks the color {@code float} components supplied for * validity. - * Throws an IllegalArgumentException if the value is out + * Throws an {@code IllegalArgumentException} if the value is out * of range. * @param r the Red component * @param g the Green component @@ -354,8 +354,8 @@ public class Color implements Paint, java.io.Serializable { * available for a given output device. * Alpha is defaulted to 255. * - * @throws IllegalArgumentException if r, g - * or b are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g} + * or {@code b} are outside of the range * 0 to 255, inclusive * @param r the red component * @param g the green component @@ -373,8 +373,8 @@ public class Color implements Paint, java.io.Serializable { * Creates an sRGB color with the specified red, green, blue, and alpha * values in the range (0 - 255). * - * @throws IllegalArgumentException if r, g, - * b or a are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g}, + * {@code b} or {@code a} are outside of the range * 0 to 255, inclusive * @param r the red component * @param g the green component @@ -418,12 +418,12 @@ public class Color implements Paint, java.io.Serializable { * Creates an sRGB color with the specified combined RGBA value consisting * of the alpha component in bits 24-31, the red component in bits 16-23, * the green component in bits 8-15, and the blue component in bits 0-7. - * If the hasalpha argument is false, alpha + * If the {@code hasalpha} argument is {@code false}, alpha * is defaulted to 255. * * @param rgba the combined RGBA components - * @param hasalpha true if the alpha bits are valid; - * false otherwise + * @param hasalpha {@code true} if the alpha bits are valid; + * {@code false} otherwise * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed * @see #getGreen @@ -446,8 +446,8 @@ public class Color implements Paint, java.io.Serializable { * match given the color space available for a particular output * device. * - * @throws IllegalArgumentException if r, g - * or b are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g} + * or {@code b} are outside of the range * 0.0 to 1.0, inclusive * @param r the red component * @param g the green component @@ -473,8 +473,8 @@ public class Color implements Paint, java.io.Serializable { * alpha values in the range (0.0 - 1.0). The actual color * used in rendering depends on finding the best match given the * color space available for a particular output device. - * @throws IllegalArgumentException if r, g - * b or a are outside of the range + * @throws IllegalArgumentException if {@code r}, {@code g} + * {@code b} or {@code a} are outside of the range * 0.0 to 1.0, inclusive * @param r the red component * @param g the green component @@ -497,19 +497,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates a color in the specified ColorSpace - * with the color components specified in the float + * Creates a color in the specified {@code ColorSpace} + * with the color components specified in the {@code float} * array and the specified alpha. The number of components is - * determined by the type of the ColorSpace. For + * determined by the type of the {@code ColorSpace}. For * example, RGB requires 3 components, but CMYK requires 4 * components. - * @param cspace the ColorSpace to be used to + * @param cspace the {@code ColorSpace} to be used to * interpret the components * @param components an arbitrary number of color components - * that is compatible with the ColorSpace + * that is compatible with the {@code ColorSpace} * @param alpha alpha value * @throws IllegalArgumentException if any of the values in the - * components array or alpha is + * {@code components} array or {@code alpha} is * outside of the range 0.0 to 1.0 * @see #getComponents * @see #getColorComponents @@ -592,7 +592,7 @@ public class Color implements Paint, java.io.Serializable { * (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are * blue). * @return the RGB value of the color in the default sRGB - * ColorModel. + * {@code ColorModel}. * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed * @see #getGreen @@ -606,19 +606,19 @@ public class Color implements Paint, java.io.Serializable { private static final double FACTOR = 0.7; /** - * Creates a new Color that is a brighter version of this - * Color. + * Creates a new {@code Color} that is a brighter version of this + * {@code Color}. *

          * This method applies an arbitrary scale factor to each of the three RGB - * components of this Color to create a brighter version - * of this Color. + * components of this {@code Color} to create a brighter version + * of this {@code Color}. * The {@code alpha} value is preserved. - * Although brighter and - * darker are inverse operations, the results of a + * Although {@code brighter} and + * {@code darker} are inverse operations, the results of a * series of invocations of these two methods might be inconsistent * because of rounding errors. - * @return a new Color object that is - * a brighter version of this Color + * @return a new {@code Color} object that is + * a brighter version of this {@code Color} * with the same {@code alpha} value. * @see java.awt.Color#darker * @since 1.0 @@ -649,19 +649,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates a new Color that is a darker version of this - * Color. + * Creates a new {@code Color} that is a darker version of this + * {@code Color}. *

          * This method applies an arbitrary scale factor to each of the three RGB - * components of this Color to create a darker version of - * this Color. + * components of this {@code Color} to create a darker version of + * this {@code Color}. * The {@code alpha} value is preserved. - * Although brighter and - * darker are inverse operations, the results of a series + * Although {@code brighter} and + * {@code darker} are inverse operations, the results of a series * of invocations of these two methods might be inconsistent because * of rounding errors. - * @return a new Color object that is - * a darker version of this Color + * @return a new {@code Color} object that is + * a darker version of this {@code Color} * with the same {@code alpha} value. * @see java.awt.Color#brighter * @since 1.0 @@ -674,7 +674,7 @@ public class Color implements Paint, java.io.Serializable { } /** - * Computes the hash code for this Color. + * Computes the hash code for this {@code Color}. * @return a hash code value for this object. * @since 1.0 */ @@ -684,15 +684,15 @@ public class Color implements Paint, java.io.Serializable { /** * Determines whether another object is equal to this - * Color. + * {@code Color}. *

          - * The result is true if and only if the argument is not - * null and is a Color object that has the same + * The result is {@code true} if and only if the argument is not + * {@code null} and is a {@code Color} object that has the same * red, green, blue, and alpha values as this object. * @param obj the object to test for equality with this - * Color - * @return true if the objects are the same; - * false otherwise. + * {@code Color} + * @return {@code true} if the objects are the same; + * {@code false} otherwise. * @since 1.0 */ public boolean equals(Object obj) { @@ -700,25 +700,25 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a string representation of this Color. This + * Returns a string representation of this {@code Color}. This * method is intended to be used only for debugging purposes. The * content and format of the returned string might vary between * implementations. The returned string might be empty but cannot - * be null. + * be {@code null}. * - * @return a string representation of this Color. + * @return a string representation of this {@code Color}. */ public String toString() { return getClass().getName() + "[r=" + getRed() + ",g=" + getGreen() + ",b=" + getBlue() + "]"; } /** - * Converts a String to an integer and returns the - * specified opaque Color. This method handles string + * Converts a {@code String} to an integer and returns the + * specified opaque {@code Color}. This method handles string * formats that are used to represent octal and hexadecimal numbers. - * @param nm a String that represents + * @param nm a {@code String} that represents * an opaque color as a 24-bit integer - * @return the new Color object. + * @return the new {@code Color} object. * @see java.lang.Integer#decode * @exception NumberFormatException if the specified string cannot * be interpreted as a decimal, @@ -736,13 +736,13 @@ public class Color implements Paint, java.io.Serializable { *

          * The argument is treated as the name of a system property to * be obtained. The string value of this property is then interpreted - * as an integer which is then converted to a Color + * as an integer which is then converted to a {@code Color} * object. *

          * If the specified property is not found or could not be parsed as - * an integer then null is returned. + * an integer then {@code null} is returned. * @param nm the name of the color property - * @return the Color converted from the system + * @return the {@code Color} converted from the system * property. * @see java.lang.System#getProperty(java.lang.String) * @see java.lang.Integer#getInteger(java.lang.String) @@ -758,16 +758,16 @@ public class Color implements Paint, java.io.Serializable { *

          * The first argument is treated as the name of a system property to * be obtained. The string value of this property is then interpreted - * as an integer which is then converted to a Color + * as an integer which is then converted to a {@code Color} * object. *

          * If the specified property is not found or cannot be parsed as - * an integer then the Color specified by the second + * an integer then the {@code Color} specified by the second * argument is returned instead. * @param nm the name of the color property - * @param v the default Color - * @return the Color converted from the system - * property, or the specified Color. + * @param v the default {@code Color} + * @return the {@code Color} converted from the system + * property, or the specified {@code Color}. * @see java.lang.System#getProperty(java.lang.String) * @see java.lang.Integer#getInteger(java.lang.String) * @see java.awt.Color#Color(int) @@ -787,16 +787,16 @@ public class Color implements Paint, java.io.Serializable { *

          * The first argument is treated as the name of a system property to * be obtained. The string value of this property is then interpreted - * as an integer which is then converted to a Color + * as an integer which is then converted to a {@code Color} * object. *

          * If the specified property is not found or could not be parsed as - * an integer then the integer value v is used instead, - * and is converted to a Color object. + * an integer then the integer value {@code v} is used instead, + * and is converted to a {@code Color} object. * @param nm the name of the color property * @param v the default color value, as an integer - * @return the Color converted from the system - * property or the Color converted from + * @return the {@code Color} converted from the system + * property or the {@code Color} converted from * the specified integer. * @see java.lang.System#getProperty(java.lang.String) * @see java.lang.Integer#getInteger(java.lang.String) @@ -813,19 +813,19 @@ public class Color implements Paint, java.io.Serializable { * Converts the components of a color, as specified by the HSB * model, to an equivalent set of values for the default RGB model. *

          - * The saturation and brightness components + * The {@code saturation} and {@code brightness} components * should be floating-point values between zero and one - * (numbers in the range 0.0-1.0). The hue component + * (numbers in the range 0.0-1.0). The {@code hue} component * can be any floating-point number. The floor of this number is * subtracted from it to create a fraction between 0 and 1. This * fractional number is then multiplied by 360 to produce the hue * angle in the HSB color model. *

          - * The integer that is returned by HSBtoRGB encodes the + * The integer that is returned by {@code HSBtoRGB} encodes the * value of a color in bits 0-23 of an integer value that is the same * format used by the method {@link #getRGB() getRGB}. * This integer can be supplied as an argument to the - * Color constructor that takes a single integer argument. + * {@code Color} constructor that takes a single integer argument. * @param hue the hue component of the color * @param saturation the saturation of the color * @param brightness the brightness of the color @@ -887,15 +887,15 @@ public class Color implements Paint, java.io.Serializable { * model, to an equivalent set of values for hue, saturation, and * brightness that are the three components of the HSB model. *

          - * If the hsbvals argument is null, then a + * If the {@code hsbvals} argument is {@code null}, then a * new array is allocated to return the result. Otherwise, the method - * returns the array hsbvals, with the values put into + * returns the array {@code hsbvals}, with the values put into * that array. * @param r the red component of the color * @param g the green component of the color * @param b the blue component of the color * @param hsbvals the array used to return the - * three HSB values, or null + * three HSB values, or {@code null} * @return an array of three elements containing the hue, saturation, * and brightness (in that order), of the color with * the indicated red, green, and blue components. @@ -942,12 +942,12 @@ public class Color implements Paint, java.io.Serializable { } /** - * Creates a Color object based on the specified values + * Creates a {@code Color} object based on the specified values * for the HSB color model. *

          - * The s and b components should be + * The {@code s} and {@code b} components should be * floating-point values between zero and one - * (numbers in the range 0.0-1.0). The h component + * (numbers in the range 0.0-1.0). The {@code h} component * can be any floating-point number. The floor of this number is * subtracted from it to create a fraction between 0 and 1. This * fractional number is then multiplied by 360 to produce the hue @@ -955,7 +955,7 @@ public class Color implements Paint, java.io.Serializable { * @param h the hue component * @param s the saturation of the color * @param b the brightness of the color - * @return a Color object with the specified hue, + * @return a {@code Color} object with the specified hue, * saturation, and brightness. * @since 1.0 */ @@ -964,16 +964,16 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing the color and alpha - * components of the Color, as represented in the default + * Returns a {@code float} array containing the color and alpha + * components of the {@code Color}, as represented in the default * sRGB color space. - * If compArray is null, an array of length + * If {@code compArray} is {@code null}, an array of length * 4 is created for the return value. Otherwise, - * compArray must have length 4 or greater, + * {@code compArray} must have length 4 or greater, * and it is filled in with the components and returned. * @param compArray an array that this method fills with * color and alpha components and returns - * @return the RGBA components in a float array. + * @return the RGBA components in a {@code float} array. */ public float[] getRGBComponents(float[] compArray) { float[] f; @@ -997,15 +997,15 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing only the color - * components of the Color, in the default sRGB color - * space. If compArray is null, an array of + * Returns a {@code float} array containing only the color + * components of the {@code Color}, in the default sRGB color + * space. If {@code compArray} is {@code null}, an array of * length 3 is created for the return value. Otherwise, - * compArray must have length 3 or greater, and it is + * {@code compArray} must have length 3 or greater, and it is * filled in with the components and returned. * @param compArray an array that this method fills with color * components and returns - * @return the RGB components in a float array. + * @return the RGB components in a {@code float} array. */ public float[] getRGBColorComponents(float[] compArray) { float[] f; @@ -1027,19 +1027,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing the color and alpha - * components of the Color, in the - * ColorSpace of the Color. - * If compArray is null, an array with + * Returns a {@code float} array containing the color and alpha + * components of the {@code Color}, in the + * {@code ColorSpace} of the {@code Color}. + * If {@code compArray} is {@code null}, an array with * length equal to the number of components in the associated - * ColorSpace plus one is created for - * the return value. Otherwise, compArray must have at + * {@code ColorSpace} plus one is created for + * the return value. Otherwise, {@code compArray} must have at * least this length and it is filled in with the components and * returned. * @param compArray an array that this method fills with the color and - * alpha components of this Color in its - * ColorSpace and returns - * @return the color and alpha components in a float + * alpha components of this {@code Color} in its + * {@code ColorSpace} and returns + * @return the color and alpha components in a {@code float} * array. */ public float[] getComponents(float[] compArray) { @@ -1060,19 +1060,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing only the color - * components of the Color, in the - * ColorSpace of the Color. - * If compArray is null, an array with + * Returns a {@code float} array containing only the color + * components of the {@code Color}, in the + * {@code ColorSpace} of the {@code Color}. + * If {@code compArray} is {@code null}, an array with * length equal to the number of components in the associated - * ColorSpace is created for - * the return value. Otherwise, compArray must have at + * {@code ColorSpace} is created for + * the return value. Otherwise, {@code compArray} must have at * least this length and it is filled in with the components and * returned. * @param compArray an array that this method fills with the color - * components of this Color in its - * ColorSpace and returns - * @return the color components in a float array. + * components of this {@code Color} in its + * {@code ColorSpace} and returns + * @return the color components in a {@code float} array. */ public float[] getColorComponents(float[] compArray) { if (fvalue == null) @@ -1091,19 +1091,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing the color and alpha - * components of the Color, in the - * ColorSpace specified by the cspace - * parameter. If compArray is null, an + * Returns a {@code float} array containing the color and alpha + * components of the {@code Color}, in the + * {@code ColorSpace} specified by the {@code cspace} + * parameter. If {@code compArray} is {@code null}, an * array with length equal to the number of components in - * cspace plus one is created for the return value. - * Otherwise, compArray must have at least this + * {@code cspace} plus one is created for the return value. + * Otherwise, {@code compArray} must have at least this * length, and it is filled in with the components and returned. - * @param cspace a specified ColorSpace + * @param cspace a specified {@code ColorSpace} * @param compArray an array that this method fills with the - * color and alpha components of this Color in - * the specified ColorSpace and returns - * @return the color and alpha components in a float + * color and alpha components of this {@code Color} in + * the specified {@code ColorSpace} and returns + * @return the color and alpha components in a {@code float} * array. */ public float[] getComponents(ColorSpace cspace, float[] compArray) { @@ -1136,19 +1136,19 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns a float array containing only the color - * components of the Color in the - * ColorSpace specified by the cspace - * parameter. If compArray is null, an array + * Returns a {@code float} array containing only the color + * components of the {@code Color} in the + * {@code ColorSpace} specified by the {@code cspace} + * parameter. If {@code compArray} is {@code null}, an array * with length equal to the number of components in - * cspace is created for the return value. Otherwise, - * compArray must have at least this length, and it is + * {@code cspace} is created for the return value. Otherwise, + * {@code compArray} must have at least this length, and it is * filled in with the components and returned. - * @param cspace a specified ColorSpace + * @param cspace a specified {@code ColorSpace} * @param compArray an array that this method fills with the color - * components of this Color in the specified - * ColorSpace - * @return the color components in a float array. + * components of this {@code Color} in the specified + * {@code ColorSpace} + * @return the color components in a {@code float} array. */ public float[] getColorComponents(ColorSpace cspace, float[] compArray) { if (cs == null) { @@ -1175,8 +1175,8 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns the ColorSpace of this Color. - * @return this Color object's ColorSpace. + * Returns the {@code ColorSpace} of this {@code Color}. + * @return this {@code Color} object's {@code ColorSpace}. */ public ColorSpace getColorSpace() { if (cs == null) { @@ -1221,9 +1221,9 @@ public class Color implements Paint, java.io.Serializable { } /** - * Returns the transparency mode for this Color. This is - * required to implement the Paint interface. - * @return this Color object's transparency mode. + * Returns the transparency mode for this {@code Color}. This is + * required to implement the {@code Paint} interface. + * @return this {@code Color} object's transparency mode. * @see Paint * @see Transparency * @see #createContext diff --git a/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java index ae881445a3a..15e296cf525 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ColorPaintContext.java @@ -50,7 +50,7 @@ class ColorPaintContext implements PaintContext { * (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are * blue). * @return the RGB value of the color in the default sRGB - * ColorModel. + * {@code ColorModel}. * @see java.awt.image.ColorModel#getRGBdefault * @see #getRed * @see #getGreen diff --git a/jdk/src/java.desktop/share/classes/java/awt/Component.java b/jdk/src/java.desktop/share/classes/java/awt/Component.java index 1d80c9e01e0..663c5f909be 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Component.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java @@ -89,9 +89,9 @@ import sun.util.logging.PlatformLogger; * that can be displayed on the screen and that can interact with the * user. Examples of components are the buttons, checkboxes, and scrollbars * of a typical graphical user interface.

          - * The Component class is the abstract superclass of + * The {@code Component} class is the abstract superclass of * the nonmenu-related Abstract Window Toolkit components. Class - * Component can also be extended directly to create a + * {@code Component} can also be extended directly to create a * lightweight component. A lightweight component is a component that is * not associated with a native window. On the contrary, a heavyweight * component is associated with a native window. The {@link #isLightweight()} @@ -107,10 +107,10 @@ import sun.util.logging.PlatformLogger; * *

          Serialization

          * It is important to note that only AWT listeners which conform - * to the Serializable protocol will be saved when + * to the {@code Serializable} protocol will be saved when * the object is stored. If an AWT object has listeners that * aren't marked serializable, they will be dropped at - * writeObject time. Developers will need, as always, + * {@code writeObject} time. Developers will need, as always, * to consider the implications of making an object serializable. * One situation to watch out for is this: *
          @@ -136,12 +136,12 @@ import sun.util.logging.PlatformLogger;
            *        }
            *    }
            * 
          - * In this example, serializing aButton by itself - * will cause MyApp and everything it refers to + * In this example, serializing {@code aButton} by itself + * will cause {@code MyApp} and everything it refers to * to be serialized as well. The problem is that the listener * is serializable by coincidence, not by design. To separate - * the decisions about MyApp and the - * ActionListener being serializable one can use a + * the decisions about {@code MyApp} and the + * {@code ActionListener} being serializable one can use a * nested class, as in the following example: *
            *    import java.awt.*;
          @@ -194,7 +194,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The peer of the component. The peer implements the component's
          -     * behavior. The peer is set when the Component is
          +     * behavior. The peer is set when the {@code Component} is
                * added to a container that also is a peer.
                * @see #addNotify
                * @see #removeNotify
          @@ -202,14 +202,14 @@ public abstract class Component implements ImageObserver, MenuContainer,
               transient volatile ComponentPeer peer;
           
               /**
          -     * The parent of the object. It may be null
          +     * The parent of the object. It may be {@code null}
                * for top-level components.
                * @see #getParent
                */
               transient Container parent;
           
               /**
          -     * The AppContext of the component. Applets/Plugin may
          +     * The {@code AppContext} of the component. Applets/Plugin may
                * change the AppContext.
                */
               transient AppContext appContext;
          @@ -248,7 +248,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The foreground color for this component.
          -     * foreground can be null.
          +     * {@code foreground} can be {@code null}.
                *
                * @serial
                * @see #getForeground
          @@ -258,7 +258,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The background color for this component.
          -     * background can be null.
          +     * {@code background} can be {@code null}.
                *
                * @serial
                * @see #getBackground
          @@ -268,7 +268,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The font used by this component.
          -     * The font can be null.
          +     * The {@code font} can be {@code null}.
                *
                * @serial
                * @see #getFont
          @@ -278,13 +278,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * The font which the peer is currently using.
          -     * (null if no peer exists.)
          +     * ({@code null} if no peer exists.)
                */
               Font        peerFont;
           
               /**
                * The cursor displayed when pointer is over this component.
          -     * This value can be null.
          +     * This value can be {@code null}.
                *
                * @serial
                * @see #getCursor
          @@ -302,10 +302,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
               Locale      locale;
           
               /**
          -     * A reference to a GraphicsConfiguration object
          +     * A reference to a {@code GraphicsConfiguration} object
                * used to describe the characteristics of a graphics
                * destination.
          -     * This value can be null.
          +     * This value can be {@code null}.
                *
                * @since 1.3
                * @serial
          @@ -315,7 +315,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
               private transient volatile GraphicsConfiguration graphicsConfig;
           
               /**
          -     * A reference to a BufferStrategy object
          +     * A reference to a {@code BufferStrategy} object
                * used to manipulate the buffers on this component.
                *
                * @since 1.4
          @@ -367,7 +367,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
               private volatile boolean valid = false;
           
               /**
          -     * The DropTarget associated with this component.
          +     * The {@code DropTarget} associated with this component.
                *
                * @since 1.2
                * @serial
          @@ -384,7 +384,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * A component's name.
          -     * This field can be null.
          +     * This field can be {@code null}.
                *
                * @serial
                * @see #getName
          @@ -394,7 +394,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
           
               /**
                * A bool to determine whether the name has
          -     * been set explicitly. nameExplicitlySet will
          +     * been set explicitly. {@code nameExplicitlySet} will
                * be false if the name has not been set and
                * true if it has.
                *
          @@ -523,7 +523,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
               = ComponentOrientation.UNKNOWN;
           
               /**
          -     * newEventsOnly will be true if the event is
          +     * {@code newEventsOnly} will be true if the event is
                * one of the event types enabled for the component.
                * It will then allow for normal processing to
                * continue.  If it is false the event is passed
          @@ -565,13 +565,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
               static final String windowFocusListenerK = "windowFocusL";
           
               /**
          -     * The eventMask is ONLY set by subclasses via
          -     * enableEvents.
          +     * The {@code eventMask} is ONLY set by subclasses via
          +     * {@code enableEvents}.
                * The mask should NOT be set when listeners are registered
                * so that we can distinguish the difference between when
                * listeners request events and subclasses request them.
                * One bit is used to indicate whether input methods are
          -     * enabled; this bit is set by enableInputMethods and is
          +     * enabled; this bit is set by {@code enableInputMethods} and is
                * on by default.
                *
                * @serial
          @@ -604,15 +604,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
               }
           
               /**
          -     * Ease-of-use constant for getAlignmentY().
          +     * Ease-of-use constant for {@code getAlignmentY()}.
                * Specifies an alignment to the top of the component.
                * @see     #getAlignmentY
                */
               public static final float TOP_ALIGNMENT = 0.0f;
           
               /**
          -     * Ease-of-use constant for getAlignmentY and
          -     * getAlignmentX. Specifies an alignment to
          +     * Ease-of-use constant for {@code getAlignmentY} and
          +     * {@code getAlignmentX}. Specifies an alignment to
                * the center of the component
                * @see     #getAlignmentX
                * @see     #getAlignmentY
          @@ -620,21 +620,21 @@ public abstract class Component implements ImageObserver, MenuContainer,
               public static final float CENTER_ALIGNMENT = 0.5f;
           
               /**
          -     * Ease-of-use constant for getAlignmentY.
          +     * Ease-of-use constant for {@code getAlignmentY}.
                * Specifies an alignment to the bottom of the component.
                * @see     #getAlignmentY
                */
               public static final float BOTTOM_ALIGNMENT = 1.0f;
           
               /**
          -     * Ease-of-use constant for getAlignmentX.
          +     * Ease-of-use constant for {@code getAlignmentX}.
                * Specifies an alignment to the left side of the component.
                * @see     #getAlignmentX
                */
               public static final float LEFT_ALIGNMENT = 0.0f;
           
               /**
          -     * Ease-of-use constant for getAlignmentX.
          +     * Ease-of-use constant for {@code getAlignmentX}.
                * Specifies an alignment to the right side of the component.
                * @see     #getAlignmentX
                */
          @@ -646,8 +646,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
               private static final long serialVersionUID = -7644114512714619750L;
           
               /**
          -     * If any PropertyChangeListeners have been registered,
          -     * the changeSupport field describes them.
          +     * If any {@code PropertyChangeListeners} have been registered,
          +     * the {@code changeSupport} field describes them.
                *
                * @serial
                * @since 1.2
          @@ -705,8 +705,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
                * size; not a developer specified minimum size).  For sizes
                * smaller than the minimum size the baseline may change in a way
                * other than the baseline resize behavior indicates.  Similarly,
          -     * as the size approaches Integer.MAX_VALUE and/or
          -     * Short.MAX_VALUE the baseline may change in a way
          +     * as the size approaches {@code Integer.MAX_VALUE} and/or
          +     * {@code Short.MAX_VALUE} the baseline may change in a way
                * other than the baseline resize behavior indicates.
                *
                * @see #getBaselineResizeBehavior
          @@ -716,11 +716,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
               public enum BaselineResizeBehavior {
                   /**
                    * Indicates the baseline remains fixed relative to the
          -         * y-origin.  That is, getBaseline returns
          +         * y-origin.  That is, {@code getBaseline} returns
                    * the same value regardless of the height or width.  For example, a
          -         * JLabel containing non-empty text with a
          -         * vertical alignment of TOP should have a
          -         * baseline type of CONSTANT_ASCENT.
          +         * {@code JLabel} containing non-empty text with a
          +         * vertical alignment of {@code TOP} should have a
          +         * baseline type of {@code CONSTANT_ASCENT}.
                    */
                   CONSTANT_ASCENT,
           
          @@ -728,18 +728,18 @@ public abstract class Component implements ImageObserver, MenuContainer,
                    * Indicates the baseline remains fixed relative to the height
                    * and does not change as the width is varied.  That is, for
                    * any height H the difference between H and
          -         * getBaseline(w, H) is the same.  For example, a
          -         * JLabel containing non-empty text with a
          -         * vertical alignment of BOTTOM should have a
          -         * baseline type of CONSTANT_DESCENT.
          +         * {@code getBaseline(w, H)} is the same.  For example, a
          +         * {@code JLabel} containing non-empty text with a
          +         * vertical alignment of {@code BOTTOM} should have a
          +         * baseline type of {@code CONSTANT_DESCENT}.
                    */
                   CONSTANT_DESCENT,
           
                   /**
                    * Indicates the baseline remains a fixed distance from
                    * the center of the component.  That is, for any height H the
          -         * difference between getBaseline(w, H) and
          -         * H / 2 is the same (plus or minus one depending upon
          +         * difference between {@code getBaseline(w, H)} and
          +         * {@code H / 2} is the same (plus or minus one depending upon
                    * rounding error).
                    * 

          * Because of possible rounding errors it is recommended @@ -988,11 +988,11 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Constructs a new component. Class Component can be + * Constructs a new component. Class {@code Component} can be * extended directly to create a lightweight component that does not * utilize an opaque native window. A lightweight component must be * hosted by a native container somewhere higher up in the component - * tree (for example, by a Frame object). + * tree (for example, by a {@code Frame} object). */ protected Component() { appContext = AppContext.getAppContext(); @@ -1004,8 +1004,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Constructs a name for this component. Called by getName - * when the name is null. + * Constructs a name for this component. Called by {@code getName} + * when the name is {@code null}. */ String constructComponentName() { return null; // For strict compliance with prior platform versions, a Component @@ -1071,8 +1071,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Associate a DropTarget with this component. - * The Component will receive drops only if it + * Associate a {@code DropTarget} with this component. + * The {@code Component} will receive drops only if it * is enabled. * * @see #isEnabled @@ -1119,8 +1119,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the DropTarget associated with this - * Component. + * Gets the {@code DropTarget} associated with this + * {@code Component}. * * @return the drop target */ @@ -1128,18 +1128,18 @@ public abstract class Component implements ImageObserver, MenuContainer, public synchronized DropTarget getDropTarget() { return dropTarget; } /** - * Gets the GraphicsConfiguration associated with this - * Component. - * If the Component has not been assigned a specific - * GraphicsConfiguration, - * the GraphicsConfiguration of the - * Component object's top-level container is + * Gets the {@code GraphicsConfiguration} associated with this + * {@code Component}. + * If the {@code Component} has not been assigned a specific + * {@code GraphicsConfiguration}, + * the {@code GraphicsConfiguration} of the + * {@code Component} object's top-level container is * returned. - * If the Component has been created, but not yet added - * to a Container, this method returns null. + * If the {@code Component} has been created, but not yet added + * to a {@code Container}, this method returns {@code null}. * - * @return the GraphicsConfiguration used by this - * Component or null + * @return the {@code GraphicsConfiguration} used by this + * {@code Component} or {@code null} * @since 1.3 */ public GraphicsConfiguration getGraphicsConfiguration() { @@ -1176,8 +1176,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Checks that this component's GraphicsDevice - * idString matches the string argument. + * Checks that this component's {@code GraphicsDevice} + * {@code idString} matches the string argument. */ void checkGD(String stringID) { if (graphicsConfig != null) { @@ -1243,7 +1243,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * In order to account for peers' size requirements, components are invalidated * before they are first shown on the screen. By the time the parent container * is fully realized, all its components will be valid. - * @return true if the component is valid, false + * @return {@code true} if the component is valid, {@code false} * otherwise * @see #validate * @see #invalidate @@ -1268,8 +1268,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * is made undisplayable. A containment hierarchy is made * undisplayable when its ancestor window is disposed. * - * @return true if the component is displayable, - * false otherwise + * @return {@code true} if the component is displayable, + * {@code false} otherwise * @see Container#add(Component) * @see Window#pack * @see Window#show @@ -1285,9 +1285,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Determines whether this component should be visible when its * parent is visible. Components are * initially visible, with the exception of top level components such - * as Frame objects. - * @return true if the component is visible, - * false otherwise + * as {@code Frame} objects. + * @return {@code true} if the component is visible, + * {@code false} otherwise * @see #setVisible * @since 1.0 */ @@ -1301,9 +1301,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Determines whether this component will be displayed on the screen. - * @return true if the component and all of its ancestors + * @return {@code true} if the component and all of its ancestors * until a toplevel window or null parent are visible, - * false otherwise + * {@code false} otherwise */ boolean isRecursivelyVisible() { return visible && (parent == null || parent.isRecursivelyVisible()); @@ -1368,30 +1368,30 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns the position of the mouse pointer in this Component's - * coordinate space if the Component is directly under the mouse - * pointer, otherwise returns null. - * If the Component is not showing on the screen, this method - * returns null even if the mouse pointer is above the area - * where the Component would be displayed. - * If the Component is partially or fully obscured by other - * Components or native windows, this method returns a non-null + * Returns the position of the mouse pointer in this {@code Component}'s + * coordinate space if the {@code Component} is directly under the mouse + * pointer, otherwise returns {@code null}. + * If the {@code Component} is not showing on the screen, this method + * returns {@code null} even if the mouse pointer is above the area + * where the {@code Component} would be displayed. + * If the {@code Component} is partially or fully obscured by other + * {@code Component}s or native windows, this method returns a non-null * value only if the mouse pointer is located above the unobscured part of the - * Component. + * {@code Component}. *

          - * For Containers it returns a non-null value if the mouse is - * above the Container itself or above any of its descendants. + * For {@code Container}s it returns a non-null value if the mouse is + * above the {@code Container} itself or above any of its descendants. * Use {@link Container#getMousePosition(boolean)} if you need to exclude children. *

          * Sometimes the exact mouse coordinates are not important, and the only thing - * that matters is whether a specific Component is under the mouse - * pointer. If the return value of this method is null, mouse - * pointer is not directly above the Component. + * that matters is whether a specific {@code Component} is under the mouse + * pointer. If the return value of this method is {@code null}, mouse + * pointer is not directly above the {@code Component}. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true * @see #isShowing * @see Container#getMousePosition - * @return mouse coordinates relative to this Component, or null + * @return mouse coordinates relative to this {@code Component}, or null * @since 1.5 */ public Point getMousePosition() throws HeadlessException { @@ -1436,8 +1436,8 @@ public abstract class Component implements ImageObserver, MenuContainer, *

        • the {@code Component} is obscured by another {@code Component} or * {@code Container}. *
        - * @return true if the component is showing, - * false otherwise + * @return {@code true} if the component is showing, + * {@code false} otherwise * @see #setVisible * @since 1.0 */ @@ -1453,9 +1453,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Determines whether this component is enabled. An enabled component * can respond to user input and generate events. Components are * enabled initially by default. A component may be enabled or disabled by - * calling its setEnabled method. - * @return true if the component is enabled, - * false otherwise + * calling its {@code setEnabled} method. + * @return {@code true} if the component is enabled, + * {@code false} otherwise * @see #setEnabled * @since 1.0 */ @@ -1473,7 +1473,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Enables or disables this component, depending on the value of the - * parameter b. An enabled component can respond to user + * parameter {@code b}. An enabled component can respond to user * input and generate events. Components are enabled initially by default. * *

        Note: Disabling a lightweight component does not prevent it from @@ -1482,7 +1482,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * in this container from receiving any input events. But disabling a * lightweight container affects only this container. * - * @param b If true, this component is + * @param b If {@code true}, this component is * enabled; otherwise this component is disabled * @see #isEnabled * @see #isLightweight @@ -1494,7 +1494,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void enable() { @@ -1524,7 +1524,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * otherwise {@code false} * * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void enable(boolean b) { @@ -1537,7 +1537,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void disable() { @@ -1627,12 +1627,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Shows or hides this component depending on the value of parameter - * b. + * {@code b}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. * - * @param b if true, shows this component; + * @param b if {@code true}, shows this component; * otherwise, hides this component * @see #isVisible * @see #invalidate @@ -1644,7 +1644,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setVisible(boolean). + * replaced by {@code setVisible(boolean)}. */ @Deprecated public void show() { @@ -1687,7 +1687,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * otherwise {@code false} * * @deprecated As of JDK version 1.1, - * replaced by setVisible(boolean). + * replaced by {@code setVisible(boolean)}. */ @Deprecated public void show(boolean b) { @@ -1712,7 +1712,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by setVisible(boolean). + * replaced by {@code setVisible(boolean)}. */ @Deprecated public void hide() { @@ -1775,7 +1775,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the foreground color of this component. * @param c the color to become this component's - * foreground color; if this parameter is null + * foreground color; if this parameter is {@code null} * then this component will inherit * the foreground color of its parent * @see #getForeground @@ -1798,11 +1798,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the foreground color has been explicitly set for this - * Component. If this method returns false, this Component is + * Component. If this method returns {@code false}, this Component is * inheriting its foreground color from an ancestor. * - * @return true if the foreground color has been explicitly - * set for this Component; false otherwise. + * @return {@code true} if the foreground color has been explicitly + * set for this Component; {@code false} otherwise. * @since 1.4 */ public boolean isForegroundSet() { @@ -1835,7 +1835,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * may differ between operating systems. * * @param c the color to become this component's color; - * if this parameter is null, then this + * if this parameter is {@code null}, then this * component will inherit the background color of its parent * @see #getBackground * @since 1.0 @@ -1857,11 +1857,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the background color has been explicitly set for this - * Component. If this method returns false, this Component is + * Component. If this method returns {@code false}, this Component is * inheriting its background color from an ancestor. * - * @return true if the background color has been explicitly - * set for this Component; false otherwise. + * @return {@code true} if the background color has been explicitly + * set for this Component; {@code false} otherwise. * @since 1.4 */ public boolean isBackgroundSet() { @@ -1900,7 +1900,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * invalidates the component hierarchy. * * @param f the font to become this component's font; - * if this parameter is null then this + * if this parameter is {@code null} then this * component will inherit the font of its parent * @see #getFont * @see #invalidate @@ -1935,11 +1935,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the font has been explicitly set for this Component. If - * this method returns false, this Component is inheriting its + * this method returns {@code false}, this Component is inheriting its * font from an ancestor. * - * @return true if the font has been explicitly set for this - * Component; false otherwise. + * @return {@code true} if the font has been explicitly set for this + * Component; {@code false} otherwise. * @since 1.4 */ public boolean isFontSet() { @@ -1951,7 +1951,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @return this component's locale; if this component does not * have a locale, the locale of its parent is returned * @see #setLocale - * @exception IllegalComponentStateException if the Component + * @exception IllegalComponentStateException if the {@code Component} * does not have its own locale and has not yet been added to * a containment hierarchy such that the locale can be determined * from the containing parent @@ -1995,7 +1995,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the instance of ColorModel used to display + * Gets the instance of {@code ColorModel} used to display * the component on the output device. * @return the color model used by this component * @see java.awt.image.ColorModel @@ -2020,13 +2020,13 @@ public abstract class Component implements ImageObserver, MenuContainer, *

        * Due to the asynchronous nature of native event handling, this * method can return outdated values (for instance, after several calls - * of setLocation() in rapid succession). For this + * of {@code setLocation()} in rapid succession). For this * reason, the recommended method of obtaining a component's position is - * within java.awt.event.ComponentListener.componentMoved(), + * within {@code java.awt.event.ComponentListener.componentMoved()}, * which is called after the operating system has finished moving the * component. *

        - * @return an instance of Point representing + * @return an instance of {@code Point} representing * the top-left corner of the component's bounds in * the coordinate space of the component's parent * @see #setLocation @@ -2041,7 +2041,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the location of this component in the form of a point * specifying the component's top-left corner in the screen's * coordinate space. - * @return an instance of Point representing + * @return an instance of {@code Point} representing * the top-left corner of the component's bounds in the * coordinate space of the screen * @throws IllegalComponentStateException if the @@ -2087,7 +2087,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the location of this component's top left corner * @deprecated As of JDK version 1.1, - * replaced by getLocation(). + * replaced by {@code getLocation()}. */ @Deprecated public Point location() { @@ -2100,7 +2100,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves this component to a new location. The top-left corner of - * the new location is specified by the x and y + * the new location is specified by the {@code x} and {@code y} * parameters in the coordinate space of this component's parent. *

        * This method changes layout-related information, and therefore, @@ -2128,7 +2128,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * top-left corner in the parent's coordinate space * * @deprecated As of JDK version 1.1, - * replaced by setLocation(int, int). + * replaced by {@code setLocation(int, int)}. */ @Deprecated public void move(int x, int y) { @@ -2140,8 +2140,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves this component to a new location. The top-left corner of - * the new location is specified by point p. Point - * p is given in the parent's coordinate space. + * the new location is specified by point {@code p}. Point + * {@code p} is given in the parent's coordinate space. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2160,12 +2160,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the size of this component in the form of a - * Dimension object. The height - * field of the Dimension object contains - * this component's height, and the width - * field of the Dimension object contains + * {@code Dimension} object. The {@code height} + * field of the {@code Dimension} object contains + * this component's height, and the {@code width} + * field of the {@code Dimension} object contains * this component's width. - * @return a Dimension object that indicates the + * @return a {@code Dimension} object that indicates the * size of this component * @see #setSize * @since 1.1 @@ -2181,7 +2181,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @return the {@code Dimension} object that indicates the * size of this component * @deprecated As of JDK version 1.1, - * replaced by getSize(). + * replaced by {@code getSize()}. */ @Deprecated public Dimension size() { @@ -2189,8 +2189,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Resizes this component so that it has width width - * and height height. + * Resizes this component so that it has width {@code width} + * and height {@code height}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2212,7 +2212,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param width the new width of the component * @param height the new height of the component * @deprecated As of JDK version 1.1, - * replaced by setSize(int, int). + * replaced by {@code setSize(int, int)}. */ @Deprecated public void resize(int width, int height) { @@ -2223,8 +2223,8 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Resizes this component so that it has width d.width - * and height d.height. + * Resizes this component so that it has width {@code d.width} + * and height {@code d.height}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2247,7 +2247,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @param d the new size of this component * @deprecated As of JDK version 1.1, - * replaced by setSize(Dimension). + * replaced by {@code setSize(Dimension)}. */ @Deprecated public void resize(Dimension d) { @@ -2256,7 +2256,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the bounds of this component in the form of a - * Rectangle object. The bounds specify this + * {@code Rectangle} object. The bounds specify this * component's width, height, and location relative to * its parent. * @return a rectangle indicating this component's bounds @@ -2273,7 +2273,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the bounding rectangle for this component * @deprecated As of JDK version 1.1, - * replaced by getBounds(). + * replaced by {@code getBounds()}. */ @Deprecated public Rectangle bounds() { @@ -2282,16 +2282,16 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves and resizes this component. The new location of the top-left - * corner is specified by x and y, and the - * new size is specified by width and height. + * corner is specified by {@code x} and {@code y}, and the + * new size is specified by {@code width} and {@code height}. *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. * * @param x the new x-coordinate of this component * @param y the new y-coordinate of this component - * @param width the new width of this component - * @param height the new height of this + * @param width the new {@code width} of this component + * @param height the new {@code height} of this * component * @see #getBounds * @see #setLocation(int, int) @@ -2314,7 +2314,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param height the height of the rectangle * * @deprecated As of JDK version 1.1, - * replaced by setBounds(int, int, int, int). + * replaced by {@code setBounds(int, int, int, int)}. */ @Deprecated public void reshape(int x, int y, int width, int height) { @@ -2434,10 +2434,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Moves and resizes this component to conform to the new - * bounding rectangle r. This component's new - * position is specified by r.x and r.y, - * and its new size is specified by r.width and - * r.height + * bounding rectangle {@code r}. This component's new + * position is specified by {@code r.x} and {@code r.y}, + * and its new size is specified by {@code r.width} and + * {@code r.height} *

        * This method changes layout-related information, and therefore, * invalidates the component hierarchy. @@ -2460,8 +2460,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current x coordinate of the components origin. * This method is preferable to writing - * component.getBounds().x, - * or component.getLocation().x because it doesn't + * {@code component.getBounds().x}, + * or {@code component.getLocation().x} because it doesn't * cause any heap allocations. * * @return the current x coordinate of the components origin @@ -2475,8 +2475,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current y coordinate of the components origin. * This method is preferable to writing - * component.getBounds().y, - * or component.getLocation().y because it + * {@code component.getBounds().y}, + * or {@code component.getLocation().y} because it * doesn't cause any heap allocations. * * @return the current y coordinate of the components origin @@ -2490,8 +2490,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current width of this component. * This method is preferable to writing - * component.getBounds().width, - * or component.getSize().width because it + * {@code component.getBounds().width}, + * or {@code component.getSize().width} because it * doesn't cause any heap allocations. * * @return the current width of this component @@ -2505,8 +2505,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the current height of this component. * This method is preferable to writing - * component.getBounds().height, - * or component.getSize().height because it + * {@code component.getBounds().height}, + * or {@code component.getSize().height} because it * doesn't cause any heap allocations. * * @return the current height of this component @@ -2518,10 +2518,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Stores the bounds of this component into "return value" rv and - * return rv. If rv is null a new - * Rectangle is allocated. - * This version of getBounds is useful if the caller - * wants to avoid allocating a new Rectangle object + * return rv. If rv is {@code null} a new + * {@code Rectangle} is allocated. + * This version of {@code getBounds} is useful if the caller + * wants to avoid allocating a new {@code Rectangle} object * on the heap. * * @param rv the return value, modified to the components bounds @@ -2539,10 +2539,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Stores the width/height of this component into "return value" rv - * and return rv. If rv is null a new - * Dimension object is allocated. This version of - * getSize is useful if the caller wants to avoid - * allocating a new Dimension object on the heap. + * and return rv. If rv is {@code null} a new + * {@code Dimension} object is allocated. This version of + * {@code getSize} is useful if the caller wants to avoid + * allocating a new {@code Dimension} object on the heap. * * @param rv the return value, modified to the components size * @return rv @@ -2559,10 +2559,10 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Stores the x,y origin of this component into "return value" rv - * and return rv. If rv is null a new - * Point is allocated. - * This version of getLocation is useful if the - * caller wants to avoid allocating a new Point + * and return rv. If rv is {@code null} a new + * {@code Point} is allocated. + * This version of {@code getLocation} is useful if the + * caller wants to avoid allocating a new {@code Point} * object on the heap. * * @param rv the return value, modified to the components location @@ -2607,12 +2607,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * A lightweight component doesn't have a native toolkit peer. - * Subclasses of Component and Container, - * other than the ones defined in this package like Button - * or Scrollbar, are lightweight. + * Subclasses of {@code Component} and {@code Container}, + * other than the ones defined in this package like {@code Button} + * or {@code Scrollbar}, are lightweight. * All of the Swing components are lightweights. *

        - * This method will always return false if this component + * This method will always return {@code false} if this component * is not displayable because it is impossible to determine the * weight of an undisplayable component. * @@ -2628,8 +2628,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the preferred size of this component to a constant - * value. Subsequent calls to getPreferredSize will always - * return this value. Setting the preferred size to null + * value. Subsequent calls to {@code getPreferredSize} will always + * return this value. Setting the preferred size to {@code null} * restores the default behavior. * * @param preferredSize The new preferred size, or null @@ -2656,9 +2656,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns true if the preferred size has been set to a - * non-null value otherwise returns false. + * non-{@code null} value otherwise returns false. * - * @return true if setPreferredSize has been invoked + * @return true if {@code setPreferredSize} has been invoked * with a non-null value. * @since 1.5 */ @@ -2683,7 +2683,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the component's preferred size * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -2704,8 +2704,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the minimum size of this component to a constant - * value. Subsequent calls to getMinimumSize will always - * return this value. Setting the minimum size to null + * value. Subsequent calls to {@code getMinimumSize} will always + * return this value. Setting the minimum size to {@code null} * restores the default behavior. * * @param minimumSize the new minimum size of this component @@ -2730,10 +2730,10 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns whether or not setMinimumSize has been + * Returns whether or not {@code setMinimumSize} has been * invoked with a non-null value. * - * @return true if setMinimumSize has been invoked with a + * @return true if {@code setMinimumSize} has been invoked with a * non-null value. * @since 1.5 */ @@ -2756,7 +2756,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return the minimum size of this component * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -2777,11 +2777,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the maximum size of this component to a constant - * value. Subsequent calls to getMaximumSize will always - * return this value. Setting the maximum size to null + * value. Subsequent calls to {@code getMaximumSize} will always + * return this value. Setting the maximum size to {@code null} * restores the default behavior. * - * @param maximumSize a Dimension containing the + * @param maximumSize a {@code Dimension} containing the * desired maximum allowable size * @see #getMaximumSize * @see #isMaximumSizeSet @@ -2804,10 +2804,10 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns true if the maximum size has been set to a non-null + * Returns true if the maximum size has been set to a non-{@code null} * value otherwise returns false. * - * @return true if maximumSize is non-null, + * @return true if {@code maximumSize} is non-{@code null}, * false otherwise * @since 1.5 */ @@ -2858,16 +2858,16 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the baseline. The baseline is measured from the top of * the component. This method is primarily meant for - * LayoutManagers to align components along their + * {@code LayoutManager}s to align components along their * baseline. A return value less than 0 indicates this component * does not have a reasonable baseline and that - * LayoutManagers should not align this component on + * {@code LayoutManager}s should not align this component on * its baseline. *

        * The default implementation returns -1. Subclasses that support * baseline should override appropriately. If a value >= 0 is * returned, then the component has a valid baseline for any - * size >= the minimum size and getBaselineResizeBehavior + * size >= the minimum size and {@code getBaselineResizeBehavior} * can be used to determine how the baseline changes with size. * * @param width the width to get the baseline for @@ -2893,15 +2893,15 @@ public abstract class Component implements ImageObserver, MenuContainer, * layout managers and GUI builders. *

        * The default implementation returns - * BaselineResizeBehavior.OTHER. Subclasses that have a + * {@code BaselineResizeBehavior.OTHER}. Subclasses that have a * baseline should override appropriately. Subclasses should - * never return null; if the baseline can not be - * calculated return BaselineResizeBehavior.OTHER. Callers + * never return {@code null}; if the baseline can not be + * calculated return {@code BaselineResizeBehavior.OTHER}. Callers * should first ask for the baseline using - * getBaseline and if a value >= 0 is returned use + * {@code getBaseline} and if a value >= 0 is returned use * this method. It is acceptable for this method to return a - * value other than BaselineResizeBehavior.OTHER even if - * getBaseline returns a value less than 0. + * value other than {@code BaselineResizeBehavior.OTHER} even if + * {@code getBaseline} returns a value less than 0. * * @return an enum indicating how the baseline changes as the component * size changes @@ -2925,7 +2925,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @deprecated As of JDK version 1.1, - * replaced by doLayout(). + * replaced by {@code doLayout()}. */ @Deprecated public void layout() { @@ -3074,9 +3074,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Creates a graphics context for this component. This method will - * return null if this component is currently not + * return {@code null} if this component is currently not * displayable. - * @return a graphics context for this component, or null + * @return a graphics context for this component, or {@code null} * if it has none * @see #paint * @since 1.0 @@ -3138,7 +3138,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * {@link Font Font} class. * @param font the font for which font metrics is to be * obtained - * @return the font metrics for font + * @return the font metrics for {@code font} * @see #getFont * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) * @see Toolkit#getFontMetrics(Font) @@ -3161,19 +3161,19 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the cursor image to the specified cursor. This cursor - * image is displayed when the contains method for + * image is displayed when the {@code contains} method for * this component returns true for the current cursor location, and * this Component is visible, displayable, and enabled. Setting the - * cursor of a Container causes that cursor to be displayed + * cursor of a {@code Container} causes that cursor to be displayed * within all of the container's subcomponents, except for those - * that have a non-null cursor. + * that have a non-{@code null} cursor. *

        * The method may have no visual effect if the Java platform * implementation and/or the native system do not support * changing the mouse cursor shape. * @param cursor One of the constants defined - * by the Cursor class; - * if this parameter is null + * by the {@code Cursor} class; + * if this parameter is {@code null} * then this component will inherit * the cursor of its parent * @see #isEnabled @@ -3213,7 +3213,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the cursor set in the component. If the component does * not have a cursor set, the cursor of its parent is returned. * If no cursor is set in the entire hierarchy, - * Cursor.DEFAULT_CURSOR is returned. + * {@code Cursor.DEFAULT_CURSOR} is returned. * * @return the cursor for this component * @see #setCursor @@ -3238,11 +3238,11 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the cursor has been explicitly set for this Component. - * If this method returns false, this Component is inheriting + * If this method returns {@code false}, this Component is inheriting * its cursor from an ancestor. * - * @return true if the cursor has been explicitly set for this - * Component; false otherwise. + * @return {@code true} if the cursor has been explicitly set for this + * Component; {@code false} otherwise. * @since 1.4 */ public boolean isCursorSet() { @@ -3255,12 +3255,12 @@ public abstract class Component implements ImageObserver, MenuContainer, * This method is called when the contents of the component should * be painted; such as when the component is first being shown or * is damaged and in need of repair. The clip rectangle in the - * Graphics parameter is set to the area + * {@code Graphics} parameter is set to the area * which needs to be painted. - * Subclasses of Component that override this - * method need not call super.paint(g). + * Subclasses of {@code Component} that override this + * method need not call {@code super.paint(g)}. *

        - * For performance reasons, Components with zero width + * For performance reasons, {@code Component}s with zero width * or height aren't considered to need painting when they are first shown, * and also aren't considered to need repair. *

        @@ -3280,21 +3280,21 @@ public abstract class Component implements ImageObserver, MenuContainer, * Updates this component. *

        * If this component is not a lightweight component, the - * AWT calls the update method in response to - * a call to repaint. You can assume that + * AWT calls the {@code update} method in response to + * a call to {@code repaint}. You can assume that * the background is not cleared. *

        - * The update method of Component - * calls this component's paint method to redraw + * The {@code update} method of {@code Component} + * calls this component's {@code paint} method to redraw * this component. This method is commonly overridden by subclasses * which need to do additional work in response to a call to - * repaint. + * {@code repaint}. * Subclasses of Component that override this method should either - * call super.update(g), or call paint(g) - * directly from their update method. + * call {@code super.update(g)}, or call {@code paint(g)} + * directly from their {@code update} method. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @@ -3317,7 +3317,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Paints this component and all of its subcomponents. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @@ -3355,9 +3355,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Repaints this component. *

        * If this component is a lightweight component, this method - * causes a call to this component's paint + * causes a call to this component's {@code paint} * method as soon as possible. Otherwise, this method causes - * a call to this component's update method as soon + * a call to this component's {@code update} method as soon * as possible. *

        * Note: For more information on the paint mechanisms utilitized @@ -3375,8 +3375,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Repaints the component. If this component is a lightweight - * component, this results in a call to paint - * within tm milliseconds. + * component, this results in a call to {@code paint} + * within {@code tm} milliseconds. *

        * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most @@ -3396,9 +3396,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Repaints the specified rectangle of this component. *

        * If this component is a lightweight component, this method - * causes a call to this component's paint method + * causes a call to this component's {@code paint} method * as soon as possible. Otherwise, this method causes a call to - * this component's update method as soon as possible. + * this component's {@code update} method as soon as possible. *

        * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most @@ -3418,12 +3418,12 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Repaints the specified rectangle of this component within - * tm milliseconds. + * {@code tm} milliseconds. *

        * If this component is a lightweight component, this method causes - * a call to this component's paint method. + * a call to this component's {@code paint} method. * Otherwise, this method causes a call to this component's - * update method. + * {@code update} method. *

        * Note: For more information on the paint mechanisms utilitized * by AWT and Swing, including information on how to write the most @@ -3481,10 +3481,10 @@ public abstract class Component implements ImageObserver, MenuContainer, * printed or should be printed differently than they are painted. *

        * The default implementation of this method calls the - * paint method. + * {@code paint} method. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @param g the graphics context to use for printing @@ -3499,7 +3499,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Prints this component and all of its subcomponents. *

        * The origin of the graphics context, its - * (00) coordinate point, is the + * ({@code 0}, {@code 0}) coordinate point, is the * top-left corner of this component. The clipping region of the * graphics context is the bounding rectangle of this component. * @param g the graphics context to use for printing @@ -3542,41 +3542,41 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Repaints the component when the image has changed. - * This imageUpdate method of an ImageObserver + * This {@code imageUpdate} method of an {@code ImageObserver} * is called when more information about an * image which had been previously requested using an asynchronous - * routine such as the drawImage method of - * Graphics becomes available. - * See the definition of imageUpdate for + * routine such as the {@code drawImage} method of + * {@code Graphics} becomes available. + * See the definition of {@code imageUpdate} for * more information on this method and its arguments. *

        - * The imageUpdate method of Component + * The {@code imageUpdate} method of {@code Component} * incrementally draws an image on the component as more of the bits * of the image are available. *

        - * If the system property awt.image.incrementaldraw - * is missing or has the value true, the image is + * If the system property {@code awt.image.incrementaldraw} + * is missing or has the value {@code true}, the image is * incrementally drawn. If the system property has any other value, * then the image is not drawn until it has been completely loaded. *

        * Also, if incremental drawing is in effect, the value of the - * system property awt.image.redrawrate is interpreted + * system property {@code awt.image.redrawrate} is interpreted * as an integer to give the maximum redraw rate, in milliseconds. If * the system property is missing or cannot be interpreted as an * integer, the redraw rate is once every 100ms. *

        - * The interpretation of the x, y, - * width, and height arguments depends on - * the value of the infoflags argument. + * The interpretation of the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments depends on + * the value of the {@code infoflags} argument. * * @param img the image being observed - * @param infoflags see imageUpdate for more information + * @param infoflags see {@code imageUpdate} for more information * @param x the x coordinate * @param y the y coordinate * @param w the width * @param h the height - * @return false if the infoflags indicate that the - * image is completely loaded; true otherwise. + * @return {@code false} if the infoflags indicate that the + * image is completely loaded; {@code true} otherwise. * * @see java.awt.image.ImageObserver * @see Graphics#drawImage(Image, int, int, Color, java.awt.image.ImageObserver) @@ -3699,12 +3699,12 @@ public abstract class Component implements ImageObserver, MenuContainer, * Prepares an image for rendering on this component. The image * data is downloaded asynchronously in another thread and the * appropriate screen representation of the image is generated. - * @param image the Image for which to + * @param image the {@code Image} for which to * prepare a screen representation - * @param observer the ImageObserver object + * @param observer the {@code ImageObserver} object * to be notified as the image is being prepared - * @return true if the image has already been fully - * prepared; false otherwise + * @return {@code true} if the image has already been fully + * prepared; {@code false} otherwise * @since 1.0 */ public boolean prepareImage(Image image, ImageObserver observer) { @@ -3718,14 +3718,14 @@ public abstract class Component implements ImageObserver, MenuContainer, * The image data is downloaded asynchronously in another thread, * and an appropriately scaled screen representation of the image is * generated. - * @param image the instance of Image + * @param image the instance of {@code Image} * for which to prepare a screen representation * @param width the width of the desired screen representation * @param height the height of the desired screen representation - * @param observer the ImageObserver object + * @param observer the {@code ImageObserver} object * to be notified as the image is being prepared - * @return true if the image has already been fully - * prepared; false otherwise + * @return {@code true} if the image has already been fully + * prepared; {@code false} otherwise * @see java.awt.image.ImageObserver * @since 1.0 */ @@ -3748,17 +3748,17 @@ public abstract class Component implements ImageObserver, MenuContainer, * of the specified image. *

        * This method does not cause the image to begin loading. An - * application must use the prepareImage method + * application must use the {@code prepareImage} method * to force the loading of an image. *

        * Information on the flags returned by this method can be found - * with the discussion of the ImageObserver interface. - * @param image the Image object whose status + * with the discussion of the {@code ImageObserver} interface. + * @param image the {@code Image} object whose status * is being checked - * @param observer the ImageObserver + * @param observer the {@code ImageObserver} * object to be notified as the image is being prepared * @return the bitwise inclusive OR of - * ImageObserver flags indicating what + * {@code ImageObserver} flags indicating what * information about the image is currently available * @see #prepareImage(Image, int, int, java.awt.image.ImageObserver) * @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver) @@ -3774,27 +3774,27 @@ public abstract class Component implements ImageObserver, MenuContainer, * of the specified image. *

        * This method does not cause the image to begin loading. An - * application must use the prepareImage method + * application must use the {@code prepareImage} method * to force the loading of an image. *

        - * The checkImage method of Component - * calls its peer's checkImage method to calculate + * The {@code checkImage} method of {@code Component} + * calls its peer's {@code checkImage} method to calculate * the flags. If this component does not yet have a peer, the - * component's toolkit's checkImage method is called + * component's toolkit's {@code checkImage} method is called * instead. *

        * Information on the flags returned by this method can be found - * with the discussion of the ImageObserver interface. - * @param image the Image object whose status + * with the discussion of the {@code ImageObserver} interface. + * @param image the {@code Image} object whose status * is being checked * @param width the width of the scaled version * whose status is to be checked * @param height the height of the scaled version * whose status is to be checked - * @param observer the ImageObserver object + * @param observer the {@code ImageObserver} object * to be notified as the image is being prepared * @return the bitwise inclusive OR of - * ImageObserver flags indicating what + * {@code ImageObserver} flags indicating what * information about the image is currently available * @see #prepareImage(Image, int, int, java.awt.image.ImageObserver) * @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver) @@ -3819,7 +3819,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Creates a new strategy for multi-buffering on this component. * Multi-buffering is useful for rendering performance. This method * attempts to create the best strategy available with the number of - * buffers supplied. It will always create a BufferStrategy + * buffers supplied. It will always create a {@code BufferStrategy} * with that number of buffers. * A page-flipping strategy is attempted first, then a blitting strategy * using accelerated buffers. Finally, an unaccelerated blitting @@ -3880,17 +3880,17 @@ public abstract class Component implements ImageObserver, MenuContainer, * buffer capabilities). *

        * Each time this method - * is called, dispose will be invoked on the existing - * BufferStrategy. + * is called, {@code dispose} will be invoked on the existing + * {@code BufferStrategy}. * @param numBuffers number of buffers to create * @param caps the required capabilities for creating the buffer strategy; - * cannot be null + * cannot be {@code null} * @exception AWTException if the capabilities supplied could not be * supported or met; this may happen, for example, if there is not enough * accelerated memory currently available, or if page flipping is specified * but not possible. * @exception IllegalArgumentException if numBuffers is less than 1, or if - * caps is null + * caps is {@code null} * @see Window#getBufferStrategy() * @see Canvas#getBufferStrategy() * @since 1.4 @@ -3975,7 +3975,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Inner class for flipping buffers on a component. That component must - * be a Canvas or Window or Applet. + * be a {@code Canvas} or {@code Window} or {@code Applet}. * @see Canvas * @see Window * @see Applet @@ -4026,8 +4026,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Creates a new flipping buffer strategy for this component. - * The component must be a Canvas or Window or - * Applet. + * The component must be a {@code Canvas} or {@code Window} or + * {@code Applet}. * @see Canvas * @see Window * @see Applet @@ -4064,14 +4064,14 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param numBuffers number of buffers to create; must be greater than * one * @param caps the capabilities of the buffers. - * BufferCapabilities.isPageFlipping must be - * true. + * {@code BufferCapabilities.isPageFlipping} must be + * {@code true}. * @exception AWTException if the capabilities supplied could not be * supported or met * @exception IllegalStateException if the component has no peer * @exception IllegalArgumentException if numBuffers is less than two, - * or if BufferCapabilities.isPageFlipping is not - * true. + * or if {@code BufferCapabilities.isPageFlipping} is not + * {@code true}. * @see java.awt.BufferCapabilities#isPageFlipping() */ protected void createBuffers(int numBuffers, BufferCapabilities caps) @@ -4152,7 +4152,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * either by copying or by moving the video pointer. * @param flipAction an integer value describing the flipping action * for the contents of the back buffer. This should be one of the - * values of the BufferCapabilities.FlipContents + * values of the {@code BufferCapabilities.FlipContents} * property. * @exception IllegalStateException if the buffers have not yet * been created @@ -4266,7 +4266,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @return whether the drawing buffer was lost since the last call to - * getDrawGraphics + * {@code getDrawGraphics} */ public boolean contentsLost() { if (drawVBuffer == null) { @@ -4553,7 +4553,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @return whether the drawing buffer was lost since the last call to - * getDrawGraphics + * {@code getDrawGraphics} */ public boolean contentsLost() { if (backBuffers == null) { @@ -4632,7 +4632,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Inner class for flipping buffers on a component. That component must - * be a Canvas or Window. + * be a {@code Canvas} or {@code Window}. * @see Canvas * @see Window * @see java.awt.image.BufferStrategy @@ -4700,7 +4700,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Checks whether this component "contains" the specified point, - * where x and y are defined to be + * where {@code x} and {@code y} are defined to be * relative to the coordinate system of this component. * * @param x the x coordinate of the point @@ -4753,15 +4753,15 @@ public abstract class Component implements ImageObserver, MenuContainer, * inside a subcomponent that itself has subcomponents, it does not * go looking down the subcomponent tree. *

        - * The locate method of Component simply + * The {@code locate} method of {@code Component} simply * returns the component itself if the (xy) - * coordinate location is inside its bounding box, and null + * coordinate location is inside its bounding box, and {@code null} * otherwise. * @param x the x coordinate * @param y the y coordinate * @return the component or subcomponent that contains the * (xy) location; - * null if the location + * {@code null} if the location * is outside this component * @see #contains(int, int) * @since 1.0 @@ -4801,7 +4801,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * @param e the event to deliver * @deprecated As of JDK version 1.1, - * replaced by dispatchEvent(AWTEvent e). + * replaced by {@code dispatchEvent(AWTEvent e)}. */ @Deprecated public void deliverEvent(Event e) { @@ -4810,8 +4810,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Dispatches an event to this component or one of its sub components. - * Calls processEvent before returning for 1.1-style - * events which have been enabled for the Component. + * Calls {@code processEvent} before returning for 1.1-style + * events which have been enabled for the {@code Component}. * @param e the event */ public final void dispatchEvent(AWTEvent e) { @@ -5279,7 +5279,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified component listener to receive component events from * this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5304,7 +5304,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives component events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5326,7 +5326,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the component listeners * registered on this component. * - * @return all ComponentListeners of this component + * @return all {@code ComponentListener}s of this component * or an empty array if no component * listeners are currently registered * @@ -5341,7 +5341,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified focus listener to receive focus events from * this component when this component gains input focus. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5372,7 +5372,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives focus events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5395,7 +5395,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the focus listeners * registered on this component. * - * @return all of this component's FocusListeners + * @return all of this component's {@code FocusListener}s * or an empty array if no component * listeners are currently registered * @@ -5411,7 +5411,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Adds the specified hierarchy listener to receive hierarchy changed * events from this component when the hierarchy to which this container * belongs changes. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5449,7 +5449,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives hierarchy changed events from this component. This method * performs no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5486,7 +5486,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the hierarchy listeners * registered on this component. * - * @return all of this component's HierarchyListeners + * @return all of this component's {@code HierarchyListener}s * or an empty array if no hierarchy * listeners are currently registered * @@ -5502,7 +5502,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Adds the specified hierarchy bounds listener to receive hierarchy * bounds events from this component when the hierarchy to which this * container belongs changes. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5542,7 +5542,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives hierarchy bounds events from this component. This method * performs no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5648,7 +5648,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the hierarchy bounds listeners * registered on this component. * - * @return all of this component's HierarchyBoundsListeners + * @return all of this component's {@code HierarchyBoundsListener}s * or an empty array if no hierarchy bounds * listeners are currently registered * @@ -5704,7 +5704,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives key events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5727,7 +5727,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the key listeners * registered on this component. * - * @return all of this component's KeyListeners + * @return all of this component's {@code KeyListener}s * or an empty array if no key * listeners are currently registered * @@ -5742,7 +5742,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified mouse listener to receive mouse events from * this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5773,7 +5773,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives mouse events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5796,7 +5796,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the mouse listeners * registered on this component. * - * @return all of this component's MouseListeners + * @return all of this component's {@code MouseListener}s * or an empty array if no mouse * listeners are currently registered * @@ -5811,7 +5811,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Adds the specified mouse motion listener to receive mouse motion * events from this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5842,7 +5842,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives mouse motion events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5865,7 +5865,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the mouse motion listeners * registered on this component. * - * @return all of this component's MouseMotionListeners + * @return all of this component's {@code MouseMotionListener}s * or an empty array if no mouse motion * listeners are currently registered * @@ -5885,7 +5885,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * For information on how mouse wheel events are dispatched, see * the class description for {@link MouseWheelEvent}. *

        - * If l is null, no exception is thrown and no + * If l is {@code null}, no exception is thrown and no * action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5938,7 +5938,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the mouse wheel listeners * registered on this component. * - * @return all of this component's MouseWheelListeners + * @return all of this component's {@code MouseWheelListener}s * or an empty array if no mouse wheel * listeners are currently registered * @@ -5954,9 +5954,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * Adds the specified input method listener to receive * input method events from this component. A component will * only receive input method events from input methods - * if it also overrides getInputMethodRequests to return an - * InputMethodRequests instance. - * If listener l is null, + * if it also overrides {@code getInputMethodRequests} to return an + * {@code InputMethodRequests} instance. + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -5982,7 +5982,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * receives input method events from this component. This method performs * no function, nor does it throw an exception, if the listener * specified by the argument was not previously added to this component. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -6005,7 +6005,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the input method listeners * registered on this component. * - * @return all of this component's InputMethodListeners + * @return all of this component's {@code InputMethodListener}s * or an empty array if no input method * listeners are currently registered * @@ -6020,16 +6020,16 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Component. + * upon this {@code Component}. * FooListeners are registered using the * addFooListener method. * *

        - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Component c + * {@code Component c} * for its mouse listeners with the following code: * *

        MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));
        @@ -6039,13 +6039,13 @@ public abstract class Component implements ImageObserver, MenuContainer, * @param the type of the listeners * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this component, * or an empty array if no such listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * @throws NullPointerException if {@code listenerType} is {@code null} * @see #getComponentListeners * @see #getFocusListeners @@ -6091,11 +6091,11 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the input method request handler which supports * requests from input methods for this component. A component * that supports on-the-spot text input must override this - * method to return an InputMethodRequests instance. + * method to return an {@code InputMethodRequests} instance. * At the same time, it also has to handle input method events. * * @return the input method request handler for this component, - * null by default + * {@code null} by default * @see #addInputMethodListener * @since 1.2 */ @@ -6111,7 +6111,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * override this to return a private input context. * * @return the input context used by this component; - * null if no context can be determined + * {@code null} if no context can be determined * @since 1.2 */ public InputContext getInputContext() { @@ -6131,8 +6131,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * that event type is added to the component. *

        * This method only needs to be invoked by subclasses of - * Component which desire to have the specified event - * types delivered to processEvent regardless of whether + * {@code Component} which desire to have the specified event + * types delivered to {@code processEvent} regardless of whether * or not a listener is registered. * @param eventsToEnable the event mask defining the event types * @see #processEvent @@ -6304,28 +6304,28 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Potentially coalesce an event being posted with an existing - * event. This method is called by EventQueue.postEvent + * event. This method is called by {@code EventQueue.postEvent} * if an event with the same ID as the event to be posted is found in * the queue (both events must have this component as their source). * This method either returns a coalesced event which replaces * the existing event (and the new event is then discarded), or - * null to indicate that no combining should be done + * {@code null} to indicate that no combining should be done * (add the second event to the end of the queue). Either event * parameter may be modified and returned, as the other one is discarded - * unless null is returned. + * unless {@code null} is returned. *

        - * This implementation of coalesceEvents coalesces + * This implementation of {@code coalesceEvents} coalesces * two event types: mouse move (and drag) events, * and paint (and update) events. * For mouse move events the last event is always returned, causing * intermediate moves to be discarded. For paint events, the new - * event is coalesced into a complex RepaintArea in the peer. - * The new AWTEvent is always returned. + * event is coalesced into a complex {@code RepaintArea} in the peer. + * The new {@code AWTEvent} is always returned. * - * @param existingEvent the event already on the EventQueue + * @param existingEvent the event already on the {@code EventQueue} * @param newEvent the event being posted to the - * EventQueue - * @return a coalesced event, or null indicating that no + * {@code EventQueue} + * @return a coalesced event, or {@code null} indicating that no * coalescing was done */ protected AWTEvent coalesceEvents(AWTEvent existingEvent, @@ -6338,7 +6338,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * method calls the appropriate * process<event type>Event * method for the given class of event. - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6398,17 +6398,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes component events occurring on this component by * dispatching them to any registered - * ComponentListener objects. + * {@code ComponentListener} objects. *

        * This method is not called unless component events are * enabled for this component. Component events are enabled * when one of the following occurs: *

          - *
        • A ComponentListener object is registered - * via addComponentListener. - *
        • Component events are enabled via enableEvents. + *
        • A {@code ComponentListener} object is registered + * via {@code addComponentListener}. + *
        • Component events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6443,33 +6443,33 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes focus events occurring on this component by * dispatching them to any registered - * FocusListener objects. + * {@code FocusListener} objects. *

        * This method is not called unless focus events are * enabled for this component. Focus events are enabled * when one of the following occurs: *

          - *
        • A FocusListener object is registered - * via addFocusListener. - *
        • Focus events are enabled via enableEvents. + *
        • A {@code FocusListener} object is registered + * via {@code addFocusListener}. + *
        • Focus events are enabled via {@code enableEvents}. *
        *

        - * If focus events are enabled for a Component, - * the current KeyboardFocusManager determines + * If focus events are enabled for a {@code Component}, + * the current {@code KeyboardFocusManager} determines * whether or not a focus event should be dispatched to - * registered FocusListener objects. If the - * events are to be dispatched, the KeyboardFocusManager - * calls the Component's dispatchEvent - * method, which results in a call to the Component's - * processFocusEvent method. + * registered {@code FocusListener} objects. If the + * events are to be dispatched, the {@code KeyboardFocusManager} + * calls the {@code Component}'s {@code dispatchEvent} + * method, which results in a call to the {@code Component}'s + * {@code processFocusEvent} method. *

        - * If focus events are enabled for a Component, calling - * the Component's dispatchEvent method - * with a FocusEvent as the argument will result in a - * call to the Component's processFocusEvent - * method regardless of the current KeyboardFocusManager. + * If focus events are enabled for a {@code Component}, calling + * the {@code Component}'s {@code dispatchEvent} method + * with a {@code FocusEvent} as the argument will result in a + * call to the {@code Component}'s {@code processFocusEvent} + * method regardless of the current {@code KeyboardFocusManager}. * - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6500,39 +6500,39 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes key events occurring on this component by * dispatching them to any registered - * KeyListener objects. + * {@code KeyListener} objects. *

        * This method is not called unless key events are * enabled for this component. Key events are enabled * when one of the following occurs: *

          - *
        • A KeyListener object is registered - * via addKeyListener. - *
        • Key events are enabled via enableEvents. + *
        • A {@code KeyListener} object is registered + * via {@code addKeyListener}. + *
        • Key events are enabled via {@code enableEvents}. *
        * *

        - * If key events are enabled for a Component, - * the current KeyboardFocusManager determines + * If key events are enabled for a {@code Component}, + * the current {@code KeyboardFocusManager} determines * whether or not a key event should be dispatched to - * registered KeyListener objects. The - * DefaultKeyboardFocusManager will not dispatch - * key events to a Component that is not the focus + * registered {@code KeyListener} objects. The + * {@code DefaultKeyboardFocusManager} will not dispatch + * key events to a {@code Component} that is not the focus * owner or is not showing. *

        - * As of J2SE 1.4, KeyEvents are redirected to + * As of J2SE 1.4, {@code KeyEvent}s are redirected to * the focus owner. Please see the * Focus Specification * for further information. *

        - * Calling a Component's dispatchEvent - * method with a KeyEvent as the argument will - * result in a call to the Component's - * processKeyEvent method regardless of the - * current KeyboardFocusManager as long as the + * Calling a {@code Component}'s {@code dispatchEvent} + * method with a {@code KeyEvent} as the argument will + * result in a call to the {@code Component}'s + * {@code processKeyEvent} method regardless of the + * current {@code KeyboardFocusManager} as long as the * component is showing, focused, and enabled, and key events * are enabled on it. - *

        If the event parameter is null + *

        If the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6569,17 +6569,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes mouse events occurring on this component by * dispatching them to any registered - * MouseListener objects. + * {@code MouseListener} objects. *

        * This method is not called unless mouse events are * enabled for this component. Mouse events are enabled * when one of the following occurs: *

          - *
        • A MouseListener object is registered - * via addMouseListener. - *
        • Mouse events are enabled via enableEvents. + *
        • A {@code MouseListener} object is registered + * via {@code addMouseListener}. + *
        • Mouse events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6617,17 +6617,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes mouse motion events occurring on this component by * dispatching them to any registered - * MouseMotionListener objects. + * {@code MouseMotionListener} objects. *

        * This method is not called unless mouse motion events are * enabled for this component. Mouse motion events are enabled * when one of the following occurs: *

          - *
        • A MouseMotionListener object is registered - * via addMouseMotionListener. - *
        • Mouse motion events are enabled via enableEvents. + *
        • A {@code MouseMotionListener} object is registered + * via {@code addMouseMotionListener}. + *
        • Mouse motion events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6656,21 +6656,21 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes mouse wheel events occurring on this component by * dispatching them to any registered - * MouseWheelListener objects. + * {@code MouseWheelListener} objects. *

        * This method is not called unless mouse wheel events are * enabled for this component. Mouse wheel events are enabled * when one of the following occurs: *

          - *
        • A MouseWheelListener object is registered - * via addMouseWheelListener. - *
        • Mouse wheel events are enabled via enableEvents. + *
        • A {@code MouseWheelListener} object is registered + * via {@code addMouseWheelListener}. + *
        • Mouse wheel events are enabled via {@code enableEvents}. *
        *

        * For information on how mouse wheel events are dispatched, see * the class description for {@link MouseWheelEvent}. *

        - * Note that if the event parameter is null + * Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6700,17 +6700,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes input method events occurring on this component by * dispatching them to any registered - * InputMethodListener objects. + * {@code InputMethodListener} objects. *

        * This method is not called unless input method events * are enabled for this component. Input method events are enabled * when one of the following occurs: *

          - *
        • An InputMethodListener object is registered - * via addInputMethodListener. - *
        • Input method events are enabled via enableEvents. + *
        • An {@code InputMethodListener} object is registered + * via {@code addInputMethodListener}. + *
        • Input method events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6739,17 +6739,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes hierarchy events occurring on this component by * dispatching them to any registered - * HierarchyListener objects. + * {@code HierarchyListener} objects. *

        * This method is not called unless hierarchy events * are enabled for this component. Hierarchy events are enabled * when one of the following occurs: *

          - *
        • An HierarchyListener object is registered - * via addHierarchyListener. - *
        • Hierarchy events are enabled via enableEvents. + *
        • An {@code HierarchyListener} object is registered + * via {@code addHierarchyListener}. + *
        • Hierarchy events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6775,17 +6775,17 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Processes hierarchy bounds events occurring on this component by * dispatching them to any registered - * HierarchyBoundsListener objects. + * {@code HierarchyBoundsListener} objects. *

        * This method is not called unless hierarchy bounds events * are enabled for this component. Hierarchy bounds events are enabled * when one of the following occurs: *

          - *
        • An HierarchyBoundsListener object is registered - * via addHierarchyBoundsListener. - *
        • Hierarchy bounds events are enabled via enableEvents. + *
        • An {@code HierarchyBoundsListener} object is registered + * via {@code addHierarchyBoundsListener}. + *
        • Hierarchy bounds events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -6972,7 +6972,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Makes this Component displayable by connecting it to a + * Makes this {@code Component} displayable by connecting it to a * native screen resource. * This method is called internally by the toolkit and should * not be called directly by programs. @@ -7076,12 +7076,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Makes this Component undisplayable by destroying it native + * Makes this {@code Component} undisplayable by destroying it native * screen resource. *

        * This method is called by the toolkit internally and should * not be called directly by programs. Code overriding - * this method should call super.removeNotify as + * this method should call {@code super.removeNotify} as * the first line of the overriding method. * * @see #isDisplayable @@ -7193,14 +7193,14 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns whether this Component can become the focus + * Returns whether this {@code Component} can become the focus * owner. * - * @return true if this Component is - * focusable; false otherwise + * @return {@code true} if this {@code Component} is + * focusable; {@code false} otherwise * @see #setFocusable * @since 1.1 - * @deprecated As of 1.4, replaced by isFocusable(). + * @deprecated As of 1.4, replaced by {@code isFocusable()}. */ @Deprecated public boolean isFocusTraversable() { @@ -7213,8 +7213,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether this Component can be focused. * - * @return true if this Component is focusable; - * false otherwise. + * @return {@code true} if this Component is focusable; + * {@code false} otherwise. * @see #setFocusable * @since 1.4 */ @@ -7334,7 +7334,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the Set of focus traversal keys for a given traversal operation * for this Component. (See - * setFocusTraversalKeys for a full description of each key.) + * {@code setFocusTraversalKeys} for a full description of each key.) *

        * If a Set of traversal keys has not been explicitly defined for this * Component, then this Component's parent's Set is returned. If no Set @@ -7434,15 +7434,15 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns whether the Set of focus traversal keys for the given focus * traversal operation has been explicitly defined for this Component. If - * this method returns false, this Component is inheriting the + * this method returns {@code false}, this Component is inheriting the * Set from an ancestor, or from the current KeyboardFocusManager. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS - * @return true if the Set of focus traversal keys for the + * @return {@code true} if the Set of focus traversal keys for the * given focus traversal operation has been explicitly defined for - * this Component; false otherwise. + * this Component; {@code false} otherwise. * @throws IllegalArgumentException if id is not one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or @@ -7515,12 +7515,12 @@ public abstract class Component implements ImageObserver, MenuContainer, * Window is later focused by the user. *

        * This method cannot be used to set the focus owner to no Component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner() + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner()} * instead. *

        * Because the focus behavior of this method is platform-dependent, * developers are strongly encouraged to use - * requestFocusInWindow when possible. + * {@code requestFocusInWindow} when possible. * *

        Note: Not all focus transfers result from invoking this method. As * such, a component may receive focus without this or any of the other @@ -7543,9 +7543,9 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Requests that this Component get the input focus, - * and that this Component's top-level ancestor - * become the focused Window. This component must be + * Requests that this {@code Component} get the input focus, + * and that this {@code Component}'s top-level ancestor + * become the focused {@code Window}. This component must be * displayable, focusable, visible and all of its ancestors (with * the exception of the top-level Window) must be visible for the * request to be granted. Every effort will be made to honor the @@ -7557,29 +7557,29 @@ public abstract class Component implements ImageObserver, MenuContainer, * will be remembered and will be granted when the window is later * focused by the user. *

        - * This method returns a boolean value. If false is returned, - * the request is guaranteed to fail. If true is + * This method returns a boolean value. If {@code false} is returned, + * the request is guaranteed to fail. If {@code true} is * returned, the request will succeed unless it is vetoed, or an * extraordinary event, such as disposal of the component's peer, occurs * before the request can be granted by the native windowing system. Again, - * while a return value of true indicates that the request is + * while a return value of {@code true} indicates that the request is * likely to succeed, developers must never assume that this component is * the focus owner until this component receives a FOCUS_GAINED event. *

        * This method cannot be used to set the focus owner to no component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner} * instead. *

        * Because the focus behavior of this method is platform-dependent, * developers are strongly encouraged to use - * requestFocusInWindow when possible. + * {@code requestFocusInWindow} when possible. *

        - * Every effort will be made to ensure that FocusEvents + * Every effort will be made to ensure that {@code FocusEvent}s * generated as a * result of this request will have the specified temporary value. However, * because specifying an arbitrary temporary state may not be implementable * on all native windowing systems, correct behavior for this method can be - * guaranteed only for lightweight Components. + * guaranteed only for lightweight {@code Component}s. * This method is not intended * for general use, but exists instead as a hook for lightweight component * libraries, such as Swing. @@ -7592,8 +7592,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * such as when the window loses the focus; for * more information on temporary focus changes see the *Focus Specification - * @return false if the focus change request is guaranteed to - * fail; true if it is likely to succeed + * @return {@code false} if the focus change request is guaranteed to + * fail; {@code true} if it is likely to succeed * @see java.awt.event.FocusEvent * @see #addFocusListener * @see #isFocusable @@ -7619,31 +7619,31 @@ public abstract class Component implements ImageObserver, MenuContainer, * assume that this Component is the focus owner until this * Component receives a FOCUS_GAINED event. *

        - * This method returns a boolean value. If false is returned, - * the request is guaranteed to fail. If true is + * This method returns a boolean value. If {@code false} is returned, + * the request is guaranteed to fail. If {@code true} is * returned, the request will succeed unless it is vetoed, or an * extraordinary event, such as disposal of the Component's peer, occurs * before the request can be granted by the native windowing system. Again, - * while a return value of true indicates that the request is + * while a return value of {@code true} indicates that the request is * likely to succeed, developers must never assume that this Component is * the focus owner until this Component receives a FOCUS_GAINED event. *

        * This method cannot be used to set the focus owner to no Component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner() + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner()} * instead. *

        * The focus behavior of this method can be implemented uniformly across * platforms, and thus developers are strongly encouraged to use this - * method over requestFocus when possible. Code which relies - * on requestFocus may exhibit different focus behavior on + * method over {@code requestFocus} when possible. Code which relies + * on {@code requestFocus} may exhibit different focus behavior on * different platforms. * *

        Note: Not all focus transfers result from invoking this method. As * such, a component may receive focus without this or any of the other * {@code requestFocus} methods of {@code Component} being invoked. * - * @return false if the focus change request is guaranteed to - * fail; true if it is likely to succeed + * @return {@code false} if the focus change request is guaranteed to + * fail; {@code true} if it is likely to succeed * @see #requestFocus * @see java.awt.event.FocusEvent * @see #addFocusListener @@ -7661,9 +7661,9 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Requests that this Component get the input focus, - * if this Component's top-level ancestor is already - * the focused Window. This component must be + * Requests that this {@code Component} get the input focus, + * if this {@code Component}'s top-level ancestor is already + * the focused {@code Window}. This component must be * displayable, focusable, visible and all of its ancestors (with * the exception of the top-level Window) must be visible for the * request to be granted. Every effort will be made to honor the @@ -7671,26 +7671,26 @@ public abstract class Component implements ImageObserver, MenuContainer, * so. Developers must never assume that this component is the * focus owner until this component receives a FOCUS_GAINED event. *

        - * This method returns a boolean value. If false is returned, - * the request is guaranteed to fail. If true is + * This method returns a boolean value. If {@code false} is returned, + * the request is guaranteed to fail. If {@code true} is * returned, the request will succeed unless it is vetoed, or an * extraordinary event, such as disposal of the component's peer, occurs * before the request can be granted by the native windowing system. Again, - * while a return value of true indicates that the request is + * while a return value of {@code true} indicates that the request is * likely to succeed, developers must never assume that this component is * the focus owner until this component receives a FOCUS_GAINED event. *

        * This method cannot be used to set the focus owner to no component at - * all. Use KeyboardFocusManager.clearGlobalFocusOwner + * all. Use {@code KeyboardFocusManager.clearGlobalFocusOwner} * instead. *

        * The focus behavior of this method can be implemented uniformly across * platforms, and thus developers are strongly encouraged to use this - * method over requestFocus when possible. Code which relies - * on requestFocus may exhibit different focus behavior on + * method over {@code requestFocus} when possible. Code which relies + * on {@code requestFocus} may exhibit different focus behavior on * different platforms. *

        - * Every effort will be made to ensure that FocusEvents + * Every effort will be made to ensure that {@code FocusEvent}s * generated as a * result of this request will have the specified temporary value. However, * because specifying an arbitrary temporary state may not be implementable @@ -7707,8 +7707,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * such as when the window loses the focus; for * more information on temporary focus changes see the *Focus Specification - * @return false if the focus change request is guaranteed to - * fail; true if it is likely to succeed + * @return {@code false} if the focus change request is guaranteed to + * fail; {@code true} if it is likely to succeed * @see #requestFocus * @see java.awt.event.FocusEvent * @see #addFocusListener @@ -7943,8 +7943,8 @@ public abstract class Component implements ImageObserver, MenuContainer, * belongs to only a single focus traversal cycle. * * @param container the Container to be tested - * @return true if the specified Container is a focus-cycle- - * root of this Component; false otherwise + * @return {@code true} if the specified Container is a focus-cycle- + * root of this Component; {@code false} otherwise * @see Container#isFocusCycleRoot() * @since 1.4 */ @@ -8125,12 +8125,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns true if this Component is the + * Returns {@code true} if this {@code Component} is the * focus owner. This method is obsolete, and has been replaced by - * isFocusOwner(). + * {@code isFocusOwner()}. * - * @return true if this Component is the - * focus owner; false otherwise + * @return {@code true} if this {@code Component} is the + * focus owner; {@code false} otherwise * @since 1.2 */ public boolean hasFocus() { @@ -8139,11 +8139,11 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns true if this Component is the + * Returns {@code true} if this {@code Component} is the * focus owner. * - * @return true if this Component is the - * focus owner; false otherwise + * @return {@code true} if this {@code Component} is the + * focus owner; {@code false} otherwise * @since 1.4 */ public boolean isFocusOwner() { @@ -8222,7 +8222,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return a string representation of this component's state * @since 1.0 @@ -8247,7 +8247,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Prints a listing of this component to the standard system output - * stream System.out. + * stream {@code System.out}. * @see java.lang.System#out * @since 1.0 */ @@ -8342,10 +8342,10 @@ public abstract class Component implements ImageObserver, MenuContainer, *

      • this Component's maximum size ("maximumSize")
      • *
      • this Component's name ("name")
      • *
      - * Note that if this Component is inheriting a bound property, then no + * Note that if this {@code Component} is inheriting a bound property, then no * event will be fired in response to a change in the inherited property. *

      - * If listener is null, + * If {@code listener} is {@code null}, * no exception is thrown and no action is performed. * * @param listener the property change listener to be added @@ -8394,7 +8394,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns an array of all the property change listeners * registered on this component. * - * @return all of this component's PropertyChangeListeners + * @return all of this component's {@code PropertyChangeListener}s * or an empty array if no property change * listeners are currently registered * @@ -8431,10 +8431,10 @@ public abstract class Component implements ImageObserver, MenuContainer, *

    • this Component's Set of UP_CYCLE_TRAVERSAL_KEYS * ("upCycleFocusTraversalKeys")
    • *
    - * Note that if this Component is inheriting a bound property, then no + * Note that if this {@code Component} is inheriting a bound property, then no * event will be fired in response to a change in the inherited property. *

    - * If propertyName or listener is null, + * If {@code propertyName} or {@code listener} is {@code null}, * no exception is thrown and no action is taken. * * @param propertyName one of the property names listed above @@ -8459,12 +8459,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Removes a PropertyChangeListener from the listener + * Removes a {@code PropertyChangeListener} from the listener * list for a specific property. This method should be used to remove - * PropertyChangeListeners + * {@code PropertyChangeListener}s * that were registered for a specific bound property. *

    - * If propertyName or listener is null, + * If {@code propertyName} or {@code listener} is {@code null}, * no exception is thrown and no action is taken. * * @param propertyName a valid property name @@ -8490,9 +8490,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * with the named property. * * @param propertyName the property name - * @return all of the PropertyChangeListeners associated with + * @return all of the {@code PropertyChangeListener}s associated with * the named property; if no such listeners have been added or - * if propertyName is null, an empty + * if {@code propertyName} is {@code null}, an empty * array is returned * * @see #addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) @@ -8693,7 +8693,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * This hack is for Swing serialization. It will invoke - * the Swing package private method compWriteObjectNotify. + * the Swing package private method {@code compWriteObjectNotify}. */ private void doSwingSerialization() { Package swingPackage = Package.getPackage("javax.swing"); @@ -8747,31 +8747,31 @@ public abstract class Component implements ImageObserver, MenuContainer, * The non-serializable listeners are detected and * no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of - * 0 or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of + * 0 or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following (as of 1.4): - * componentListenerK indicating an - * ComponentListener object; - * focusListenerK indicating an - * FocusListener object; - * keyListenerK indicating an - * KeyListener object; - * mouseListenerK indicating an - * MouseListener object; - * mouseMotionListenerK indicating an - * MouseMotionListener object; - * inputMethodListenerK indicating an - * InputMethodListener object; - * hierarchyListenerK indicating an - * HierarchyListener object; - * hierarchyBoundsListenerK indicating an - * HierarchyBoundsListener object; - * mouseWheelListenerK indicating an - * MouseWheelListener object - * @serialData an optional ComponentOrientation - * (after inputMethodListener, as of 1.2) + * {@code componentListenerK} indicating an + * {@code ComponentListener} object; + * {@code focusListenerK} indicating an + * {@code FocusListener} object; + * {@code keyListenerK} indicating an + * {@code KeyListener} object; + * {@code mouseListenerK} indicating an + * {@code MouseListener} object; + * {@code mouseMotionListenerK} indicating an + * {@code MouseMotionListener} object; + * {@code inputMethodListenerK} indicating an + * {@code InputMethodListener} object; + * {@code hierarchyListenerK} indicating an + * {@code HierarchyListener} object; + * {@code hierarchyBoundsListenerK} indicating an + * {@code HierarchyBoundsListener} object; + * {@code mouseWheelListenerK} indicating an + * {@code MouseWheelListener} object + * @serialData an optional {@code ComponentOrientation} + * (after {@code inputMethodListener}, as of 1.2) * * @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener) * @see #componentListenerK @@ -8813,12 +8813,12 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Reads the ObjectInputStream and if it isn't - * null adds a listener to receive a variety + * Reads the {@code ObjectInputStream} and if it isn't + * {@code null} adds a listener to receive a variety * of events fired by the component. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @see #writeObject(ObjectOutputStream) */ private void readObject(ObjectInputStream s) @@ -8960,15 +8960,15 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the language-sensitive orientation that is to be used to order * the elements or text within this component. Language-sensitive - * LayoutManager and Component + * {@code LayoutManager} and {@code Component} * subclasses will use this property to * determine how to lay out and draw components. *

    * At construction time, a component's orientation is set to - * ComponentOrientation.UNKNOWN, + * {@code ComponentOrientation.UNKNOWN}, * indicating that it has not been specified * explicitly. The UNKNOWN orientation behaves the same as - * ComponentOrientation.LEFT_TO_RIGHT. + * {@code ComponentOrientation.LEFT_TO_RIGHT}. *

    * To set the orientation of a single component, use this method. * To set the orientation of an entire component @@ -8999,8 +8999,8 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Retrieves the language-sensitive orientation that is to be used to order - * the elements or text within this component. LayoutManager - * and Component + * the elements or text within this component. {@code LayoutManager} + * and {@code Component} * subclasses that wish to respect orientation should call this method to * get the component's orientation before performing layout or drawing. * @@ -9014,7 +9014,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Sets the ComponentOrientation property of this component + * Sets the {@code ComponentOrientation} property of this component * and all components contained within it. *

    * This method changes layout-related information, and therefore, @@ -9023,7 +9023,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @param orientation the new component orientation of this component and * the components contained within it. - * @exception NullPointerException if orientation is null. + * @exception NullPointerException if {@code orientation} is null. * @see #setComponentOrientation * @see #getComponentOrientation * @see #invalidate @@ -9091,7 +9091,7 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns the Window ancestor of the component. + * Returns the {@code Window} ancestor of the component. * @return Window ancestor of the component or component by itself if it is Window; * null, if component is not a part of window hierarchy */ @@ -9118,16 +9118,16 @@ public abstract class Component implements ImageObserver, MenuContainer, protected AccessibleContext accessibleContext = null; /** - * Gets the AccessibleContext associated - * with this Component. + * Gets the {@code AccessibleContext} associated + * with this {@code Component}. * The method implemented by this base - * class returns null. Classes that extend Component + * class returns null. Classes that extend {@code Component} * should implement this method to return the - * AccessibleContext associated with the subclass. + * {@code AccessibleContext} associated with the subclass. * * - * @return the AccessibleContext of this - * Component + * @return the {@code AccessibleContext} of this + * {@code Component} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -9228,7 +9228,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** - * Adds a PropertyChangeListener to the listener list. + * Adds a {@code PropertyChangeListener} to the listener list. * * @param listener the property change listener to be added */ @@ -9265,7 +9265,7 @@ public abstract class Component implements ImageObserver, MenuContainer, // /** * Gets the accessible name of this object. This should almost never - * return java.awt.Component.getName(), + * return {@code java.awt.Component.getName()}, * as that generally isn't a localized name, * and doesn't have meaning for the user. If the * object is fundamentally a text object (e.g. a menu item), the @@ -9274,7 +9274,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * appropriate String to return. * * @return the localized name of the object -- can be - * null if this + * {@code null} if this * object does not have a name * @see javax.accessibility.AccessibleContext#setAccessibleName */ @@ -9294,7 +9294,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * text document" instead). * * @return the localized description of the object -- can be - * null if this object does not have a description + * {@code null} if this object does not have a description * @see javax.accessibility.AccessibleContext#setAccessibleDescription */ public String getAccessibleDescription() { @@ -9304,7 +9304,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the role of this object. * - * @return an instance of AccessibleRole + * @return an instance of {@code AccessibleRole} * describing the role of the object * @see javax.accessibility.AccessibleRole */ @@ -9315,7 +9315,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the state of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see javax.accessibility.AccessibleState */ @@ -9324,13 +9324,13 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the Accessible parent of this object. - * If the parent of this object implements Accessible, - * this method should simply return getParent. + * Gets the {@code Accessible} parent of this object. + * If the parent of this object implements {@code Accessible}, + * this method should simply return {@code getParent}. * - * @return the Accessible parent of this - * object -- can be null if this - * object does not have an Accessible parent + * @return the {@code Accessible} parent of this + * object -- can be {@code null} if this + * object does not have an {@code Accessible} parent */ public Accessible getAccessibleParent() { if (accessibleParent != null) { @@ -9357,7 +9357,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -9367,10 +9367,10 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child - * @return the nth Accessible child of the object + * @return the nth {@code Accessible} child of the object */ public Accessible getAccessibleChild(int i) { return null; // Components don't have children @@ -9386,9 +9386,9 @@ public abstract class Component implements ImageObserver, MenuContainer, } /** - * Gets the AccessibleComponent associated + * Gets the {@code AccessibleComponent} associated * with this object if one exists. - * Otherwise return null. + * Otherwise return {@code null}. * * @return the component */ @@ -9403,7 +9403,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the background color of this object. * * @return the background color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getBackground() { return Component.this.getBackground(); @@ -9411,9 +9411,9 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the background color of this object. - * (For transparency, see isOpaque.) + * (For transparency, see {@code isOpaque}.) * - * @param c the new Color for the background + * @param c the new {@code Color} for the background * @see Component#isOpaque */ public void setBackground(Color c) { @@ -9424,7 +9424,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Gets the foreground color of this object. * * @return the foreground color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getForeground() { return Component.this.getForeground(); @@ -9433,59 +9433,59 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the foreground color of this object. * - * @param c the new Color for the foreground + * @param c the new {@code Color} for the foreground */ public void setForeground(Color c) { Component.this.setForeground(c); } /** - * Gets the Cursor of this object. + * Gets the {@code Cursor} of this object. * - * @return the Cursor, if supported, - * of the object; otherwise, null + * @return the {@code Cursor}, if supported, + * of the object; otherwise, {@code null} */ public Cursor getCursor() { return Component.this.getCursor(); } /** - * Sets the Cursor of this object. + * Sets the {@code Cursor} of this object. *

    * The method may have no visual effect if the Java platform * implementation and/or the native system do not support * changing the mouse cursor shape. - * @param cursor the new Cursor for the object + * @param cursor the new {@code Cursor} for the object */ public void setCursor(Cursor cursor) { Component.this.setCursor(cursor); } /** - * Gets the Font of this object. + * Gets the {@code Font} of this object. * - * @return the Font, if supported, - * for the object; otherwise, null + * @return the {@code Font}, if supported, + * for the object; otherwise, {@code null} */ public Font getFont() { return Component.this.getFont(); } /** - * Sets the Font of this object. + * Sets the {@code Font} of this object. * - * @param f the new Font for the object + * @param f the new {@code Font} for the object */ public void setFont(Font f) { Component.this.setFont(f); } /** - * Gets the FontMetrics of this object. + * Gets the {@code FontMetrics} of this object. * - * @param f the Font - * @return the FontMetrics, if supported, - * the object; otherwise, null + * @param f the {@code Font} + * @return the {@code FontMetrics}, if supported, + * the object; otherwise, {@code null} * @see #getFont */ public FontMetrics getFontMetrics(Font f) { @@ -9533,7 +9533,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * object intends to be visible; however, it may not in fact be * showing on the screen because one of the objects that this object * is contained by is not visible. To determine if an object is - * showing on the screen, use isShowing. + * showing on the screen, use {@code isShowing}. * * @return true if object is visible; otherwise, false */ @@ -9582,9 +9582,9 @@ public abstract class Component implements ImageObserver, MenuContainer, * where the point's x and y coordinates are defined to be relative to * the coordinate system of the object. * - * @param p the Point relative to the + * @param p the {@code Point} relative to the * coordinate system of the object - * @return true if object contains Point; otherwise false + * @return true if object contains {@code Point}; otherwise false */ public boolean contains(Point p) { return Component.this.contains(p); @@ -9594,7 +9594,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * Returns the location of the object on the screen. * * @return location of object on screen -- can be - * null if this object is not on the screen + * {@code null} if this object is not on the screen */ public Point getLocationOnScreen() { synchronized (Component.this.getTreeLock()) { @@ -9613,7 +9613,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * * @return an instance of Point representing the top-left corner of * the object's bounds in the coordinate space of the screen; - * null if this object or its parent are not on the screen + * {@code null} if this object or its parent are not on the screen */ public Point getLocation() { return Component.this.getLocation(); @@ -9633,7 +9633,7 @@ public abstract class Component implements ImageObserver, MenuContainer, * relative to its parent. * * @return a rectangle indicating this component's bounds; - * null if this object is not on the screen + * {@code null} if this object is not on the screen */ public Rectangle getBounds() { return Component.this.getBounds(); @@ -9641,7 +9641,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Sets the bounds of this object in the form of a - * Rectangle object. + * {@code Rectangle} object. * The bounds specify this object's width, height, and location * relative to its parent. * @@ -9653,13 +9653,13 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Returns the size of this object in the form of a - * Dimension object. The height field of the - * Dimension object contains this object's - * height, and the width field of the Dimension + * {@code Dimension} object. The height field of the + * {@code Dimension} object contains this object's + * height, and the width field of the {@code Dimension} * object contains this object's width. * - * @return a Dimension object that indicates - * the size of this component; null if + * @return a {@code Dimension} object that indicates + * the size of this component; {@code null} if * this object is not on the screen */ public Dimension getSize() { @@ -9669,23 +9669,23 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Resizes this object so that it has width and height. * - * @param d - the dimension specifying the new size of the object + * @param d the dimension specifying the new size of the object */ public void setSize(Dimension d) { Component.this.setSize(d); } /** - * Returns the Accessible child, + * Returns the {@code Accessible} child, * if one exists, contained at the local - * coordinate Point. Otherwise returns - * null. + * coordinate {@code Point}. Otherwise returns + * {@code null}. * * @param p the point defining the top-left corner of - * the Accessible, given in the + * the {@code Accessible}, given in the * coordinate space of the object's parent - * @return the Accessible, if it exists, - * at the specified location; else null + * @return the {@code Accessible}, if it exists, + * at the specified location; else {@code null} */ public Accessible getAccessibleAt(Point p) { return null; // Components don't have children @@ -9759,7 +9759,7 @@ public abstract class Component implements ImageObserver, MenuContainer, /** * Gets the current state set of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see AccessibleState */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java b/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java index 8b67ea0cdde..4df1846a5da 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ComponentOrientation.java @@ -72,8 +72,8 @@ import java.util.ResourceBundle; *

  • TL - Mongolian *
* Components whose view and controller code depends on orientation - * should use the isLeftToRight() and - * isHorizontal() methods to + * should use the {@code isLeftToRight()} and + * {@code isHorizontal()} methods to * determine their behavior. They should not include switch-like * code that keys off of the constants, such as: *
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Composite.java b/jdk/src/java.desktop/share/classes/java/awt/Composite.java
index 4ce58a06daa..d86b73abac3 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Composite.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Composite.java
@@ -28,39 +28,39 @@ package java.awt;
 import java.awt.image.ColorModel;
 
 /**
- * The Composite interface, along with
+ * The {@code Composite} interface, along with
  * {@link CompositeContext}, defines the methods to compose a draw
  * primitive with the underlying graphics area.
- * After the Composite is set in the
+ * After the {@code Composite} is set in the
  * {@link Graphics2D} context, it combines a shape, text, or an image
  * being rendered with the colors that have already been rendered
  * according to pre-defined rules. The classes
  * implementing this interface provide the rules and a method to create
  * the context for a particular operation.
- * CompositeContext is an environment used by the
- * compositing operation, which is created by the Graphics2D
- * prior to the start of the operation.  CompositeContext
+ * {@code CompositeContext} is an environment used by the
+ * compositing operation, which is created by the {@code Graphics2D}
+ * prior to the start of the operation.  {@code CompositeContext}
  * contains private information and resources needed for a compositing
- * operation.  When the CompositeContext is no longer needed,
- * the Graphics2D object disposes of it in order to reclaim
+ * operation.  When the {@code CompositeContext} is no longer needed,
+ * the {@code Graphics2D} object disposes of it in order to reclaim
  * resources allocated for the operation.
  * 

- * Instances of classes implementing Composite must be - * immutable because the Graphics2D does not clone + * Instances of classes implementing {@code Composite} must be + * immutable because the {@code Graphics2D} does not clone * these objects when they are set as an attribute with the - * setComposite method or when the Graphics2D + * {@code setComposite} method or when the {@code Graphics2D} * object is cloned. This is to avoid undefined rendering behavior of - * Graphics2D, resulting from the modification of - * the Composite object after it has been set in the - * Graphics2D context. + * {@code Graphics2D}, resulting from the modification of + * the {@code Composite} object after it has been set in the + * {@code Graphics2D} context. *

* Since this interface must expose the contents of pixels on the * target device or image to potentially arbitrary code, the use of * custom objects which implement this interface when rendering directly - * to a screen device is governed by the readDisplayPixels + * to a screen device is governed by the {@code readDisplayPixels} * {@link AWTPermission}. The permission check will occur when such - * a custom object is passed to the setComposite method - * of a Graphics2D retrieved from a {@link Component}. + * a custom object is passed to the {@code setComposite} method + * of a {@code Graphics2D} retrieved from a {@link Component}. * @see AlphaComposite * @see CompositeContext * @see Graphics2D#setComposite @@ -71,12 +71,12 @@ public interface Composite { * Creates a context containing state that is used to perform * the compositing operation. In a multi-threaded environment, * several contexts can exist simultaneously for a single - * Composite object. + * {@code Composite} object. * @param srcColorModel the {@link ColorModel} of the source - * @param dstColorModel the ColorModel of the destination + * @param dstColorModel the {@code ColorModel} of the destination * @param hints the hint that the context object uses to choose between * rendering alternatives - * @return the CompositeContext object used to perform the + * @return the {@code CompositeContext} object used to perform the * compositing operation. */ public CompositeContext createContext(ColorModel srcColorModel, diff --git a/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java b/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java index 60f2ecd3032..525aee73c28 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/CompositeContext.java @@ -29,9 +29,9 @@ import java.awt.image.Raster; import java.awt.image.WritableRaster; /** - * The CompositeContext interface defines the encapsulated + * The {@code CompositeContext} interface defines the encapsulated * and optimized environment for a compositing operation. - * CompositeContext objects maintain state for + * {@code CompositeContext} objects maintain state for * compositing operations. In a multi-threaded environment, several * contexts can exist simultaneously for a single {@link Composite} * object. @@ -49,14 +49,14 @@ public interface CompositeContext { * places the result in the destination * {@link WritableRaster}. Note that the destination * can be the same object as either the first or second - * source. Note that dstIn and - * dstOut must be compatible with the - * dstColorModel passed to the + * source. Note that {@code dstIn} and + * {@code dstOut} must be compatible with the + * {@code dstColorModel} passed to the * {@link Composite#createContext(java.awt.image.ColorModel, java.awt.image.ColorModel, java.awt.RenderingHints) createContext} - * method of the Composite interface. + * method of the {@code Composite} interface. * @param src the first source for the compositing operation * @param dstIn the second source for the compositing operation - * @param dstOut the WritableRaster into which the + * @param dstOut the {@code WritableRaster} into which the * result of the operation is stored * @see Composite */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Container.java b/jdk/src/java.desktop/share/classes/java/awt/Container.java index f3e7b3b5d6e..a16c2f55d97 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Container.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java @@ -183,7 +183,7 @@ public class Container extends Component { /** * A constant which toggles one of the controllable behaviors - * of getMouseEventTarget. It is used to specify whether + * of {@code getMouseEventTarget}. It is used to specify whether * the method can return the Container on which it is originally called * in case if none of its children are the current mouse event targets. * @@ -193,7 +193,7 @@ public class Container extends Component { /** * A constant which toggles one of the controllable behaviors - * of getMouseEventTarget. It is used to specify whether + * of {@code getMouseEventTarget}. It is used to specify whether * the method should search only lightweight components. * * @see #getMouseEventTarget(int, int, boolean) @@ -384,7 +384,7 @@ public class Container extends Component { * Determines the insets of this container, which indicate the size * of the container's border. *

- * A Frame object, for example, has a top inset that + * A {@code Frame} object, for example, has a top inset that * corresponds to the height of the frame's title bar. * @return the insets of this container. * @see Insets @@ -399,7 +399,7 @@ public class Container extends Component { * Returns the insets for this container. * * @deprecated As of JDK version 1.1, - * replaced by getInsets(). + * replaced by {@code getInsets()}. * @return the insets for this container */ @Deprecated @@ -439,7 +439,7 @@ public class Container extends Component { * This is a convenience method for {@link #addImpl}. *

* This method is obsolete as of 1.1. Please use the - * method add(Component, Object) instead. + * method {@code add(Component, Object)} instead. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -471,11 +471,11 @@ public class Container extends Component { * * @param comp the component to be added * @param index the position at which to insert the component, - * or -1 to append the component to the end + * or {@code -1} to append the component to the end * @exception NullPointerException if {@code comp} is {@code null} * @exception IllegalArgumentException if {@code index} is invalid (see * {@link #addImpl} for details) - * @return the component comp + * @return the component {@code comp} * @see #addImpl * @see #remove * @see #invalidate @@ -532,7 +532,7 @@ public class Container extends Component { if (comp.parent == this) { if (index == component.size()) { throw new IllegalArgumentException("illegal component position " + - index + " should be less then " + component.size()); + index + " should be less than " + component.size()); } } checkAddToSelf(comp); @@ -734,40 +734,40 @@ public class Container extends Component { * If the component is a child of some other container, it is * removed from that container before being added to this container. * The important difference between this method and - * java.awt.Container.add(Component, int) is that this method - * doesn't call removeNotify on the component while + * {@code java.awt.Container.add(Component, int)} is that this method + * doesn't call {@code removeNotify} on the component while * removing it from its previous container unless necessary and when * allowed by the underlying native windowing system. This way, if the * component has the keyboard focus, it maintains the focus when * moved to the new position. *

* This property is guaranteed to apply only to lightweight - * non-Container components. + * non-{@code Container} components. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. *

* Note: Not all platforms support changing the z-order of * heavyweight components from one container into another without - * the call to removeNotify. There is no way to detect + * the call to {@code removeNotify}. There is no way to detect * whether a platform supports this, so developers shouldn't make * any assumptions. * * @param comp the component to be moved * @param index the position in the container's list to - * insert the component, where getComponentCount() + * insert the component, where {@code getComponentCount()} * appends to the end - * @exception NullPointerException if comp is - * null - * @exception IllegalArgumentException if comp is one of the + * @exception NullPointerException if {@code comp} is + * {@code null} + * @exception IllegalArgumentException if {@code comp} is one of the * container's parents - * @exception IllegalArgumentException if index is not in - * the range [0, getComponentCount()] for moving + * @exception IllegalArgumentException if {@code index} is not in + * the range {@code [0, getComponentCount()]} for moving * between containers, or not in the range - * [0, getComponentCount()-1] for moving inside + * {@code [0, getComponentCount()-1]} for moving inside * a container * @exception IllegalArgumentException if adding a container to itself - * @exception IllegalArgumentException if adding a Window + * @exception IllegalArgumentException if adding a {@code Window} * to a container * @see #getComponentZOrder(java.awt.Component) * @see #invalidate @@ -949,7 +949,7 @@ public class Container extends Component { * * @param comp the component being queried * @return the z-order index of the component; otherwise - * returns -1 if the component is null + * returns -1 if the component is {@code null} * or doesn't belong to the container * @see #setComponentZOrder(java.awt.Component, int) * @since 1.5 @@ -1010,7 +1010,7 @@ public class Container extends Component { * @param comp the component to be added * @param constraints an object expressing layout constraints for this * @param index the position in the container's list at which to insert - * the component; -1 means insert at the end + * the component; {@code -1} means insert at the end * component * @exception NullPointerException if {@code comp} is {@code null} * @exception IllegalArgumentException if {@code index} is invalid (see @@ -1030,20 +1030,20 @@ public class Container extends Component { * Adds the specified component to this container at the specified * index. This method also notifies the layout manager to add * the component to this container's layout using the specified - * constraints object via the addLayoutComponent + * constraints object via the {@code addLayoutComponent} * method. *

* The constraints are * defined by the particular layout manager being used. For - * example, the BorderLayout class defines five - * constraints: BorderLayout.NORTH, - * BorderLayout.SOUTH, BorderLayout.EAST, - * BorderLayout.WEST, and BorderLayout.CENTER. + * example, the {@code BorderLayout} class defines five + * constraints: {@code BorderLayout.NORTH}, + * {@code BorderLayout.SOUTH}, {@code BorderLayout.EAST}, + * {@code BorderLayout.WEST}, and {@code BorderLayout.CENTER}. *

- * The GridBagLayout class requires a - * GridBagConstraints object. Failure to pass + * The {@code GridBagLayout} class requires a + * {@code GridBagConstraints} object. Failure to pass * the correct type of constraints object results in an - * IllegalArgumentException. + * {@code IllegalArgumentException}. *

* If the current layout manager implements {@code LayoutManager2}, then * {@link LayoutManager2#addLayoutComponent(Component,Object)} is invoked on @@ -1061,7 +1061,7 @@ public class Container extends Component { * usually include a call to the superclass's version of the method: * *

- * super.addImpl(comp, constraints, index) + * {@code super.addImpl(comp, constraints, index)} *
*

* This method changes layout-related information, and therefore, @@ -1073,7 +1073,7 @@ public class Container extends Component { * @param constraints an object expressing layout constraints * for this component * @param index the position in the container's list at which to - * insert the component, where -1 + * insert the component, where {@code -1} * means append to the end * @exception IllegalArgumentException if {@code index} is invalid; * if {@code comp} is a child of this container, the valid @@ -1196,11 +1196,11 @@ public class Container extends Component { } /** - * Removes the component, specified by index, + * Removes the component, specified by {@code index}, * from this container. * This method also notifies the layout manager to remove the * component from this container's layout via the - * removeLayoutComponent method. + * {@code removeLayoutComponent} method. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -1263,7 +1263,7 @@ public class Container extends Component { * Removes the specified component from this container. * This method also notifies the layout manager to remove the * component from this container's layout via the - * removeLayoutComponent method. + * {@code removeLayoutComponent} method. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -1292,7 +1292,7 @@ public class Container extends Component { * Removes all the components from this container. * This method also notifies the layout manager to remove the * components from this container's layout via the - * removeLayoutComponent method. + * {@code removeLayoutComponent} method. *

* This method changes layout-related information, and therefore, * invalidates the component hierarchy. If the container has already been @@ -1512,7 +1512,7 @@ public class Container extends Component { /** * Causes this container to lay out its components. Most programs * should not call this method directly, but should invoke - * the validate method instead. + * the {@code validate} method instead. * @see LayoutManager#layoutContainer * @see #setLayout * @see #validate @@ -1524,7 +1524,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by doLayout(). + * replaced by {@code doLayout()}. */ @Deprecated public void layout() { @@ -1703,7 +1703,7 @@ public class Container extends Component { * Recursively descends the container tree and recomputes the * layout for any subtrees marked as needing it (those marked as * invalid). Synchronization should be provided by the method - * that calls this one: validate. + * that calls this one: {@code validate}. * * @see #doLayout * @see #validate @@ -1791,7 +1791,7 @@ public class Container extends Component { * this method is invoked, rather the {@code LayoutManager} will only * be queried after the {@code Container} becomes invalid. * - * @return an instance of Dimension that represents + * @return an instance of {@code Dimension} that represents * the preferred size of this container. * @see #getMinimumSize * @see #getMaximumSize @@ -1805,7 +1805,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -1842,7 +1842,7 @@ public class Container extends Component { * this method is invoked, rather the {@code LayoutManager} will only * be queried after the {@code Container} becomes invalid. * - * @return an instance of Dimension that represents + * @return an instance of {@code Dimension} that represents * the minimum size of this container. * @see #getPreferredSize * @see #getMaximumSize @@ -1857,7 +1857,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -1895,7 +1895,7 @@ public class Container extends Component { * this method is invoked, rather the {@code LayoutManager2} will only * be queried after the {@code Container} becomes invalid. * - * @return an instance of Dimension that represents + * @return an instance of {@code Dimension} that represents * the maximum size of this container. * @see #getPreferredSize * @see #getMinimumSize @@ -2169,7 +2169,7 @@ public class Container extends Component { * Returns an array of all the container listeners * registered on this container. * - * @return all of this container's ContainerListeners + * @return all of this container's {@code ContainerListener}s * or an empty array if no container * listeners are currently registered * @@ -2184,16 +2184,16 @@ public class Container extends Component { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Container. + * upon this {@code Container}. * FooListeners are registered using the * addFooListener method. * *

- * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Container c + * {@code Container c} * for its container listeners with the following code: * *

ContainerListener[] cls = (ContainerListener[])(c.getListeners(ContainerListener.class));
@@ -2202,13 +2202,13 @@ public class Container extends Component { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this container, * or an empty array if no such listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * @exception NullPointerException if {@code listenerType} is {@code null} * * @see #getContainerListeners @@ -2242,10 +2242,10 @@ public class Container extends Component { /** * Processes events on this container. If the event is a - * ContainerEvent, it invokes the - * processContainerEvent method, else it invokes - * its superclass's processEvent. - *

Note that if the event parameter is null + * {@code ContainerEvent}, it invokes the + * {@code processContainerEvent} method, else it invokes + * its superclass's {@code processEvent}. + *

Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -2267,10 +2267,10 @@ public class Container extends Component { * following occurs: *

    *
  • A ContainerListener object is registered via - * addContainerListener - *
  • Container events are enabled via enableEvents + * {@code addContainerListener} + *
  • Container events are enabled via {@code enableEvents} *
- *

Note that if the event parameter is null + *

Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -2365,11 +2365,11 @@ public class Container extends Component { * controllable behaviors. This method searches for the top-most * descendant of this container that contains the given coordinates * and is accepted by the given filter. The search will be constrained to - * lightweight descendants if the last argument is false. + * lightweight descendants if the last argument is {@code false}. * * @param filter EventTargetFilter instance to determine whether the * given component is a valid target for this event. - * @param searchHeavyweights if false, the method + * @param searchHeavyweights if {@code false}, the method * will bypass heavyweight components during the search. */ private Component getMouseEventTarget(int x, int y, boolean includeSelf, @@ -2399,17 +2399,17 @@ public class Container extends Component { * descendants of only lightweight children or only heavyweight children * of this container depending on searchHeavyweightChildren. The search will * be constrained to only lightweight descendants of the searched children - * of this container if searchHeavyweightDescendants is false. + * of this container if searchHeavyweightDescendants is {@code false}. * * @param filter EventTargetFilter instance to determine whether the * selected component is a valid target for this event. - * @param searchHeavyweightChildren if true, the method + * @param searchHeavyweightChildren if {@code true}, the method * will bypass immediate lightweight children during the search. - * If false, the methods will bypass immediate + * If {@code false}, the methods will bypass immediate * heavyweight children during the search. - * @param searchHeavyweightDescendants if false, the method + * @param searchHeavyweightDescendants if {@code false}, the method * will bypass heavyweight descendants which are not immediate - * children during the search. If true, the method + * children during the search. If {@code true}, the method * will traverse both lightweight and heavyweight descendants during * the search. */ @@ -2525,7 +2525,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by dispatchEvent(AWTEvent e) + * replaced by {@code dispatchEvent(AWTEvent e)} */ @Deprecated public void deliverEvent(Event e) { @@ -2562,7 +2562,7 @@ public class Container extends Component { /** * @deprecated As of JDK version 1.1, - * replaced by getComponentAt(int, int). + * replaced by {@code getComponentAt(int, int)}. */ @Deprecated public Component locate(int x, int y) { @@ -2593,7 +2593,7 @@ public class Container extends Component { * Gets the component that contains the specified point. * @param p the point. * @return returns the component that contains the point, - * or null if the component does + * or {@code null} if the component does * not contain the point. * @see Component#contains * @since 1.1 @@ -2603,22 +2603,22 @@ public class Container extends Component { } /** - * Returns the position of the mouse pointer in this Container's - * coordinate space if the Container is under the mouse pointer, - * otherwise returns null. + * Returns the position of the mouse pointer in this {@code Container}'s + * coordinate space if the {@code Container} is under the mouse pointer, + * otherwise returns {@code null}. * This method is similar to {@link Component#getMousePosition()} with the exception - * that it can take the Container's children into account. - * If allowChildren is false, this method will return - * a non-null value only if the mouse pointer is above the Container + * that it can take the {@code Container}'s children into account. + * If {@code allowChildren} is {@code false}, this method will return + * a non-null value only if the mouse pointer is above the {@code Container} * directly, not above the part obscured by children. - * If allowChildren is true, this method returns - * a non-null value if the mouse pointer is above Container or any + * If {@code allowChildren} is {@code true}, this method returns + * a non-null value if the mouse pointer is above {@code Container} or any * of its descendants. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true * @param allowChildren true if children should be taken into account * @see Component#getMousePosition - * @return mouse coordinates relative to this Component, or null + * @return mouse coordinates relative to this {@code Component}, or null * @since 1.5 */ public Point getMousePosition(boolean allowChildren) throws HeadlessException { @@ -2848,8 +2848,8 @@ public class Container extends Component { * Checks if the component is contained in the component hierarchy of * this container. * @param c the component - * @return true if it is an ancestor; - * false otherwise. + * @return {@code true} if it is an ancestor; + * {@code false} otherwise. * @since 1.1 */ public boolean isAncestorOf(Component c) { @@ -2983,11 +2983,11 @@ public class Container extends Component { /* End of JOptionPane support code */ /** - * Returns a string representing the state of this Container. + * Returns a string representing the state of this {@code Container}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this container */ @@ -3005,8 +3005,8 @@ public class Container extends Component { * stream. The listing starts at the specified indentation. *

* The immediate children of the container are printed with - * an indentation of indent+1. The children - * of those children are printed at indent+2 + * an indentation of {@code indent+1}. The children + * of those children are printed at {@code indent+2} * and so on. * * @param out a print stream @@ -3032,8 +3032,8 @@ public class Container extends Component { * to the specified print writer. *

* The immediate children of the container are printed with - * an indentation of indent+1. The children - * of those children are printed at indent+2 + * an indentation of {@code indent+1}. The children + * of those children are printed at {@code indent+2} * and so on. * * @param out a print writer @@ -3147,7 +3147,7 @@ public class Container extends Component { /** * Returns the Set of focus traversal keys for a given traversal operation * for this Container. (See - * setFocusTraversalKeys for a full description of each key.) + * {@code setFocusTraversalKeys} for a full description of each key.) *

* If a Set of traversal keys has not been explicitly defined for this * Container, then this Container's parent's Set is returned. If no Set @@ -3186,16 +3186,16 @@ public class Container extends Component { /** * Returns whether the Set of focus traversal keys for the given focus * traversal operation has been explicitly defined for this Container. If - * this method returns false, this Container is inheriting the + * this method returns {@code false}, this Container is inheriting the * Set from an ancestor, or from the current KeyboardFocusManager. * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS - * @return true if the Set of focus traversal keys for the + * @return {@code true} if the Set of focus traversal keys for the * given focus traversal operation has been explicitly defined for - * this Component; false otherwise. + * this Component; {@code false} otherwise. * @throws IllegalArgumentException if id is not one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, @@ -3218,12 +3218,12 @@ public class Container extends Component { * root belongs to only a single focus traversal cycle. Containers which * are focus cycle roots belong to two cycles: one rooted at the Container * itself, and one rooted at the Container's nearest focus-cycle-root - * ancestor. This method will return true for both such + * ancestor. This method will return {@code true} for both such * Containers in this case. * * @param container the Container to be tested - * @return true if the specified Container is a focus-cycle- - * root of this Container; false otherwise + * @return {@code true} if the specified Container is a focus-cycle- + * root of this Container; {@code false} otherwise * @see #isFocusCycleRoot() * @since 1.4 */ @@ -3390,11 +3390,11 @@ public class Container extends Component { /** * Returns whether the focus traversal policy has been explicitly set for - * this Container. If this method returns false, this + * this Container. If this method returns {@code false}, this * Container will inherit its focus traversal policy from an ancestor. * - * @return true if the focus traversal policy has been - * explicitly set for this Container; false otherwise. + * @return {@code true} if the focus traversal policy has been + * explicitly set for this Container; {@code false} otherwise. * @since 1.4 */ public boolean isFocusTraversalPolicySet() { @@ -3458,7 +3458,7 @@ public class Container extends Component { /** * Sets whether this container will be used to provide focus * traversal policy. Container with this property as - * true will be used to acquire focus traversal policy + * {@code true} will be used to acquire focus traversal policy * instead of closest focus cycle root ancestor. * @param provider indicates whether this container will be used to * provide focus traversal policy @@ -3478,7 +3478,7 @@ public class Container extends Component { /** * Returns whether this container provides focus traversal - * policy. If this property is set to true then when + * policy. If this property is set to {@code true} then when * keyboard focus manager searches container hierarchy for focus * traversal policy and encounters this container before any other * container with this property as true or focus cycle roots then @@ -3488,8 +3488,8 @@ public class Container extends Component { * @see #getFocusTraversalPolicy * @see #setFocusCycleRoot * @see #setFocusTraversalPolicyProvider - * @return true if this container provides focus traversal - * policy, false otherwise + * @return {@code true} if this container provides focus traversal + * policy, {@code false} otherwise * @since 1.5 */ public final boolean isFocusTraversalPolicyProvider() { @@ -3539,7 +3539,7 @@ public class Container extends Component { } /** - * Sets the ComponentOrientation property of this container + * Sets the {@code ComponentOrientation} property of this container * and all components contained within it. *

* This method changes layout-related information, and therefore, @@ -3547,7 +3547,7 @@ public class Container extends Component { * * @param o the new component orientation of this container and * the components contained within it. - * @exception NullPointerException if orientation is null. + * @exception NullPointerException if {@code orientation} is null. * @see Component#setComponentOrientation * @see Component#getComponentOrientation * @see #invalidate @@ -3650,26 +3650,26 @@ public class Container extends Component { private int containerSerializedDataVersion = 1; /** - * Serializes this Container to the specified - * ObjectOutputStream. + * Serializes this {@code Container} to the specified + * {@code ObjectOutputStream}. *

    *
  • Writes default serializable fields to the stream.
  • *
  • Writes a list of serializable ContainerListener(s) as optional * data. The non-serializable ContainerListener(s) are detected and * no attempt is made to serialize them.
  • *
  • Write this Container's FocusTraversalPolicy if and only if it - * is Serializable; otherwise, null is written.
  • + * is Serializable; otherwise, {@code null} is written. *
* - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 or more pairs; - * the pair consists of a String and Object; - * the String indicates the type of object and + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 or more pairs; + * the pair consists of a {@code String} and {@code Object}; + * the {@code String} indicates the type of object and * is one of the following: - * containerListenerK indicating an - * ContainerListener object; - * the Container's FocusTraversalPolicy, - * or null + * {@code containerListenerK} indicating an + * {@code ContainerListener} object; + * the {@code Container}'s {@code FocusTraversalPolicy}, + * or {@code null} * * @see AWTEventMulticaster#save(java.io.ObjectOutputStream, java.lang.String, java.util.EventListener) * @see Container#containerListenerK @@ -3698,8 +3698,8 @@ public class Container extends Component { } /** - * Deserializes this Container from the specified - * ObjectInputStream. + * Deserializes this {@code Container} from the specified + * {@code ObjectInputStream}. *
    *
  • Reads default serializable fields from the stream.
  • *
  • Reads a list of serializable ContainerListener(s) as optional @@ -3708,7 +3708,7 @@ public class Container extends Component { * as optional data.
  • *
* - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @serial * @see #addContainerListener * @see #writeObject(ObjectOutputStream) @@ -3796,7 +3796,7 @@ public class Container extends Component { /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -3806,24 +3806,24 @@ public class Container extends Component { } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child - * @return the nth Accessible child of the object + * @return the nth {@code Accessible} child of the object */ public Accessible getAccessibleChild(int i) { return Container.this.getAccessibleChild(i); } /** - * Returns the Accessible child, if one exists, - * contained at the local coordinate Point. + * Returns the {@code Accessible} child, if one exists, + * contained at the local coordinate {@code Point}. * * @param p the point defining the top-left corner of the - * Accessible, given in the coordinate space + * {@code Accessible}, given in the coordinate space * of the object's parent - * @return the Accessible, if it exists, - * at the specified location; else null + * @return the {@code Accessible}, if it exists, + * at the specified location; else {@code null} */ public Accessible getAccessibleAt(Point p) { return Container.this.getAccessibleAt(p); @@ -3842,7 +3842,7 @@ public class Container extends Component { protected ContainerListener accessibleContainerHandler = null; /** - * Fire PropertyChange listener, if one is registered, + * Fire {@code PropertyChange} listener, if one is registered, * when children are added or removed. * @since 1.3 */ @@ -3898,15 +3898,15 @@ public class Container extends Component { } // inner class AccessibleAWTContainer /** - * Returns the Accessible child contained at the local - * coordinate Point, if one exists. Otherwise - * returns null. + * Returns the {@code Accessible} child contained at the local + * coordinate {@code Point}, if one exists. Otherwise + * returns {@code null}. * * @param p the point defining the top-left corner of the - * Accessible, given in the coordinate space + * {@code Accessible}, given in the coordinate space * of the object's parent - * @return the Accessible at the specified location, - * if it exists; otherwise null + * @return the {@code Accessible} at the specified location, + * if it exists; otherwise {@code null} */ Accessible getAccessibleAt(Point p) { synchronized (getTreeLock()) { @@ -3962,7 +3962,7 @@ public class Container extends Component { /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -3981,10 +3981,10 @@ public class Container extends Component { } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child - * @return the nth Accessible child of the object + * @return the nth {@code Accessible} child of the object */ Accessible getAccessibleChild(int i) { synchronized (getTreeLock()) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java index 312149763df..d23e672779c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ContainerOrderFocusTraversalPolicy.java @@ -33,18 +33,18 @@ import sun.util.logging.PlatformLogger; * of child Components in a Container. From a particular focus cycle root, the * policy makes a pre-order traversal of the Component hierarchy, and traverses * a Container's children according to the ordering of the array returned by - * Container.getComponents(). Portions of the hierarchy that are + * {@code Container.getComponents()}. Portions of the hierarchy that are * not visible and displayable will not be searched. *

* By default, ContainerOrderFocusTraversalPolicy implicitly transfers focus * down-cycle. That is, during normal forward focus traversal, the Component * traversed after a focus cycle root will be the focus-cycle-root's default * Component to focus. This behavior can be disabled using the - * setImplicitDownCycleTraversal method. + * {@code setImplicitDownCycleTraversal} method. *

* By default, methods of this class will return a Component only if it is * visible, displayable, enabled, and focusable. Subclasses can modify this - * behavior by overriding the accept method. + * behavior by overriding the {@code accept} method. *

* This policy takes into account focus traversal @@ -193,7 +193,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * focus down-cycle. That is, during normal forward focus traversal, the * Component traversed after a focus cycle root will be the focus-cycle- * root's default Component to focus. This behavior can be disabled using - * the setImplicitDownCycleTraversal method. + * the {@code setImplicitDownCycleTraversal} method. *

* If aContainer is focus * traversal policy provider, the focus is always transferred down-cycle. @@ -519,7 +519,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * Returns the default Component to focus. This Component will be the first * to receive focus when traversing down into a new focus traversal cycle * rooted at aContainer. The default implementation of this method - * returns the same Component as getFirstComponent. + * returns the same Component as {@code getFirstComponent}. * * @param aContainer the focus cycle root or focus traversal policy provider whose default * Component is to be returned @@ -534,12 +534,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy /** * Sets whether this ContainerOrderFocusTraversalPolicy transfers focus - * down-cycle implicitly. If true, during normal forward focus + * down-cycle implicitly. If {@code true}, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the - * focus-cycle-root's default Component to focus. If false, + * focus-cycle-root's default Component to focus. If {@code false}, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. The default value for this - * property is true. + * property is {@code true}. * * @param implicitDownCycleTraversal whether this * ContainerOrderFocusTraversalPolicy transfers focus down-cycle @@ -553,9 +553,9 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy /** * Returns whether this ContainerOrderFocusTraversalPolicy transfers focus - * down-cycle implicitly. If true, during normal forward focus + * down-cycle implicitly. If {@code true}, during normal forward focus * traversal, the Component traversed after a focus cycle root will be the - * focus-cycle-root's default Component to focus. If false, + * focus-cycle-root's default Component to focus. If {@code false}, * the next Component in the focus traversal cycle rooted at the specified * focus cycle root will be traversed instead. * @@ -575,8 +575,8 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy * * @param aComponent the Component whose fitness as a focus owner is to * be tested - * @return true if aComponent is visible, displayable, - * enabled, and focusable; false otherwise + * @return {@code true} if aComponent is visible, displayable, + * enabled, and focusable; {@code false} otherwise */ protected boolean accept(Component aComponent) { if (!aComponent.canBeFocusOwner()) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Cursor.java b/jdk/src/java.desktop/share/classes/java/awt/Cursor.java index 0ca5a3060ad..77f5b130b34 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Cursor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Cursor.java @@ -146,7 +146,7 @@ public class Cursor implements java.io.Serializable { /** * The chosen cursor type initially set to - * the DEFAULT_CURSOR. + * the {@code DEFAULT_CURSOR}. * * @serial * @see #getType() @@ -283,7 +283,7 @@ public class Cursor implements java.io.Serializable { * @param name a string describing the desired system-specific custom cursor * @return the system specific custom cursor named * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @exception AWTException in case of erroneous retrieving of the cursor */ public static Cursor getSystemCustomCursor(final String name) diff --git a/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java b/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java index 508de7d9bc9..a93cbf4d92a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultFocusTraversalPolicy.java @@ -32,13 +32,13 @@ import java.awt.peer.ComponentPeer; * of child Components in a Container. From a particular focus cycle root, the * policy makes a pre-order traversal of the Component hierarchy, and traverses * a Container's children according to the ordering of the array returned by - * Container.getComponents(). Portions of the hierarchy that are + * {@code Container.getComponents()}. Portions of the hierarchy that are * not visible and displayable will not be searched. *

* If client code has explicitly set the focusability of a Component by either - * overriding Component.isFocusTraversable() or - * Component.isFocusable(), or by calling - * Component.setFocusable(), then a DefaultFocusTraversalPolicy + * overriding {@code Component.isFocusTraversable()} or + * {@code Component.isFocusable()}, or by calling + * {@code Component.setFocusable()}, then a DefaultFocusTraversalPolicy * behaves exactly like a ContainerOrderFocusTraversalPolicy. If, however, the * Component is relying on default focusability, then a * DefaultFocusTraversalPolicy will reject all Components with non-focusable @@ -80,9 +80,9 @@ public class DefaultFocusTraversalPolicy * focus owner. The Component must be visible, displayable, and enabled * to be accepted. If client code has explicitly set the focusability * of the Component by either overriding - * Component.isFocusTraversable() or - * Component.isFocusable(), or by calling - * Component.setFocusable(), then the Component will be + * {@code Component.isFocusTraversable()} or + * {@code Component.isFocusable()}, or by calling + * {@code Component.setFocusable()}, then the Component will be * accepted if and only if it is focusable. If, however, the Component is * relying on default focusability, then all Canvases, Labels, Panels, * Scrollbars, ScrollPanes, Windows, and lightweight Components will be @@ -90,8 +90,8 @@ public class DefaultFocusTraversalPolicy * * @param aComponent the Component whose fitness as a focus owner is to * be tested - * @return true if aComponent meets the above requirements; - * false otherwise + * @return {@code true} if aComponent meets the above requirements; + * {@code false} otherwise */ protected boolean accept(Component aComponent) { if (!(aComponent.isVisible() && aComponent.isDisplayable() && diff --git a/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java index d6ef4d61fdd..b6f1bcfbe4e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DefaultKeyboardFocusManager.java @@ -309,12 +309,12 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * related to focus, and all KeyEvents. These events are dispatched based * on the KeyboardFocusManager's notion of the focus owner and the focused * and active Windows, sometimes overriding the source of the specified - * AWTEvent. If this method returns false, then the AWT event + * AWTEvent. If this method returns {@code false}, then the AWT event * dispatcher will attempt to dispatch the event itself. * * @param e the AWTEvent to be dispatched - * @return true if this method dispatched the event; - * false otherwise + * @return {@code true} if this method dispatched the event; + * {@code false} otherwise */ public boolean dispatchEvent(AWTEvent e) { if (focusLog.isLoggable(PlatformLogger.Level.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) { @@ -778,7 +778,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * Called by dispatchEvent if no other + * Called by {@code dispatchEvent} if no other * KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or * if no other KeyEventDispatchers are registered. If the event has not * been consumed, its target is enabled, and the focus owner is not null, @@ -787,13 +787,13 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * KeyEventPostProcessors. After all this operations are finished, * the event is passed to peers for processing. *

- * In all cases, this method returns true, since + * In all cases, this method returns {@code true}, since * DefaultKeyboardFocusManager is designed so that neither - * dispatchEvent, nor the AWT event dispatcher, should take + * {@code dispatchEvent}, nor the AWT event dispatcher, should take * further action on the event in any situation. * * @param e the KeyEvent to be dispatched - * @return true + * @return {@code true} * @see Component#dispatchEvent */ public boolean dispatchKeyEvent(KeyEvent e) { @@ -841,13 +841,13 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * This method will be called by dispatchKeyEvent. It will + * This method will be called by {@code dispatchKeyEvent}. It will * handle any unconsumed KeyEvents that map to an AWT - * MenuShortcut by consuming the event and activating the + * {@code MenuShortcut} by consuming the event and activating the * shortcut. * * @param e the KeyEvent to post-process - * @return true + * @return {@code true} * @see #dispatchKeyEvent * @see MenuShortcut */ @@ -998,7 +998,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { } /** - * Returns true if there are some marker associated with component comp + * Returns true if there are some marker associated with component {@code comp} * in a markers' queue * @since 1.5 */ @@ -1201,7 +1201,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { * the focus owner. KeyEvents with timestamps later than the specified * timestamp will be enqueued until the specified Component receives a * FOCUS_GAINED event, or the AWT cancels the delay request by invoking - * dequeueKeyEvents or discardKeyEvents. + * {@code dequeueKeyEvents} or {@code discardKeyEvents}. * * @param after timestamp of current event, or the current, system time if * the current event has no timestamp, or the AWT cannot determine @@ -1241,15 +1241,15 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { /** * Releases for normal dispatching to the current focus owner all * KeyEvents which were enqueued because of a call to - * enqueueKeyEvents with the same timestamp and Component. + * {@code enqueueKeyEvents} with the same timestamp and Component. * If the given timestamp is less than zero, the outstanding enqueue * request for the given Component with the oldest timestamp (if * any) should be cancelled. * * @param after the timestamp specified in the call to - * enqueueKeyEvents, or any value < 0 + * {@code enqueueKeyEvents}, or any value < 0 * @param untilFocused the Component specified in the call to - * enqueueKeyEvents + * {@code enqueueKeyEvents} * @see #enqueueKeyEvents * @see #discardKeyEvents */ @@ -1292,11 +1292,11 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager { /** * Discards all KeyEvents which were enqueued because of one or more calls - * to enqueueKeyEvents with the specified Component, or one of + * to {@code enqueueKeyEvents} with the specified Component, or one of * its descendants. * * @param comp the Component specified in one or more calls to - * enqueueKeyEvents, or a parent of such a Component + * {@code enqueueKeyEvents}, or a parent of such a Component * @see #enqueueKeyEvents * @see #dequeueKeyEvents */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java index d134a4d218a..96f3d57e235 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Desktop.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Desktop.java @@ -127,7 +127,7 @@ public class Desktop { } /** - * Returns the Desktop instance of the current + * Returns the {@code Desktop} instance of the current * browser context. On some platforms the Desktop API may not be * supported; use the {@link #isDesktopSupported} method to * determine if the current desktop is supported. @@ -162,8 +162,8 @@ public class Desktop { * If it's supported, use {@link #getDesktop()} to retrieve an * instance. * - * @return true if this class is supported on the - * current platform; false otherwise + * @return {@code true} if this class is supported on the + * current platform; {@code false} otherwise * @see #getDesktop() */ public static boolean isDesktopSupported(){ @@ -186,8 +186,8 @@ public class Desktop { * action method will throw an {@link IOException}. * * @param action the specified {@link Action} - * @return true if the specified action is supported on - * the current platform; false otherwise + * @return {@code true} if the specified action is supported on + * the current platform; {@code false} otherwise * @see Desktop.Action */ public boolean isSupported(Action action) { @@ -230,8 +230,8 @@ public class Desktop { /** - * Calls to the security manager's checkPermission method with - * an AWTPermission("showWindowWithoutWarningBanner") + * Calls to the security manager's {@code checkPermission} method with + * an {@code AWTPermission("showWindowWithoutWarningBanner")} * permission. */ private void checkAWTPermission(){ @@ -259,7 +259,7 @@ public class Desktop { * @throws SecurityException if a security manager exists and its * {@link java.lang.SecurityManager#checkRead(java.lang.String)} * method denies read access to the file, or it denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.awt.AWTPermission @@ -290,7 +290,7 @@ public class Desktop { * method denies read access to the file, or {@link * java.lang.SecurityManager#checkWrite(java.lang.String)} method * denies write access to the file, or it denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.awt.AWTPermission @@ -361,7 +361,7 @@ public class Desktop { * failed to be launched * @throws SecurityException if a security manager exists and it * denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess; and not invoked from within an applet or Java Web Started * application @@ -415,7 +415,7 @@ public class Desktop { * found, or it fails to be launched * @throws SecurityException if a security manager exists and it * denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.awt.AWTPermission @@ -438,7 +438,7 @@ public class Desktop { * client, filling the message fields specified by a {@code * mailto:} URI. * - *

A mailto: URI can specify message fields + *

A {@code mailto:} URI can specify message fields * including "to", "cc", "subject", * "body", etc. See The mailto URL @@ -449,14 +449,14 @@ public class Desktop { * @throws NullPointerException if the specified URI is {@code * null} * @throws IllegalArgumentException if the URI scheme is not - * "mailto" + * {@code "mailto"} * @throws UnsupportedOperationException if the current platform * does not support the {@link Desktop.Action#MAIL} action * @throws IOException if the user default mail client is not * found or fails to be launched * @throws SecurityException if a security manager exists and it * denies the - * AWTPermission("showWindowWithoutWarningBanner") + * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a * subprocess * @see java.net.URI diff --git a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java index 84fb5e77e37..79e66b54798 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Dialog.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Dialog.java @@ -46,22 +46,22 @@ import java.security.AccessControlException; * * The size of the dialog includes any area designated for the * border. The dimensions of the border area can be obtained - * using the getInsets method, however, since + * using the {@code getInsets} method, however, since * these dimensions are platform-dependent, a valid insets * value cannot be obtained until the dialog is made displayable - * by either calling pack or show. + * by either calling {@code pack} or {@code show}. * Since the border area is included in the overall size of the * dialog, the border effectively obscures a portion of the dialog, * constraining the area available for rendering and/or displaying * subcomponents to the rectangle which has an upper-left corner - * location of (insets.left, insets.top), and has a size of - * width - (insets.left + insets.right) by - * height - (insets.top + insets.bottom). + * location of {@code (insets.left, insets.top)}, and has a size of + * {@code width - (insets.left + insets.right)} by + * {@code height - (insets.top + insets.bottom)}. *

- * The default layout for a dialog is BorderLayout. + * The default layout for a dialog is {@code BorderLayout}. *

* A dialog may have its native decorations (i.e. Frame & Titlebar) turned off - * with setUndecorated. This can only be done while the dialog + * with {@code setUndecorated}. This can only be done while the dialog * is not {@link Component#isDisplayable() displayable}. *

* A dialog may have another window as its owner when it's constructed. When @@ -69,7 +69,7 @@ import java.security.AccessControlException; * automatically be hidden from the user. When the owner window is subsequently * restored, the dialog is made visible to the user again. *

- * In a multi-screen environment, you can create a Dialog + * In a multi-screen environment, you can create a {@code Dialog} * on a different screen device than its owner. See {@link java.awt.Frame} for * more information. *

@@ -80,11 +80,11 @@ import java.security.AccessControlException; * specification for details. *

* Dialogs are capable of generating the following - * WindowEvents: - * WindowOpened, WindowClosing, - * WindowClosed, WindowActivated, - * WindowDeactivated, WindowGainedFocus, - * WindowLostFocus. + * {@code WindowEvents}: + * {@code WindowOpened}, {@code WindowClosing}, + * {@code WindowClosed}, {@code WindowActivated}, + * {@code WindowDeactivated}, {@code WindowGainedFocus}, + * {@code WindowLostFocus}. * * @see WindowEvent * @see Window#addWindowListener @@ -117,7 +117,7 @@ public class Dialog extends Window { /** * This field indicates whether the dialog is undecorated. * This property can only be changed while the dialog is not displayable. - * undecorated will be true if the dialog is + * {@code undecorated} will be true if the dialog is * undecorated, otherwise it will be false. * * @serial @@ -134,7 +134,7 @@ public class Dialog extends Window { * Modal dialogs block all input to some top-level windows. * Whether a particular window is blocked depends on dialog's type * of modality; this is called the "scope of blocking". The - * ModalityType enum specifies modal types and their + * {@code ModalityType} enum specifies modal types and their * associated scopes. * * @see Dialog#getModalityType @@ -145,11 +145,11 @@ public class Dialog extends Window { */ public static enum ModalityType { /** - * MODELESS dialog doesn't block any top-level windows. + * {@code MODELESS} dialog doesn't block any top-level windows. */ MODELESS, /** - * A DOCUMENT_MODAL dialog blocks input to all top-level windows + * A {@code DOCUMENT_MODAL} dialog blocks input to all top-level windows * from the same document except those from its own child hierarchy. * A document is a top-level window without an owner. It may contain child * windows that, together with the top-level window are treated as a single @@ -158,7 +158,7 @@ public class Dialog extends Window { */ DOCUMENT_MODAL, /** - * An APPLICATION_MODAL dialog blocks all top-level windows + * An {@code APPLICATION_MODAL} dialog blocks all top-level windows * from the same Java application except those from its own child hierarchy. * If there are several applets launched in a browser, they can be * treated either as separate applications or a single one. This behavior @@ -166,18 +166,18 @@ public class Dialog extends Window { */ APPLICATION_MODAL, /** - * A TOOLKIT_MODAL dialog blocks all top-level windows run + * A {@code TOOLKIT_MODAL} dialog blocks all top-level windows run * from the same toolkit except those from its own child hierarchy. If there * are several applets launched in a browser, all of them run with the same * toolkit; thus, a toolkit-modal dialog displayed by an applet may affect * other applets and all windows of the browser instance which embeds the * Java runtime environment for this toolkit. - * Special AWTPermission "toolkitModality" must be granted to use - * toolkit-modal dialogs. If a TOOLKIT_MODAL dialog is being created - * and this permission is not granted, a SecurityException will be + * Special {@code AWTPermission} "toolkitModality" must be granted to use + * toolkit-modal dialogs. If a {@code TOOLKIT_MODAL} dialog is being created + * and this permission is not granted, a {@code SecurityException} will be * thrown, and no dialog will be created. If a modality type is being changed - * to TOOLKIT_MODAL and this permission is not granted, a - * SecurityException will be thrown, and the modality type will + * to {@code TOOLKIT_MODAL} and this permission is not granted, a + * {@code SecurityException} will be thrown, and the modality type will * be left unchanged. */ TOOLKIT_MODAL @@ -185,8 +185,8 @@ public class Dialog extends Window { /** * Default modality type for modal dialogs. The default modality type is - * APPLICATION_MODAL. Calling the oldstyle setModal(true) - * is equal to setModalityType(DEFAULT_MODALITY_TYPE). + * {@code APPLICATION_MODAL}. Calling the oldstyle {@code setModal(true)} + * is equal to {@code setModalityType(DEFAULT_MODALITY_TYPE)}. * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -245,20 +245,20 @@ public class Dialog extends Window { */ NO_EXCLUDE, /** - * APPLICATION_EXCLUDE indicates that a top-level window + * {@code APPLICATION_EXCLUDE} indicates that a top-level window * won't be blocked by any application-modal dialogs. Also, it isn't * blocked by document-modal dialogs from outside of its child hierarchy. */ APPLICATION_EXCLUDE, /** - * TOOLKIT_EXCLUDE indicates that a top-level window + * {@code TOOLKIT_EXCLUDE} indicates that a top-level window * won't be blocked by application-modal or toolkit-modal dialogs. Also, * it isn't blocked by document-modal dialogs from outside of its * child hierarchy. - * The "toolkitModality" AWTPermission must be granted + * The "toolkitModality" {@code AWTPermission} must be granted * for this exclusion. If an exclusion property is being changed to - * TOOLKIT_EXCLUDE and this permission is not granted, a - * SecurityException will be thrown, and the exclusion + * {@code TOOLKIT_EXCLUDE} and this permission is not granted, a + * {@code SecurityException} will be thrown, and the exclusion * property will be left unchanged. */ TOOLKIT_EXCLUDE @@ -313,15 +313,15 @@ public class Dialog extends Window { private static final long serialVersionUID = 5920926903803293709L; /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Frame and an empty title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Frame} and an empty title. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize @@ -332,19 +332,19 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the specified - * owner Frame and modality and an empty title. + * Constructs an initially invisible {@code Dialog} with the specified + * owner {@code Frame} and modality and an empty title. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -358,17 +358,17 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Frame and title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Frame} and title. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title - * @exception IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @see Component#setSize @@ -379,21 +379,21 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Frame, title and modality. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Frame}, title and modality. * - * @param owner the owner of the dialog or null if + * @param owner the owner of the dialog or {@code null} if * this dialog has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -409,23 +409,23 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the specified owner - * Frame, title, modality, and GraphicsConfiguration. - * @param owner the owner of the dialog or null if this dialog + * Constructs an initially invisible {@code Dialog} with the specified owner + * {@code Frame}, title, modality, and {@code GraphicsConfiguration}. + * @param owner the owner of the dialog or {@code null} if this dialog * has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @param gc the GraphicsConfiguration of the target screen device; - * if null, the default system GraphicsConfiguration + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed - * @exception java.lang.IllegalArgumentException if gc + * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -443,15 +443,15 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Dialog and an empty title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Dialog} and an empty title. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * dialog has no owner - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 */ @@ -460,17 +460,17 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog - * with the specified owner Dialog and title. + * Constructs an initially invisible, modeless {@code Dialog} + * with the specified owner {@code Dialog} and title. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * has no owner - * @param title the title of the dialog or null if this dialog + * @param title the title of the dialog or {@code null} if this dialog * has no title - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.2 @@ -480,21 +480,21 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Dialog, title, and modality. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Dialog}, title, and modality. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * dialog has no owner - * @param title the title of the dialog or null if this + * @param title the title of the dialog or {@code null} if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @exception IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @exception IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -510,25 +510,25 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Dialog, title, modality and - * GraphicsConfiguration. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Dialog}, title, modality and + * {@code GraphicsConfiguration}. * - * @param owner the owner of the dialog or null if this + * @param owner the owner of the dialog or {@code null} if this * dialog has no owner - * @param title the title of the dialog or null if this + * @param title the title of the dialog or {@code null} if this * dialog has no title * @param modal specifies whether dialog blocks user input to other top-level - * windows when shown. If false, the dialog is MODELESS; - * if true, the modality type property is set to - * DEFAULT_MODALITY_TYPE - * @param gc the GraphicsConfiguration of the target screen device; - * if null, the default system GraphicsConfiguration + * windows when shown. If {@code false}, the dialog is {@code MODELESS}; + * if {@code true}, the modality type property is set to + * {@code DEFAULT_MODALITY_TYPE} + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed - * @exception java.lang.IllegalArgumentException if gc + * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog.ModalityType#MODELESS @@ -547,20 +547,20 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with the - * specified owner Window and an empty title. + * Constructs an initially invisible, modeless {@code Dialog} with the + * specified owner {@code Window} and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null + * of their descendants or {@code null} * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @@ -571,22 +571,22 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible, modeless Dialog with - * the specified owner Window and title. + * Constructs an initially invisible, modeless {@code Dialog} with + * the specified owner {@code Window} and title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null - * @param title the title of the dialog or null if this dialog + * of their descendants or {@code null} + * @param title the title of the dialog or {@code null} if this dialog * has no title * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * * @see java.awt.GraphicsEnvironment#isHeadless * @@ -597,25 +597,25 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Window and modality and an empty title. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Window} and modality and an empty title. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null + * of their descendants or {@code null} * @param modalityType specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -630,27 +630,27 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Window, title and modality. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Window}, title and modality. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null - * @param title the title of the dialog or null if this dialog + * of their descendants or {@code null} + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if the owner's - * GraphicsConfiguration is not from a screen device + * @exception java.lang.IllegalArgumentException if the {@code owner}'s + * {@code GraphicsConfiguration} is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -677,31 +677,31 @@ public class Dialog extends Window { } /** - * Constructs an initially invisible Dialog with the - * specified owner Window, title, modality and - * GraphicsConfiguration. + * Constructs an initially invisible {@code Dialog} with the + * specified owner {@code Window}, title, modality and + * {@code GraphicsConfiguration}. * * @param owner the owner of the dialog. The owner must be an instance of * {@link java.awt.Dialog Dialog}, {@link java.awt.Frame Frame}, any - * of their descendants or null - * @param title the title of the dialog or null if this dialog + * of their descendants or {@code null} + * @param title the title of the dialog or {@code null} if this dialog * has no title * @param modalityType specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS - * @param gc the GraphicsConfiguration of the target screen device; - * if null, the default system GraphicsConfiguration + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} + * @param gc the {@code GraphicsConfiguration} of the target screen device; + * if {@code null}, the default system {@code GraphicsConfiguration} * is assumed * - * @exception java.lang.IllegalArgumentException if the owner + * @exception java.lang.IllegalArgumentException if the {@code owner} * is not an instance of {@link java.awt.Dialog Dialog} or {@link * java.awt.Frame Frame} - * @exception java.lang.IllegalArgumentException if gc + * @exception java.lang.IllegalArgumentException if {@code gc} * is not from a screen device * @exception HeadlessException when - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#setModal @@ -766,8 +766,8 @@ public class Dialog extends Window { * This method is obsolete and is kept for backwards compatibility only. * Use {@link #getModalityType getModalityType()} instead. * - * @return true if this dialog window is modal; - * false otherwise + * @return {@code true} if this dialog window is modal; + * {@code false} otherwise * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS @@ -792,10 +792,10 @@ public class Dialog extends Window { * until it is hidden and then shown again. * * @param modal specifies whether dialog blocks input to other windows - * when shown; calling to setModal(true) is equivalent to - * setModalityType(Dialog.DEFAULT_MODALITY_TYPE), and - * calling to setModal(false) is equivalent to - * setModalityType(Dialog.ModalityType.MODELESS) + * when shown; calling to {@code setModal(true)} is equivalent to + * {@code setModalityType(Dialog.DEFAULT_MODALITY_TYPE)}, and + * calling to {@code setModal(false)} is equivalent to + * {@code setModalityType(Dialog.ModalityType.MODELESS)} * * @see java.awt.Dialog#DEFAULT_MODALITY_TYPE * @see java.awt.Dialog.ModalityType#MODELESS @@ -827,18 +827,18 @@ public class Dialog extends Window { * Sets the modality type for this dialog. See {@link * java.awt.Dialog.ModalityType ModalityType} for possible modality types. *

- * If the given modality type is not supported, MODELESS - * is used. You may want to call getModalityType() after calling + * If the given modality type is not supported, {@code MODELESS} + * is used. You may want to call {@code getModalityType()} after calling * this method to ensure that the modality type has been set. *

* Note: changing modality of the visible dialog may have no effect * until it is hidden and then shown again. * * @param type specifies whether dialog blocks input to other - * windows when shown. null value and unsupported modality - * types are equivalent to MODELESS + * windows when shown. {@code null} value and unsupported modality + * types are equivalent to {@code MODELESS} * @exception SecurityException if the calling thread does not have permission - * to create modal dialogs with the given modalityType + * to create modal dialogs with the given {@code modalityType} * * @see java.awt.Dialog#getModalityType * @see java.awt.Toolkit#isModalityTypeSupported @@ -866,7 +866,7 @@ public class Dialog extends Window { * Gets the title of the dialog. The title is displayed in the * dialog's border. * @return the title of this dialog window. The title may be - * null. + * {@code null}. * @see java.awt.Dialog#setTitle */ public String getTitle() { @@ -1193,8 +1193,8 @@ public class Dialog extends Window { /** * Indicates whether this dialog is resizable by the user. * By default, all dialogs are initially resizable. - * @return true if the user can resize the dialog; - * false otherwise. + * @return {@code true} if the user can resize the dialog; + * {@code false} otherwise. * @see java.awt.Dialog#setResizable */ public boolean isResizable() { @@ -1203,8 +1203,8 @@ public class Dialog extends Window { /** * Sets whether this dialog is resizable by the user. - * @param resizable true if the user can - * resize this dialog; false otherwise. + * @param resizable {@code true} if the user can + * resize this dialog; {@code false} otherwise. * @see java.awt.Dialog#isResizable */ public void setResizable(boolean resizable) { @@ -1283,8 +1283,8 @@ public class Dialog extends Window { /** * Indicates whether this dialog is undecorated. * By default, all dialogs are initially decorated. - * @return true if dialog is undecorated; - * false otherwise. + * @return {@code true} if dialog is undecorated; + * {@code false} otherwise. * @see java.awt.Dialog#setUndecorated * @since 1.4 */ @@ -1336,7 +1336,7 @@ public class Dialog extends Window { * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this dialog window. */ @@ -1647,7 +1647,7 @@ public class Dialog extends Window { /** * This class implements accessibility support for the - * Dialog class. It provides an implementation of the + * {@code Dialog} class. It provides an implementation of the * Java Accessibility API appropriate to dialog user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Dimension.java b/jdk/src/java.desktop/share/classes/java/awt/Dimension.java index c368668de5d..9b2b3ff8730 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Dimension.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Dimension.java @@ -29,19 +29,19 @@ import java.awt.geom.Dimension2D; import java.beans.Transient; /** - * The Dimension class encapsulates the width and + * The {@code Dimension} class encapsulates the width and * height of a component (in integer precision) in a single object. * The class is * associated with certain properties of components. Several methods - * defined by the Component class and the - * LayoutManager interface return a - * Dimension object. + * defined by the {@code Component} class and the + * {@code LayoutManager} interface return a + * {@code Dimension} object. *

- * Normally the values of width - * and height are non-negative integers. + * Normally the values of {@code width} + * and {@code height} are non-negative integers. * The constructors that allow you to create a dimension do * not prevent you from setting a negative value for these properties. - * If the value of width or height is + * If the value of {@code width} or {@code height} is * negative, the behavior of some methods defined by other objects is * undefined. * @@ -92,7 +92,7 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Creates an instance of Dimension with a width + * Creates an instance of {@code Dimension} with a width * of zero and a height of zero. */ public Dimension() { @@ -100,19 +100,19 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Creates an instance of Dimension whose width + * Creates an instance of {@code Dimension} whose width * and height are the same as for the specified dimension. * * @param d the specified dimension for the - * width and - * height values + * {@code width} and + * {@code height} values */ public Dimension(Dimension d) { this(d.width, d.height); } /** - * Constructs a Dimension and initializes + * Constructs a {@code Dimension} and initializes * it to the specified width and specified height. * * @param width the specified width @@ -140,14 +140,14 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Sets the size of this Dimension object to + * Sets the size of this {@code Dimension} object to * the specified width and height in double precision. - * Note that if width or height - * are larger than Integer.MAX_VALUE, they will - * be reset to Integer.MAX_VALUE. + * Note that if {@code width} or {@code height} + * are larger than {@code Integer.MAX_VALUE}, they will + * be reset to {@code Integer.MAX_VALUE}. * - * @param width the new width for the Dimension object - * @param height the new height for the Dimension object + * @param width the new width for the {@code Dimension} object + * @param height the new height for the {@code Dimension} object * @since 1.2 */ public void setSize(double width, double height) { @@ -156,12 +156,12 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Gets the size of this Dimension object. + * Gets the size of this {@code Dimension} object. * This method is included for completeness, to parallel the - * getSize method defined by Component. + * {@code getSize} method defined by {@code Component}. * * @return the size of this dimension, a new instance of - * Dimension with the same width and height + * {@code Dimension} with the same width and height * @see java.awt.Dimension#setSize * @see java.awt.Component#getSize * @since 1.1 @@ -172,10 +172,10 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Sets the size of this Dimension object to the specified size. + * Sets the size of this {@code Dimension} object to the specified size. * This method is included for completeness, to parallel the - * setSize method defined by Component. - * @param d the new size for this Dimension object + * {@code setSize} method defined by {@code Component}. + * @param d the new size for this {@code Dimension} object * @see java.awt.Dimension#getSize * @see java.awt.Component#setSize * @since 1.1 @@ -185,13 +185,13 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Sets the size of this Dimension object + * Sets the size of this {@code Dimension} object * to the specified width and height. * This method is included for completeness, to parallel the - * setSize method defined by Component. + * {@code setSize} method defined by {@code Component}. * - * @param width the new width for this Dimension object - * @param height the new height for this Dimension object + * @param width the new width for this {@code Dimension} object + * @param height the new height for this {@code Dimension} object * @see java.awt.Dimension#getSize * @see java.awt.Component#setSize * @since 1.1 @@ -213,9 +213,9 @@ public class Dimension extends Dimension2D implements java.io.Serializable { } /** - * Returns the hash code for this Dimension. + * Returns the hash code for this {@code Dimension}. * - * @return a hash code for this Dimension + * @return a hash code for this {@code Dimension} */ public int hashCode() { int sum = width + height; @@ -224,13 +224,13 @@ public class Dimension extends Dimension2D implements java.io.Serializable { /** * Returns a string representation of the values of this - * Dimension object's height and - * width fields. This method is intended to be used only + * {@code Dimension} object's {@code height} and + * {@code width} fields. This method is intended to be used only * for debugging purposes, and the content and format of the returned * string may vary between implementations. The returned string may be - * empty but may not be null. + * empty but may not be {@code null}. * - * @return a string representation of this Dimension + * @return a string representation of this {@code Dimension} * object */ public String toString() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java b/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java index 12730fde5f4..3dafedb2be8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java +++ b/jdk/src/java.desktop/share/classes/java/awt/DisplayMode.java @@ -28,8 +28,8 @@ package java.awt; import java.lang.annotation.Native; /** - * The DisplayMode class encapsulates the bit depth, height, - * width, and refresh rate of a GraphicsDevice. The ability to + * The {@code DisplayMode} class encapsulates the bit depth, height, + * width, and refresh rate of a {@code GraphicsDevice}. The ability to * change graphics device's display mode is platform- and * configuration-dependent and may not always be available * (see {@link GraphicsDevice#isDisplayChangeSupported}). @@ -57,10 +57,10 @@ public final class DisplayMode { * @param width the width of the display, in pixels * @param height the height of the display, in pixels * @param bitDepth the bit depth of the display, in bits per - * pixel. This can be BIT_DEPTH_MULTI if multiple + * pixel. This can be {@code BIT_DEPTH_MULTI} if multiple * bit depths are available. * @param refreshRate the refresh rate of the display, in hertz. - * This can be REFRESH_RATE_UNKNOWN if the + * This can be {@code REFRESH_RATE_UNKNOWN} if the * information is not available. * @see #BIT_DEPTH_MULTI * @see #REFRESH_RATE_UNKNOWN @@ -96,7 +96,7 @@ public final class DisplayMode { /** * Returns the bit depth of the display, in bits per pixel. This may be - * BIT_DEPTH_MULTI if multiple bit depths are supported in + * {@code BIT_DEPTH_MULTI} if multiple bit depths are supported in * this display mode. * * @return the bit depth of the display, in bits per pixel. @@ -114,7 +114,7 @@ public final class DisplayMode { /** * Returns the refresh rate of the display, in hertz. This may be - * REFRESH_RATE_UNKNOWN if the information is not available. + * {@code REFRESH_RATE_UNKNOWN} if the information is not available. * * @return the refresh rate of the display, in hertz. * @see #REFRESH_RATE_UNKNOWN diff --git a/jdk/src/java.desktop/share/classes/java/awt/Event.java b/jdk/src/java.desktop/share/classes/java/awt/Event.java index 4235bfaa4dd..b00b09876ea 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Event.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Event.java @@ -28,14 +28,14 @@ import java.awt.event.*; import java.io.*; /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Event is a platform-independent class that + * {@code Event} is a platform-independent class that * encapsulates events from the platform's Graphical User * Interface in the Java 1.0 event model. In Java 1.1 - * and later versions, the Event class is maintained + * and later versions, the {@code Event} class is maintained * only for backwards compatibility. The information in this * class description is provided to assist programmers in * converting Java 1.0 programs to the new event model. @@ -43,18 +43,18 @@ import java.io.*; * In the Java 1.0 event model, an event contains an * {@link Event#id} field * that indicates what type of event it is and which other - * Event variables are relevant for the event. + * {@code Event} variables are relevant for the event. *

* For keyboard events, {@link Event#key} * contains a value indicating which key was activated, and * {@link Event#modifiers} contains the * modifiers for that event. For the KEY_PRESS and KEY_RELEASE - * event ids, the value of key is the unicode + * event ids, the value of {@code key} is the unicode * character code for the key. For KEY_ACTION and - * KEY_ACTION_RELEASE, the value of key is + * KEY_ACTION_RELEASE, the value of {@code key} is * one of the defined action-key identifiers in the - * Event class (PGUP, - * PGDN, F1, F2, etc). + * {@code Event} class ({@code PGUP}, + * {@code PGDN}, {@code F1}, {@code F2}, etc). * * @author Sami Shaio * @since 1.0 @@ -293,7 +293,7 @@ public class Event implements java.io.Serializable { /** * The user has pressed a non-ASCII action key. - * The key field contains a value that indicates + * The {@code key} field contains a value that indicates * that the event occurred on one of the action keys, which * comprise the 12 function keys, the arrow (cursor) keys, * Page Up, Page Down, Home, End, Print Screen, Scroll Lock, @@ -303,7 +303,7 @@ public class Event implements java.io.Serializable { /** * The user has released a non-ASCII action key. - * The key field contains a value that indicates + * The {@code key} field contains a value that indicates * that the event occurred on one of the action keys, which * comprise the 12 function keys, the arrow (cursor) keys, * Page Up, Page Down, Home, End, Print Screen, Scroll Lock, @@ -315,9 +315,9 @@ public class Event implements java.io.Serializable { private static final int MOUSE_EVENT = 500; /** - * The user has pressed the mouse button. The ALT_MASK + * The user has pressed the mouse button. The {@code ALT_MASK} * flag indicates that the middle button has been pressed. - * The META_MASKflag indicates that the + * The {@code META_MASK} flag indicates that the * right button has been pressed. * @see java.awt.Event#ALT_MASK * @see java.awt.Event#META_MASK @@ -325,9 +325,9 @@ public class Event implements java.io.Serializable { public static final int MOUSE_DOWN = 1 + MOUSE_EVENT; /** - * The user has released the mouse button. The ALT_MASK + * The user has released the mouse button. The {@code ALT_MASK} * flag indicates that the middle button has been released. - * The META_MASKflag indicates that the + * The {@code META_MASK} flag indicates that the * right button has been released. * @see java.awt.Event#ALT_MASK * @see java.awt.Event#META_MASK @@ -351,8 +351,8 @@ public class Event implements java.io.Serializable { /** * The user has moved the mouse with a button pressed. The - * ALT_MASK flag indicates that the middle - * button is being pressed. The META_MASK flag indicates + * {@code ALT_MASK} flag indicates that the middle + * button is being pressed. The {@code META_MASK} flag indicates * that the right button is being pressed. * @see java.awt.Event#ALT_MASK * @see java.awt.Event#META_MASK @@ -466,7 +466,7 @@ public class Event implements java.io.Serializable { /** * Indicates which type of event the event is, and which - * other Event variables are relevant for the event. + * other {@code Event} variables are relevant for the event. * This has been replaced by AWTEvent.getID() * * @serial @@ -518,9 +518,9 @@ public class Event implements java.io.Serializable { public int modifiers; /** - * For MOUSE_DOWN events, this field indicates the + * For {@code MOUSE_DOWN} events, this field indicates the * number of consecutive clicks. For other events, its value is - * 0. + * {@code 0}. * This field has been replaced by MouseEvent.getClickCount(). * * @serial @@ -531,7 +531,7 @@ public class Event implements java.io.Serializable { /** * An arbitrary argument of the event. The value of this field * depends on the type of event. - * arg has been replaced by event specific property. + * {@code arg} has been replaced by event specific property. * * @serial */ @@ -608,11 +608,11 @@ public class Event implements java.io.Serializable { private static native void initIDs(); /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Creates an instance of Event with the specified target + * Creates an instance of {@code Event} with the specified target * component, time stamp, event type, x and y * coordinates, keyboard key, state of the modifier keys, and * argument. @@ -659,14 +659,14 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Creates an instance of Event, with the specified target + * Creates an instance of {@code Event}, with the specified target * component, time stamp, event type, x and y * coordinates, keyboard key, state of the modifier keys, and an - * argument set to null. + * argument set to {@code null}. * @param target the target component. * @param when the time stamp. * @param id the event type. @@ -680,11 +680,11 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Creates an instance of Event with the specified + * Creates an instance of {@code Event} with the specified * target component, event type, and argument. * @param target the target component. * @param id the event type. @@ -695,9 +695,9 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Translates this event so that its x and y * coordinates are increased by dx and dy, @@ -716,13 +716,13 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Checks if the Shift key is down. - * @return true if the key is down; - * false otherwise. + * @return {@code true} if the key is down; + * {@code false} otherwise. * @see java.awt.Event#modifiers * @see java.awt.Event#controlDown * @see java.awt.Event#metaDown @@ -732,13 +732,13 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Checks if the Control key is down. - * @return true if the key is down; - * false otherwise. + * @return {@code true} if the key is down; + * {@code false} otherwise. * @see java.awt.Event#modifiers * @see java.awt.Event#shiftDown * @see java.awt.Event#metaDown @@ -748,14 +748,14 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Checks if the Meta key is down. * - * @return true if the key is down; - * false otherwise. + * @return {@code true} if the key is down; + * {@code false} otherwise. * @see java.awt.Event#modifiers * @see java.awt.Event#shiftDown * @see java.awt.Event#controlDown @@ -765,9 +765,9 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. */ void consume() { switch(id) { @@ -783,18 +783,18 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. */ boolean isConsumed() { return consumed; } /* - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Returns the integer key-code associated with the key in this event, * as described in java.awt.Event. @@ -810,9 +810,9 @@ public class Event implements java.io.Serializable { } /* - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Returns a new KeyEvent char which corresponds to the int key * of this old event. @@ -827,15 +827,15 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

- * Returns a string representing the state of this Event. + * Returns a string representing the state of this {@code Event}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this event */ @@ -863,9 +863,9 @@ public class Event implements java.io.Serializable { } /** - * NOTE: The Event class is obsolete and is + * NOTE: The {@code Event} class is obsolete and is * available only for backwards compatibility. It has been replaced - * by the AWTEvent class and its subclasses. + * by the {@code AWTEvent} class and its subclasses. *

* Returns a representation of this event's values as a string. * @return a string that represents the event and the values diff --git a/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java b/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java index 0ee077ad466..d034e1a0aac 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/EventFilter.java @@ -27,27 +27,27 @@ package java.awt; interface EventFilter { /** - * Enumeration for possible values for acceptEvent(AWTEvent ev) method. + * Enumeration for possible values for {@code acceptEvent(AWTEvent ev)} method. * @see EventDispatchThread#pumpEventsForFilter */ static enum FilterAction { /** * ACCEPT means that this filter do not filter the event and allows other * active filters to proceed it. If all the active filters accept the event, it - * is dispatched by the EventDispatchThread + * is dispatched by the {@code EventDispatchThread} * @see EventDispatchThread#pumpEventsForFilter */ ACCEPT, /** * REJECT means that this filter filter the event. No other filters are queried, - * and the event is not dispatched by the EventDispatchedThread + * and the event is not dispatched by the {@code EventDispatchedThread} * @see EventDispatchThread#pumpEventsForFilter */ REJECT, /** * ACCEPT_IMMEDIATELY means that this filter do not filter the event, no other * filters are queried and to proceed it, and it is dispatched by the - * EventDispatchThread + * {@code EventDispatchThread} * It is not recommended to use ACCEPT_IMMEDIATELY as there may be some active * filters not queried yet that do not accept this event. It is primarily used * by modal filters. diff --git a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java index 84bcc5b11fb..6dc5fb44b58 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java +++ b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java @@ -51,36 +51,36 @@ import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.JavaSecurityAccess; /** - * EventQueue is a platform-independent class + * {@code EventQueue} is a platform-independent class * that queues events, both from the underlying peer classes * and from trusted application classes. *

* It encapsulates asynchronous event dispatch machinery which * extracts events from the queue and dispatches them by calling * {@link #dispatchEvent(AWTEvent) dispatchEvent(AWTEvent)} method - * on this EventQueue with the event to be dispatched + * on this {@code EventQueue} with the event to be dispatched * as an argument. The particular behavior of this machinery is * implementation-dependent. The only requirements are that events * which were actually enqueued to this queue (note that events - * being posted to the EventQueue can be coalesced) + * being posted to the {@code EventQueue} can be coalesced) * are dispatched: *

*
Sequentially. *
That is, it is not permitted that several events from * this queue are dispatched simultaneously. *
In the same order as they are enqueued. - *
That is, if AWTEvent A is enqueued - * to the EventQueue before - * AWTEvent B then event B will not be + *
That is, if {@code AWTEvent} A is enqueued + * to the {@code EventQueue} before + * {@code AWTEvent} B then event B will not be * dispatched before event A. *
*

* Some browsers partition applets in different code bases into * separate contexts, and establish walls between these contexts. - * In such a scenario, there will be one EventQueue + * In such a scenario, there will be one {@code EventQueue} * per context. Other browsers place all applets into the same * context, implying that there will be only a single, global - * EventQueue for all applets. This behavior is + * {@code EventQueue} for all applets. This behavior is * implementation-dependent. Consult your browser's documentation * for more information. *

@@ -251,14 +251,14 @@ public class EventQueue { } /** - * Posts a 1.1-style event to the EventQueue. + * Posts a 1.1-style event to the {@code EventQueue}. * If there is an existing event on the queue with the same ID - * and event source, the source Component's - * coalesceEvents method will be called. + * and event source, the source {@code Component}'s + * {@code coalesceEvents} method will be called. * - * @param theEvent an instance of java.awt.AWTEvent, + * @param theEvent an instance of {@code java.awt.AWTEvent}, * or a subclass of it - * @throws NullPointerException if theEvent is null + * @throws NullPointerException if {@code theEvent} is {@code null} */ public void postEvent(AWTEvent theEvent) { SunToolkit.flushPendingEvents(appContext); @@ -266,12 +266,12 @@ public class EventQueue { } /** - * Posts a 1.1-style event to the EventQueue. + * Posts a 1.1-style event to the {@code EventQueue}. * If there is an existing event on the queue with the same ID - * and event source, the source Component's - * coalesceEvents method will be called. + * and event source, the source {@code Component}'s + * {@code coalesceEvents} method will be called. * - * @param theEvent an instance of java.awt.AWTEvent, + * @param theEvent an instance of {@code java.awt.AWTEvent}, * or a subclass of it */ private final void postEventPrivate(AWTEvent theEvent) { @@ -320,7 +320,7 @@ public class EventQueue { * Posts the event to the internal Queue of specified priority, * coalescing as appropriate. * - * @param theEvent an instance of java.awt.AWTEvent, + * @param theEvent an instance of {@code java.awt.AWTEvent}, * or a subclass of it * @param priority the desired priority of the event */ @@ -532,10 +532,10 @@ public class EventQueue { } /** - * Removes an event from the EventQueue and + * Removes an event from the {@code EventQueue} and * returns it. This method will block until an event has * been posted by another thread. - * @return the next AWTEvent + * @return the next {@code AWTEvent} * @exception InterruptedException * if any thread has interrupted this thread */ @@ -617,7 +617,7 @@ public class EventQueue { } /** - * Returns the first event on the EventQueue + * Returns the first event on the {@code EventQueue} * without removing it. * @return the first event */ @@ -639,7 +639,7 @@ public class EventQueue { /** * Returns the first event with the specified id, if any. * @param id the id of the type of event desired - * @return the first event of the specified id or null + * @return the first event of the specified id or {@code null} * if there is no such event */ public AWTEvent peekEvent(int id) { @@ -696,9 +696,9 @@ public class EventQueue { * * * - * @param event an instance of java.awt.AWTEvent, + * @param event an instance of {@code java.awt.AWTEvent}, * or a subclass of it - * @throws NullPointerException if event is null + * @throws NullPointerException if {@code event} is {@code null} * @since 1.2 */ protected void dispatchEvent(final AWTEvent event) { @@ -777,23 +777,23 @@ public class EventQueue { /** * Returns the timestamp of the most recent event that had a timestamp, and - * that was dispatched from the EventQueue associated with the + * that was dispatched from the {@code EventQueue} associated with the * calling thread. If an event with a timestamp is currently being * dispatched, its timestamp will be returned. If no events have yet * been dispatched, the EventQueue's initialization time will be * returned instead.In the current version of - * the JDK, only InputEvents, - * ActionEvents, and InvocationEvents have + * the JDK, only {@code InputEvent}s, + * {@code ActionEvent}s, and {@code InvocationEvent}s have * timestamps; however, future versions of the JDK may add timestamps to * additional event types. Note that this method should only be invoked * from an application's {@link #isDispatchThread event dispatching thread}. * If this method is * invoked from another thread, the current system time (as reported by - * System.currentTimeMillis()) will be returned instead. + * {@code System.currentTimeMillis()}) will be returned instead. * - * @return the timestamp of the last InputEvent, - * ActionEvent, or InvocationEvent to be - * dispatched, or System.currentTimeMillis() if this + * @return the timestamp of the last {@code InputEvent}, + * {@code ActionEvent}, or {@code InvocationEvent} to be + * dispatched, or {@code System.currentTimeMillis()} if this * method is invoked on a thread other than an event dispatching * thread * @see java.awt.event.InputEvent#getWhen @@ -831,7 +831,7 @@ public class EventQueue { /** * Returns the event currently being dispatched by the - * EventQueue associated with the calling thread. This is + * {@code EventQueue} associated with the calling thread. This is * useful if a method needs access to the event, but was not designed to * receive a reference to it as an argument. Note that this method should * only be invoked from an application's event dispatching thread. If this @@ -856,14 +856,14 @@ public class EventQueue { } /** - * Replaces the existing EventQueue with the specified one. - * Any pending events are transferred to the new EventQueue + * Replaces the existing {@code EventQueue} with the specified one. + * Any pending events are transferred to the new {@code EventQueue} * for processing by it. * - * @param newEventQueue an EventQueue + * @param newEventQueue an {@code EventQueue} * (or subclass thereof) instance to be use * @see java.awt.EventQueue#pop - * @throws NullPointerException if newEventQueue is null + * @throws NullPointerException if {@code newEventQueue} is {@code null} * @since 1.2 */ public void push(EventQueue newEventQueue) { @@ -921,15 +921,15 @@ public class EventQueue { } /** - * Stops dispatching events using this EventQueue. + * Stops dispatching events using this {@code EventQueue}. * Any pending events are transferred to the previous - * EventQueue for processing. + * {@code EventQueue} for processing. *

* Warning: To avoid deadlock, do not declare this method * synchronized in a subclass. * * @exception EmptyStackException if no previous push was made - * on this EventQueue + * on this {@code EventQueue} * @see java.awt.EventQueue#push * @since 1.2 */ @@ -1122,10 +1122,10 @@ public class EventQueue { } /* - * Gets the EventDispatchThread for this - * EventQueue. + * Gets the {@code EventDispatchThread} for this + * {@code EventQueue}. * @return the event dispatch thread associated with this event queue - * or null if this event queue doesn't have a + * or {@code null} if this event queue doesn't have a * working thread associated with it * @see java.awt.EventQueue#initDispatchThread * @see java.awt.EventQueue#detachDispatchThread @@ -1141,15 +1141,15 @@ public class EventQueue { /* * Removes any pending events for the specified source object. - * If removeAllEvents parameter is true then all + * If removeAllEvents parameter is {@code true} then all * events for the specified source object are removed, if it - * is false then SequencedEvent, SentEvent, - * FocusEvent, WindowEvent, KeyEvent, - * and InputMethodEvent are kept in the queue, but all other + * is {@code false} then {@code SequencedEvent}, {@code SentEvent}, + * {@code FocusEvent}, {@code WindowEvent}, {@code KeyEvent}, + * and {@code InputMethodEvent} are kept in the queue, but all other * events are removed. * * This method is normally called by the source's - * removeNotify method. + * {@code removeNotify} method. */ final void removeSourceEvents(Object source, boolean removeAllEvents) { SunToolkit.flushPendingEvents(appContext); @@ -1249,12 +1249,12 @@ public class EventQueue { } /** - * Causes runnable to have its run + * Causes {@code runnable} to have its {@code run} * method called in the {@link #isDispatchThread dispatch thread} of * {@link Toolkit#getSystemEventQueue the system EventQueue}. * This will happen after all pending events are processed. * - * @param runnable the Runnable whose run + * @param runnable the {@code Runnable} whose {@code run} * method should be executed * asynchronously in the * {@link #isDispatchThread event dispatch thread} @@ -1270,7 +1270,7 @@ public class EventQueue { } /** - * Causes runnable to have its run + * Causes {@code runnable} to have its {@code run} * method called in the {@link #isDispatchThread dispatch thread} of * {@link Toolkit#getSystemEventQueue the system EventQueue}. * This will happen after all pending events are processed. @@ -1278,7 +1278,7 @@ public class EventQueue { * will throw an Error if called from the * {@link #isDispatchThread event dispatcher thread}. * - * @param runnable the Runnable whose run + * @param runnable the {@code Runnable} whose {@code run} * method should be executed * synchronously in the * {@link #isDispatchThread event dispatch thread} @@ -1286,7 +1286,7 @@ public class EventQueue { * @exception InterruptedException if any thread has * interrupted this thread * @exception InvocationTargetException if an throwable is thrown - * when running runnable + * when running {@code runnable} * @see #invokeLater * @see Toolkit#getSystemEventQueue * @see #isDispatchThread diff --git a/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java b/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java index 5b9c17d58ce..197458fa536 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java +++ b/jdk/src/java.desktop/share/classes/java/awt/FileDialog.java @@ -32,11 +32,11 @@ import java.io.File; import sun.awt.AWTAccessor; /** - * The FileDialog class displays a dialog window + * The {@code FileDialog} class displays a dialog window * from which the user can select a file. *

* Since it is a modal dialog, when the application calls - * its show method to display the dialog, + * its {@code show} method to display the dialog, * it blocks the rest of the application until the user has * chosen a file. * @@ -61,10 +61,10 @@ public class FileDialog extends Dialog { public static final int SAVE = 1; /* - * There are two FileDialog modes: LOAD and - * SAVE. + * There are two {@code FileDialog} modes: {@code LOAD} and + * {@code SAVE}. * This integer will represent one or the other. - * If the mode is not specified it will default to LOAD. + * If the mode is not specified it will default to {@code LOAD}. * * @serial * @see getMode() @@ -76,7 +76,7 @@ public class FileDialog extends Dialog { /* * The string specifying the directory to display - * in the file dialog. This variable may be null. + * in the file dialog. This variable may be {@code null}. * * @serial * @see getDirectory() @@ -87,7 +87,7 @@ public class FileDialog extends Dialog { /* * The string specifying the initial value of the * filename text field in the file dialog. - * This variable may be null. + * This variable may be {@code null}. * * @serial * @see getFile() @@ -118,7 +118,7 @@ public class FileDialog extends Dialog { * The filter used as the file dialog's filename filter. * The file dialog will only be displaying files whose * names are accepted by this filter. - * This variable may be null. + * This variable may be {@code null}. * * @serial * @see #getFilenameFilter() @@ -173,7 +173,7 @@ public class FileDialog extends Dialog { /** * Creates a file dialog for loading a file. The title of the * file dialog is initially empty. This is a convenience method for - * FileDialog(parent, "", LOAD). + * {@code FileDialog(parent, "", LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -192,7 +192,7 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * a file. The files shown are those in the current directory. * This is a convenience method for - * FileDialog(parent, title, LOAD). + * {@code FileDialog(parent, title, LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -211,10 +211,10 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * or saving a file. *

- * If the value of mode is LOAD, then the + * If the value of {@code mode} is {@code LOAD}, then the * file dialog is finding a file to read, and the files shown are those * in the current directory. If the value of - * mode is SAVE, the file dialog is finding + * {@code mode} is {@code SAVE}, the file dialog is finding * a place to write a file. *

* Note: Some platforms may not support @@ -226,7 +226,7 @@ public class FileDialog extends Dialog { * @param parent the owner of the dialog * @param title the title of the dialog * @param mode the mode of the dialog; either - * FileDialog.LOAD or FileDialog.SAVE + * {@code FileDialog.LOAD} or {@code FileDialog.SAVE} * @exception IllegalArgumentException if an illegal file * dialog mode is supplied * @see java.awt.FileDialog#LOAD @@ -241,7 +241,7 @@ public class FileDialog extends Dialog { /** * Creates a file dialog for loading a file. The title of the * file dialog is initially empty. This is a convenience method for - * FileDialog(parent, "", LOAD). + * {@code FileDialog(parent, "", LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -250,13 +250,13 @@ public class FileDialog extends Dialog { * displayed. * * @param parent the owner of the dialog - * @exception java.lang.IllegalArgumentException if the parent's - * GraphicsConfiguration + * @exception java.lang.IllegalArgumentException if the {@code parent}'s + * {@code GraphicsConfiguration} * is not from a screen device; - * @exception java.lang.IllegalArgumentException if parent - * is null; this exception is always thrown when - * GraphicsEnvironment.isHeadless - * returns true + * @exception java.lang.IllegalArgumentException if {@code parent} + * is {@code null}; this exception is always thrown when + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.5 */ @@ -268,7 +268,7 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * a file. The files shown are those in the current directory. * This is a convenience method for - * FileDialog(parent, title, LOAD). + * {@code FileDialog(parent, title, LOAD)}. *

* Note: Some platforms may not support * showing the user-specified title in a file dialog. @@ -277,16 +277,16 @@ public class FileDialog extends Dialog { * displayed. * * @param parent the owner of the dialog - * @param title the title of the dialog; a null value + * @param title the title of the dialog; a {@code null} value * will be accepted without causing a - * NullPointerException to be thrown - * @exception java.lang.IllegalArgumentException if the parent's - * GraphicsConfiguration + * {@code NullPointerException} to be thrown + * @exception java.lang.IllegalArgumentException if the {@code parent}'s + * {@code GraphicsConfiguration} * is not from a screen device; - * @exception java.lang.IllegalArgumentException if parent - * is null; this exception is always thrown when - * GraphicsEnvironment.isHeadless - * returns true + * @exception java.lang.IllegalArgumentException if {@code parent} + * is {@code null}; this exception is always thrown when + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.5 */ @@ -298,10 +298,10 @@ public class FileDialog extends Dialog { * Creates a file dialog window with the specified title for loading * or saving a file. *

- * If the value of mode is LOAD, then the + * If the value of {@code mode} is {@code LOAD}, then the * file dialog is finding a file to read, and the files shown are those * in the current directory. If the value of - * mode is SAVE, the file dialog is finding + * {@code mode} is {@code SAVE}, the file dialog is finding * a place to write a file. *

* Note: Some platforms may not support @@ -311,20 +311,20 @@ public class FileDialog extends Dialog { * displayed. * * @param parent the owner of the dialog - * @param title the title of the dialog; a null value + * @param title the title of the dialog; a {@code null} value * will be accepted without causing a - * NullPointerException to be thrown + * {@code NullPointerException} to be thrown * @param mode the mode of the dialog; either - * FileDialog.LOAD or FileDialog.SAVE + * {@code FileDialog.LOAD} or {@code FileDialog.SAVE} * @exception java.lang.IllegalArgumentException if an illegal * file dialog mode is supplied; - * @exception java.lang.IllegalArgumentException if the parent's - * GraphicsConfiguration + * @exception java.lang.IllegalArgumentException if the {@code parent}'s + * {@code GraphicsConfiguration} * is not from a screen device; - * @exception java.lang.IllegalArgumentException if parent - * is null; this exception is always thrown when - * GraphicsEnvironment.isHeadless - * returns true + * @exception java.lang.IllegalArgumentException if {@code parent} + * is {@code null}; this exception is always thrown when + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.FileDialog#LOAD * @see java.awt.FileDialog#SAVE @@ -353,8 +353,8 @@ public class FileDialog extends Dialog { /** - * Constructs a name for this component. Called by getName() - * when the name is null. + * Constructs a name for this component. Called by {@code getName()} + * when the name is {@code null}. */ String constructComponentName() { synchronized (FileDialog.class) { @@ -382,8 +382,8 @@ public class FileDialog extends Dialog { * or for saving to a file. * * @return the mode of this file dialog window, either - * FileDialog.LOAD or - * FileDialog.SAVE + * {@code FileDialog.LOAD} or + * {@code FileDialog.SAVE} * @see java.awt.FileDialog#LOAD * @see java.awt.FileDialog#SAVE * @see java.awt.FileDialog#setMode @@ -393,13 +393,13 @@ public class FileDialog extends Dialog { } /** - * Sets the mode of the file dialog. If mode is not - * a legal value, an exception will be thrown and mode + * Sets the mode of the file dialog. If {@code mode} is not + * a legal value, an exception will be thrown and {@code mode} * will not be set. * * @param mode the mode for this file dialog, either - * FileDialog.LOAD or - * FileDialog.SAVE + * {@code FileDialog.LOAD} or + * {@code FileDialog.SAVE} * @see java.awt.FileDialog#LOAD * @see java.awt.FileDialog#SAVE * @see java.awt.FileDialog#getMode @@ -421,8 +421,8 @@ public class FileDialog extends Dialog { /** * Gets the directory of this file dialog. * - * @return the (potentially null or invalid) - * directory of this FileDialog + * @return the (potentially {@code null} or invalid) + * directory of this {@code FileDialog} * @see java.awt.FileDialog#setDirectory */ public String getDirectory() { @@ -431,14 +431,14 @@ public class FileDialog extends Dialog { /** * Sets the directory of this file dialog window to be the - * specified directory. Specifying a null or an + * specified directory. Specifying a {@code null} or an * invalid directory implies an implementation-defined default. * This default will not be realized, however, until the user - * has selected a file. Until this point, getDirectory() + * has selected a file. Until this point, {@code getDirectory()} * will return the value passed into this method. *

* Specifying "" as the directory is exactly equivalent to - * specifying null as the directory. + * specifying {@code null} as the directory. * * @param dir the specified directory * @see java.awt.FileDialog#getDirectory @@ -453,10 +453,10 @@ public class FileDialog extends Dialog { /** * Gets the selected file of this file dialog. If the user - * selected CANCEL, the returned file is null. + * selected {@code CANCEL}, the returned file is {@code null}. * * @return the currently selected file of this file dialog window, - * or null if none is selected + * or {@code null} if none is selected * @see java.awt.FileDialog#setFile */ public String getFile() { @@ -592,12 +592,12 @@ public class FileDialog extends Dialog { } /** - * Reads the ObjectInputStream and performs + * Reads the {@code ObjectInputStream} and performs * a backwards compatibility check by converting - * either a dir or a file - * equal to an empty string to null. + * either a {@code dir} or a {@code file} + * equal to an empty string to {@code null}. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read */ private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException @@ -614,11 +614,11 @@ public class FileDialog extends Dialog { } /** - * Returns a string representing the state of this FileDialog + * Returns a string representing the state of this {@code FileDialog} * window. This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this file dialog window */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java b/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java index 4405620de13..7cdfe67619b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/FlowLayout.java @@ -30,16 +30,16 @@ import java.io.IOException; /** * A flow layout arranges components in a directional flow, much * like lines of text in a paragraph. The flow direction is - * determined by the container's componentOrientation + * determined by the container's {@code componentOrientation} * property and may be one of two values: *

    - *
  • ComponentOrientation.LEFT_TO_RIGHT - *
  • ComponentOrientation.RIGHT_TO_LEFT + *
  • {@code ComponentOrientation.LEFT_TO_RIGHT} + *
  • {@code ComponentOrientation.RIGHT_TO_LEFT} *
* Flow layouts are typically used * to arrange buttons in a panel. It arranges buttons * horizontally until no more buttons fit on the same line. - * The line alignment is determined by the align + * The line alignment is determined by the {@code align} * property. The possible values are: *
* * @see Paint @@ -65,19 +65,19 @@ public class GradientPaint implements Paint { boolean cyclic; /** - * Constructs a simple acyclic GradientPaint object. + * Constructs a simple acyclic {@code GradientPaint} object. * @param x1 x coordinate of the first specified - * Point in user space + * {@code Point} in user space * @param y1 y coordinate of the first specified - * Point in user space - * @param color1 Color at the first specified - * Point + * {@code Point} in user space + * @param color1 {@code Color} at the first specified + * {@code Point} * @param x2 x coordinate of the second specified - * Point in user space + * {@code Point} in user space * @param y2 y coordinate of the second specified - * Point in user space - * @param color2 Color at the second specified - * Point + * {@code Point} in user space + * @param color2 {@code Color} at the second specified + * {@code Point} * @throws NullPointerException if either one of colors is null */ public GradientPaint(float x1, @@ -97,13 +97,13 @@ public class GradientPaint implements Paint { } /** - * Constructs a simple acyclic GradientPaint object. - * @param pt1 the first specified Point in user space - * @param color1 Color at the first specified - * Point - * @param pt2 the second specified Point in user space - * @param color2 Color at the second specified - * Point + * Constructs a simple acyclic {@code GradientPaint} object. + * @param pt1 the first specified {@code Point} in user space + * @param color1 {@code Color} at the first specified + * {@code Point} + * @param pt2 the second specified {@code Point} in user space + * @param color2 {@code Color} at the second specified + * {@code Point} * @throws NullPointerException if either one of colors or points * is null */ @@ -123,22 +123,22 @@ public class GradientPaint implements Paint { } /** - * Constructs either a cyclic or acyclic GradientPaint - * object depending on the boolean parameter. + * Constructs either a cyclic or acyclic {@code GradientPaint} + * object depending on the {@code boolean} parameter. * @param x1 x coordinate of the first specified - * Point in user space + * {@code Point} in user space * @param y1 y coordinate of the first specified - * Point in user space - * @param color1 Color at the first specified - * Point + * {@code Point} in user space + * @param color1 {@code Color} at the first specified + * {@code Point} * @param x2 x coordinate of the second specified - * Point in user space + * {@code Point} in user space * @param y2 y coordinate of the second specified - * Point in user space - * @param color2 Color at the second specified - * Point - * @param cyclic true if the gradient pattern should cycle - * repeatedly between the two colors; false otherwise + * {@code Point} in user space + * @param color2 {@code Color} at the second specified + * {@code Point} + * @param cyclic {@code true} if the gradient pattern should cycle + * repeatedly between the two colors; {@code false} otherwise */ public GradientPaint(float x1, float y1, @@ -152,18 +152,18 @@ public class GradientPaint implements Paint { } /** - * Constructs either a cyclic or acyclic GradientPaint - * object depending on the boolean parameter. - * @param pt1 the first specified Point + * Constructs either a cyclic or acyclic {@code GradientPaint} + * object depending on the {@code boolean} parameter. + * @param pt1 the first specified {@code Point} * in user space - * @param color1 Color at the first specified - * Point - * @param pt2 the second specified Point + * @param color1 {@code Color} at the first specified + * {@code Point} + * @param pt2 the second specified {@code Point} * in user space - * @param color2 Color at the second specified - * Point - * @param cyclic true if the gradient pattern should cycle - * repeatedly between the two colors; false otherwise + * @param color2 {@code Color} at the second specified + * {@code Point} + * @param cyclic {@code true} if the gradient pattern should cycle + * repeatedly between the two colors; {@code false} otherwise * @throws NullPointerException if either one of colors or points * is null */ @@ -181,7 +181,7 @@ public class GradientPaint implements Paint { * Returns a copy of the point P1 that anchors the first color. * @return a {@link Point2D} object that is a copy of the point * that anchors the first color of this - * GradientPaint. + * {@code GradientPaint}. */ public Point2D getPoint1() { return new Point2D.Float(p1.x, p1.y); @@ -189,7 +189,7 @@ public class GradientPaint implements Paint { /** * Returns the color C1 anchored by the point P1. - * @return a Color object that is the color + * @return a {@code Color} object that is the color * anchored by P1. */ public Color getColor1() { @@ -200,7 +200,7 @@ public class GradientPaint implements Paint { * Returns a copy of the point P2 which anchors the second color. * @return a {@link Point2D} object that is a copy of the point * that anchors the second color of this - * GradientPaint. + * {@code GradientPaint}. */ public Point2D getPoint2() { return new Point2D.Float(p2.x, p2.y); @@ -208,7 +208,7 @@ public class GradientPaint implements Paint { /** * Returns the color C2 anchored by the point P2. - * @return a Color object that is the color + * @return a {@code Color} object that is the color * anchored by P2. */ public Color getColor2() { @@ -216,10 +216,10 @@ public class GradientPaint implements Paint { } /** - * Returns true if the gradient cycles repeatedly + * Returns {@code true} if the gradient cycles repeatedly * between the two colors C1 and C2. - * @return true if the gradient cycles repeatedly - * between the two colors; false otherwise. + * @return {@code true} if the gradient cycles repeatedly + * between the two colors; {@code false} otherwise. */ public boolean isCyclic() { return cyclic; @@ -264,8 +264,8 @@ public class GradientPaint implements Paint { } /** - * Returns the transparency mode for this GradientPaint. - * @return an integer value representing this GradientPaint + * Returns the transparency mode for this {@code GradientPaint}. + * @return an integer value representing this {@code GradientPaint} * object's transparency mode. * @see Transparency */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Graphics.java b/jdk/src/java.desktop/share/classes/java/awt/Graphics.java index b517cf65390..932a89d5ade 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Graphics.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Graphics.java @@ -31,17 +31,17 @@ import java.awt.image.ImageObserver; import java.text.AttributedCharacterIterator; /** - * The Graphics class is the abstract base class for + * The {@code Graphics} class is the abstract base class for * all graphics contexts that allow an application to draw onto * components that are realized on various devices, as well as * onto off-screen images. *

- * A Graphics object encapsulates state information needed + * A {@code Graphics} object encapsulates state information needed * for the basic rendering operations that Java supports. This * state information includes the following properties: * *

    - *
  • The Component object on which to draw. + *
  • The {@code Component} object on which to draw. *
  • A translation origin for rendering and clipping coordinates. *
  • The current clip. *
  • The current color. @@ -72,21 +72,21 @@ import java.text.AttributedCharacterIterator; * the text, except for any descenders. *

* All coordinates that appear as arguments to the methods of this - * Graphics object are considered relative to the - * translation origin of this Graphics object prior to + * {@code Graphics} object are considered relative to the + * translation origin of this {@code Graphics} object prior to * the invocation of the method. *

* All rendering operations modify only pixels which lie within the * area bounded by the current clip, which is specified by a {@link Shape} * in user space and is controlled by the program using the - * Graphics object. This user clip + * {@code Graphics} object. This user clip * is transformed into device space and combined with the * device clip, which is defined by the visibility of windows and * device extents. The combination of the user clip and device clip * defines the composite clip, which determines the final clipping * region. The user clip cannot be modified by the rendering * system to reflect the resulting composite clip. The user clip can only - * be changed through the setClip or clipRect + * be changed through the {@code setClip} or {@code clipRect} * methods. * All drawing or writing is done in the current color, * using the current paint mode, and in the current font. @@ -104,14 +104,14 @@ import java.text.AttributedCharacterIterator; public abstract class Graphics { /** - * Constructs a new Graphics object. + * Constructs a new {@code Graphics} object. * This constructor is the default constructor for a graphics * context. *

- * Since Graphics is an abstract class, applications + * Since {@code Graphics} is an abstract class, applications * cannot call this constructor directly. Graphics contexts are * obtained from other graphics contexts or are created by calling - * getGraphics on a component. + * {@code getGraphics} on a component. * @see java.awt.Graphics#create() * @see java.awt.Component#getGraphics */ @@ -119,36 +119,36 @@ public abstract class Graphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. */ public abstract Graphics create(); /** - * Creates a new Graphics object based on this - * Graphics object, but with a new translation and clip area. - * The new Graphics object has its origin + * Creates a new {@code Graphics} object based on this + * {@code Graphics} object, but with a new translation and clip area. + * The new {@code Graphics} object has its origin * translated to the specified point (xy). * Its clip area is determined by the intersection of the original * clip area with the specified rectangle. The arguments are all * interpreted in the coordinate system of the original - * Graphics object. The new graphics context is + * {@code Graphics} object. The new graphics context is * identical to the original, except in two respects: * *

    *
  • * The new graphics context is translated by (xy). - * That is to say, the point (00) in the + * That is to say, the point ({@code 0}, {@code 0}) in the * new graphics context is the same as (xy) in * the original graphics context. *
  • * The new graphics context has an additional clipping rectangle, in * addition to whatever (translated) clipping rectangle it inherited * from the original graphics context. The origin of the new clipping - * rectangle is at (00), and its size - * is specified by the width and height + * rectangle is at ({@code 0}, {@code 0}), and its size + * is specified by the {@code width} and {@code height} * arguments. *
* @@ -273,12 +273,12 @@ public abstract class Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. + * cleared using {@code setClip(null)}, this method returns + * {@code null}. * The coordinates in the rectangle are relative to the coordinate * system origin of this graphics context. * @return the bounding rectangle of the current clipping area, - * or null if no clip is set. + * or {@code null} if no clip is set. * @see java.awt.Graphics#getClip * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -292,7 +292,7 @@ public abstract class Graphics { * The resulting clipping area is the intersection of the current * clipping area and the specified rectangle. If there is no * current clipping area, either because the clip has never been - * set, or the clip has been cleared using setClip(null), + * set, or the clip has been cleared using {@code setClip(null)}, * the specified rectangle becomes the new clip. * This method sets the user clip, which is independent of the * clipping associated with device bounds and window visibility. @@ -330,10 +330,10 @@ public abstract class Graphics { * This method returns the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. - * @return a Shape object representing the - * current clipping area, or null if + * cleared using {@code setClip(null)}, this method returns + * {@code null}. + * @return a {@code Shape} object representing the + * current clipping area, or {@code null} if * no clip is set. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -345,15 +345,15 @@ public abstract class Graphics { /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects that implement the Shape + * Not all objects that implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects that are guaranteed to be - * supported are Shape objects that are - * obtained via the getClip method and via - * Rectangle objects. This method sets the + * {@code Shape} objects that are guaranteed to be + * supported are {@code Shape} objects that are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. This method sets the * user clip, which is independent of the clipping associated * with device bounds and window visibility. - * @param clip the Shape to use to set the clip + * @param clip the {@code Shape} to use to set the clip * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -363,16 +363,16 @@ public abstract class Graphics { /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -397,12 +397,12 @@ public abstract class Graphics { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -418,9 +418,9 @@ public abstract class Graphics { /** * Draws the outline of the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width. + * {@code x} and x + width. * The top and bottom edges are at - * y and y + height. + * {@code y} and y + height. * The rectangle is drawn using the graphics context's current color. * @param x the x coordinate * of the rectangle to be drawn. @@ -453,7 +453,7 @@ public abstract class Graphics { *

* Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -470,9 +470,9 @@ public abstract class Graphics { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -489,9 +489,9 @@ public abstract class Graphics { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -576,8 +576,8 @@ public abstract class Graphics { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

* The oval covers an area that is * width + 1 pixels wide @@ -609,8 +609,8 @@ public abstract class Graphics { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

- * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -618,7 +618,7 @@ public abstract class Graphics { *

* The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

* The resulting arc covers an area * width + 1 pixels wide @@ -648,8 +648,8 @@ public abstract class Graphics { /** * Fills a circular or elliptical arc covering the specified rectangle. *

- * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -657,7 +657,7 @@ public abstract class Graphics { *

* The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

* The resulting arc covers an area * width + 1 pixels wide @@ -704,16 +704,16 @@ public abstract class Graphics { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

- * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -723,7 +723,7 @@ public abstract class Graphics { /** * Draws the outline of a polygon defined by the specified - * Polygon object. + * {@code Polygon} object. * @param p the polygon to draw. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -736,19 +736,19 @@ public abstract class Graphics { * Fills a closed polygon defined by * arrays of x and y coordinates. *

- * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

* The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ @@ -776,7 +776,7 @@ public abstract class Graphics { * @param str the string to be drawn. * @param x the x coordinate. * @param y the y coordinate. - * @throws NullPointerException if str is null. + * @throws NullPointerException if {@code str} is {@code null}. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ @@ -792,8 +792,8 @@ public abstract class Graphics { * @param iterator the iterator whose text is to be drawn * @param x the x coordinate. * @param y the y coordinate. - * @throws NullPointerException if iterator is - * null. + * @throws NullPointerException if {@code iterator} is + * {@code null}. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars */ @@ -810,11 +810,11 @@ public abstract class Graphics { * @param length the number of characters to be drawn * @param x the x coordinate of the baseline of the text * @param y the y coordinate of the baseline of the text - * @throws NullPointerException if data is null. - * @throws IndexOutOfBoundsException if offset or - * lengthis less than zero, or - * offset+length is greater than the length of the - * data array. + * @throws NullPointerException if {@code data} is {@code null}. + * @throws IndexOutOfBoundsException if {@code offset} or + * {@code length} is less than zero, or + * {@code offset+length} is greater than the length of the + * {@code data} array. * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawString */ @@ -836,10 +836,10 @@ public abstract class Graphics { * @param length the number of bytes that are drawn * @param x the x coordinate of the baseline of the text * @param y the y coordinate of the baseline of the text - * @throws NullPointerException if data is null. - * @throws IndexOutOfBoundsException if offset or - * lengthis less than zero, or offset+length - * is greater than the length of the data array. + * @throws NullPointerException if {@code data} is {@code null}. + * @throws IndexOutOfBoundsException if {@code offset} or + * {@code length} is less than zero, or {@code offset+length} + * is greater than the length of the {@code data} array. * @see java.awt.Graphics#drawChars * @see java.awt.Graphics#drawString */ @@ -861,21 +861,21 @@ public abstract class Graphics { *

* If the image has completely loaded and its pixels are * no longer being changed, then - * drawImage returns true. - * Otherwise, drawImage returns false + * {@code drawImage} returns {@code true}. + * Otherwise, {@code drawImage} returns {@code false} * and as more of * the image becomes available * or it is time to draw another frame of animation, * the process that loads the image notifies * the specified image observer. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -896,9 +896,9 @@ public abstract class Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

* A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -906,15 +906,15 @@ public abstract class Graphics { * the image may be cached separately and generated from the original * data in a separate image production sequence. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the rectangle. * @param height the height of the rectangle. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -940,23 +940,23 @@ public abstract class Graphics { *

* If the image has completely loaded and its pixels are * no longer being changed, then - * drawImage returns true. - * Otherwise, drawImage returns false + * {@code drawImage} returns {@code true}. + * Otherwise, {@code drawImage} returns {@code false} * and as more of * the image becomes available * or it is time to draw another frame of animation, * the process that loads the image notifies * the specified image observer. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param bgcolor the background color to paint under the * non-opaque portions of the image. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -981,7 +981,7 @@ public abstract class Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies * the specified image observer. *

@@ -991,7 +991,7 @@ public abstract class Graphics { * the image may be cached separately and generated from the original * data in a separate image production sequence. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the rectangle. @@ -1000,8 +1000,8 @@ public abstract class Graphics { * non-opaque portions of the image. * @param observer object to be notified as more of * the image is converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -1021,7 +1021,7 @@ public abstract class Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies * the specified image observer. *

@@ -1035,7 +1035,7 @@ public abstract class Graphics { * mapped to the second destination coordinate. The subimage is * scaled and flipped as needed to preserve those mappings. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param dx1 the x coordinate of the first corner of the * destination rectangle. * @param dy1 the y coordinate of the first corner of the @@ -1054,8 +1054,8 @@ public abstract class Graphics { * source rectangle. * @param observer object to be notified as more of the image is * scaled and converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -1080,7 +1080,7 @@ public abstract class Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that loads the image notifies * the specified image observer. *

@@ -1094,7 +1094,7 @@ public abstract class Graphics { * mapped to the second destination coordinate. The subimage is * scaled and flipped as needed to preserve those mappings. * @param img the specified image to be drawn. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param dx1 the x coordinate of the first corner of the * destination rectangle. * @param dy1 the y coordinate of the first corner of the @@ -1115,8 +1115,8 @@ public abstract class Graphics { * non-opaque portions of the image. * @param observer object to be notified as more of the image is * scaled and converted. - * @return false if the image pixels are still changing; - * true otherwise. + * @return {@code false} if the image pixels are still changing; + * {@code true} otherwise. * @see java.awt.Image * @see java.awt.image.ImageObserver * @see java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int) @@ -1131,10 +1131,10 @@ public abstract class Graphics { /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

- * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1143,12 +1143,12 @@ public abstract class Graphics { * may not run to completion for a long period of time. *

* Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update @@ -1166,8 +1166,8 @@ public abstract class Graphics { } /** - * Returns a String object representing this - * Graphics object's value. + * Returns a {@code String} object representing this + * {@code Graphics} object's value. * @return a string representation of this graphics context. */ public String toString() { @@ -1177,9 +1177,9 @@ public abstract class Graphics { /** * Returns the bounding rectangle of the current clipping area. * @return the bounding rectangle of the current clipping area - * or null if no clip is set. + * or {@code null} if no clip is set. * @deprecated As of JDK version 1.1, - * replaced by getClipBounds(). + * replaced by {@code getClipBounds()}. */ @Deprecated public Rectangle getClipRect() { @@ -1208,8 +1208,8 @@ public abstract class Graphics { * @param y the y coordinate of the rectangle to test against the clip * @param width the width of the rectangle to test against the clip * @param height the height of the rectangle to test against the clip - * @return true if the specified rectangle intersects - * the bounds of the current clip; false + * @return {@code true} if the specified rectangle intersects + * the bounds of the current clip; {@code false} * otherwise. */ public boolean hitClip(int x, int y, int width, int height) { @@ -1232,8 +1232,8 @@ public abstract class Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns the - * specified Rectangle. + * cleared using {@code setClip(null)}, this method returns the + * specified {@code Rectangle}. * @param r the rectangle where the current clipping area is * copied to. Any current values in this rectangle are * overwritten. diff --git a/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java b/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java index 080ac3f7f92..ec5f9bd73bb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Graphics2D.java @@ -39,47 +39,47 @@ import java.text.AttributedCharacterIterator; import java.util.Map; /** - * This Graphics2D class extends the + * This {@code Graphics2D} class extends the * {@link Graphics} class to provide more sophisticated * control over geometry, coordinate transformations, color management, * and text layout. This is the fundamental class for rendering * 2-dimensional shapes, text and images on the Java(tm) platform. * *

Coordinate Spaces

- * All coordinates passed to a Graphics2D object are specified + * All coordinates passed to a {@code Graphics2D} object are specified * in a device-independent coordinate system called User Space, which is - * used by applications. The Graphics2D object contains + * used by applications. The {@code Graphics2D} object contains * an {@link AffineTransform} object as part of its rendering state * that defines how to convert coordinates from user space to * device-dependent coordinates in Device Space. *

* Coordinates in device space usually refer to individual device pixels * and are aligned on the infinitely thin gaps between these pixels. - * Some Graphics2D objects can be used to capture rendering + * Some {@code Graphics2D} objects can be used to capture rendering * operations for storage into a graphics metafile for playback on a * concrete device of unknown physical resolution at a later time. Since * the resolution might not be known when the rendering operations are - * captured, the Graphics2D Transform is set up + * captured, the {@code Graphics2D Transform} is set up * to transform user coordinates to a virtual device space that * approximates the expected resolution of the target device. Further * transformations might need to be applied at playback time if the * estimate is incorrect. *

* Some of the operations performed by the rendering attribute objects - * occur in the device space, but all Graphics2D methods take + * occur in the device space, but all {@code Graphics2D} methods take * user space coordinates. *

- * Every Graphics2D object is associated with a target that + * Every {@code Graphics2D} object is associated with a target that * defines where rendering takes place. A * {@link GraphicsConfiguration} object defines the characteristics * of the rendering target, such as pixel format and resolution. * The same rendering target is used throughout the life of a - * Graphics2D object. + * {@code Graphics2D} object. *

- * When creating a Graphics2D object, the - * GraphicsConfiguration + * When creating a {@code Graphics2D} object, the + * {@code GraphicsConfiguration} * specifies the default transform for - * the target of the Graphics2D (a + * the target of the {@code Graphics2D} (a * {@link Component} or {@link Image}). This default transform maps the * user space coordinate system to screen and printer device coordinates * such that the origin maps to the upper left hand corner of the @@ -90,11 +90,11 @@ import java.util.Map; * The scaling of the default transform is set to approximately 72 user * space coordinates per square inch for high resolution devices, such as * printers. For image buffers, the default transform is the - * Identity transform. + * {@code Identity} transform. * *

Rendering Process

* The Rendering Process can be broken down into four phases that are - * controlled by the Graphics2D rendering attributes. + * controlled by the {@code Graphics2D} rendering attributes. * The renderer can optimize many of these steps, either by caching the * results for future calls, by collapsing multiple virtual steps into * a single operation, or by recognizing various attributes as common @@ -106,13 +106,13 @@ import java.util.Map; *
  • * Determine what to render. *
  • - * Constrain the rendering operation to the current Clip. - * The Clip is specified by a {@link Shape} in user + * Constrain the rendering operation to the current {@code Clip}. + * The {@code Clip} is specified by a {@link Shape} in user * space and is controlled by the program using the various clip - * manipulation methods of Graphics and - * Graphics2D. This user clip + * manipulation methods of {@code Graphics} and + * {@code Graphics2D}. This user clip * is transformed into device space by the current - * Transform and combined with the + * {@code Transform} and combined with the * device clip, which is defined by the visibility of windows and * device extents. The combination of the user clip and device clip * defines the composite clip, which determines the final clipping @@ -122,40 +122,40 @@ import java.util.Map; * Determine what colors to render. *
  • * Apply the colors to the destination drawing surface using the current - * {@link Composite} attribute in the Graphics2D context. + * {@link Composite} attribute in the {@code Graphics2D} context. * *
    * The three types of rendering operations, along with details of each * of their particular rendering processes are: *
      *
    1. - * Shape operations + * {@code Shape} operations *
        *
      1. - * If the operation is a draw(Shape) operation, then + * If the operation is a {@code draw(Shape)} operation, then * the {@link Stroke#createStrokedShape(Shape) createStrokedShape} * method on the current {@link Stroke} attribute in the - * Graphics2D context is used to construct a new - * Shape object that contains the outline of the specified - * Shape. + * {@code Graphics2D} context is used to construct a new + * {@code Shape} object that contains the outline of the specified + * {@code Shape}. *
      2. - * The Shape is transformed from user space to device space - * using the current Transform - * in the Graphics2D context. + * The {@code Shape} is transformed from user space to device space + * using the current {@code Transform} + * in the {@code Graphics2D} context. *
      3. - * The outline of the Shape is extracted using the + * The outline of the {@code Shape} is extracted using the * {@link Shape#getPathIterator(AffineTransform) getPathIterator} method of - * Shape, which returns a + * {@code Shape}, which returns a * {@link java.awt.geom.PathIterator PathIterator} - * object that iterates along the boundary of the Shape. + * object that iterates along the boundary of the {@code Shape}. *
      4. - * If the Graphics2D object cannot handle the curved segments - * that the PathIterator object returns then it can call the + * If the {@code Graphics2D} object cannot handle the curved segments + * that the {@code PathIterator} object returns then it can call the * alternate * {@link Shape#getPathIterator(AffineTransform, double) getPathIterator} - * method of Shape, which flattens the Shape. + * method of {@code Shape}, which flattens the {@code Shape}. *
      5. - * The current {@link Paint} in the Graphics2D context + * The current {@link Paint} in the {@code Graphics2D} context * is queried for a {@link PaintContext}, which specifies the * colors to render in device space. *
      @@ -164,12 +164,12 @@ import java.util.Map; *
        *
      1. * The following steps are used to determine the set of glyphs required - * to render the indicated String: + * to render the indicated {@code String}: *
          *
        1. - * If the argument is a String, then the current - * Font in the Graphics2D context is asked to - * convert the Unicode characters in the String into a set of + * If the argument is a {@code String}, then the current + * {@code Font} in the {@code Graphics2D} context is asked to + * convert the Unicode characters in the {@code String} into a set of * glyphs for presentation with whatever basic layout and shaping * algorithms the font implements. *
        2. @@ -177,75 +177,75 @@ import java.util.Map; * {@link AttributedCharacterIterator}, * the iterator is asked to convert itself to a * {@link java.awt.font.TextLayout TextLayout} - * using its embedded font attributes. The TextLayout + * using its embedded font attributes. The {@code TextLayout} * implements more sophisticated glyph layout algorithms that * perform Unicode bi-directional layout adjustments automatically * for multiple fonts of differing writing directions. *
        3. * If the argument is a * {@link GlyphVector}, then the - * GlyphVector object already contains the appropriate + * {@code GlyphVector} object already contains the appropriate * font-specific glyph codes with explicit coordinates for the position of * each glyph. *
        *
      2. - * The current Font is queried to obtain outlines for the + * The current {@code Font} is queried to obtain outlines for the * indicated glyphs. These outlines are treated as shapes in user space * relative to the position of each glyph that was determined in step 1. *
      3. * The character outlines are filled as indicated above - * under Shape operations. + * under {@code Shape} operations. *
      4. - * The current Paint is queried for a - * PaintContext, which specifies + * The current {@code Paint} is queried for a + * {@code PaintContext}, which specifies * the colors to render in device space. *
      *
    2. - * Image Operations + * {@code Image} Operations *
        *
      1. * The region of interest is defined by the bounding box of the source - * Image. + * {@code Image}. * This bounding box is specified in Image Space, which is the - * Image object's local coordinate system. + * {@code Image} object's local coordinate system. *
      2. - * If an AffineTransform is passed to + * If an {@code AffineTransform} is passed to * {@link #drawImage(java.awt.Image, java.awt.geom.AffineTransform, java.awt.image.ImageObserver) drawImage(Image, AffineTransform, ImageObserver)}, - * the AffineTransform is used to transform the bounding - * box from image space to user space. If no AffineTransform + * the {@code AffineTransform} is used to transform the bounding + * box from image space to user space. If no {@code AffineTransform} * is supplied, the bounding box is treated as if it is already in user space. *
      3. - * The bounding box of the source Image is transformed from user - * space into device space using the current Transform. + * The bounding box of the source {@code Image} is transformed from user + * space into device space using the current {@code Transform}. * Note that the result of transforming the bounding box does not * necessarily result in a rectangular region in device space. *
      4. - * The Image object determines what colors to render, + * The {@code Image} object determines what colors to render, * sampled according to the source to destination - * coordinate mapping specified by the current Transform and the + * coordinate mapping specified by the current {@code Transform} and the * optional image transform. *
      *
    * *

    Default Rendering Attributes

    - * The default values for the Graphics2D rendering attributes are: + * The default values for the {@code Graphics2D} rendering attributes are: *
    - *
    Paint - *
    The color of the Component. - *
    Font - *
    The Font of the Component. - *
    Stroke + *
    {@code Paint} + *
    The color of the {@code Component}. + *
    {@code Font} + *
    The {@code Font} of the {@code Component}. + *
    {@code Stroke} *
    A square pen with a linewidth of 1, no dashing, miter segment joins * and square end caps. - *
    Transform + *
    {@code Transform} *
    The * {@link GraphicsConfiguration#getDefaultTransform() getDefaultTransform} - * for the GraphicsConfiguration of the Component. - *
    Composite + * for the {@code GraphicsConfiguration} of the {@code Component}. + *
    {@code Composite} *
    The {@link AlphaComposite#SRC_OVER} rule. - *
    Clip - *
    No rendering Clip, the output is clipped to the - * Component. + *
    {@code Clip} + *
    No rendering {@code Clip}, the output is clipped to the + * {@code Component}. *
    * *

    Rendering Compatibility Issues

    @@ -291,14 +291,14 @@ import java.util.Map; * Java 2D API maintains compatibility with JDK 1.1 rendering * behavior, such that legacy operations and existing renderer * behavior is unchanged under Java 2D API. Legacy - * methods that map onto general draw and - * fill methods are defined, which clearly indicates - * how Graphics2D extends Graphics based - * on settings of Stroke and Transform + * methods that map onto general {@code draw} and + * {@code fill} methods are defined, which clearly indicates + * how {@code Graphics2D} extends {@code Graphics} based + * on settings of {@code Stroke} and {@code Transform} * attributes and rendering hints. The definition * performs identically under default attribute settings. - * For example, the default Stroke is a - * BasicStroke with a width of 1 and no dashing and the + * For example, the default {@code Stroke} is a + * {@code BasicStroke} with a width of 1 and no dashing and the * default Transform for screen drawing is an Identity transform. *

    * The following two rules provide predictable rendering behavior whether @@ -315,7 +315,7 @@ import java.util.Map; * covered. On the other hand, since coordinates are defined to be * between pixels, a shape like a rectangle would have no half covered * pixels, whether or not it is rendered using antialiasing. - *

  • Lines and paths stroked using the BasicStroke + *
  • Lines and paths stroked using the {@code BasicStroke} * object may be "normalized" to provide consistent rendering of the * outlines when positioned at various points on the drawable and * whether drawn with aliased or antialiased rendering. This @@ -341,11 +341,11 @@ import java.util.Map; * attribute settings: *
      *
    • - * For fill operations, including fillRect, - * fillRoundRect, fillOval, - * fillArc, fillPolygon, and - * clearRect, {@link #fill(Shape) fill} can now be called - * with the desired Shape. For example, when filling a + * For {@code fill} operations, including {@code fillRect}, + * {@code fillRoundRect}, {@code fillOval}, + * {@code fillArc}, {@code fillPolygon}, and + * {@code clearRect}, {@link #fill(Shape) fill} can now be called + * with the desired {@code Shape}. For example, when filling a * rectangle: *
        * fill(new Rectangle(x, y, w, h));
      @@ -353,11 +353,11 @@ import java.util.Map;
        * is called.
        *
        * 
    • - * Similarly, for draw operations, including drawLine, - * drawRect, drawRoundRect, - * drawOval, drawArc, drawPolyline, - * and drawPolygon, {@link #draw(Shape) draw} can now be - * called with the desired Shape. For example, when drawing a + * Similarly, for draw operations, including {@code drawLine}, + * {@code drawRect}, {@code drawRoundRect}, + * {@code drawOval}, {@code drawArc}, {@code drawPolyline}, + * and {@code drawPolygon}, {@link #draw(Shape) draw} can now be + * called with the desired {@code Shape}. For example, when drawing a * rectangle: *
        * draw(new Rectangle(x, y, w, h));
      @@ -365,36 +365,36 @@ import java.util.Map;
        * is called.
        *
        * 
    • - * The draw3DRect and fill3DRect methods were - * implemented in terms of the drawLine and - * fillRect methods in the Graphics class which - * would predicate their behavior upon the current Stroke - * and Paint objects in a Graphics2D context. + * The {@code draw3DRect} and {@code fill3DRect} methods were + * implemented in terms of the {@code drawLine} and + * {@code fillRect} methods in the {@code Graphics} class which + * would predicate their behavior upon the current {@code Stroke} + * and {@code Paint} objects in a {@code Graphics2D} context. * This class overrides those implementations with versions that use - * the current Color exclusively, overriding the current - * Paint and which uses fillRect to describe + * the current {@code Color} exclusively, overriding the current + * {@code Paint} and which uses {@code fillRect} to describe * the exact same behavior as the preexisting methods regardless of the - * setting of the current Stroke. + * setting of the current {@code Stroke}. *
    - * The Graphics class defines only the setColor + * The {@code Graphics} class defines only the {@code setColor} * method to control the color to be painted. Since the Java 2D API extends - * the Color object to implement the new Paint + * the {@code Color} object to implement the new {@code Paint} * interface, the existing - * setColor method is now a convenience method for setting the - * current Paint attribute to a Color object. - * setColor(c) is equivalent to setPaint(c). + * {@code setColor} method is now a convenience method for setting the + * current {@code Paint} attribute to a {@code Color} object. + * {@code setColor(c)} is equivalent to {@code setPaint(c)}. *

    - * The Graphics class defines two methods for controlling + * The {@code Graphics} class defines two methods for controlling * how colors are applied to the destination. *

      *
    1. - * The setPaintMode method is implemented as a convenience - * method to set the default Composite, equivalent to - * setComposite(new AlphaComposite.SrcOver). + * The {@code setPaintMode} method is implemented as a convenience + * method to set the default {@code Composite}, equivalent to + * {@code setComposite(new AlphaComposite.SrcOver)}. *
    2. - * The setXORMode(Color xorcolor) method is implemented - * as a convenience method to set a special Composite object that - * ignores the Alpha components of source colors and sets the + * The {@code setXORMode(Color xorcolor)} method is implemented + * as a convenience method to set a special {@code Composite} object that + * ignores the {@code Alpha} components of source colors and sets the * destination color to the value: *
        * dstpixel = (PixelOf(srccolor) ^ PixelOf(xorcolor) ^ dstpixel);
      @@ -407,13 +407,13 @@ import java.util.Map;
       public abstract class Graphics2D extends Graphics {
       
           /**
      -     * Constructs a new Graphics2D object.  Since
      -     * Graphics2D is an abstract class, and since it must be
      +     * Constructs a new {@code Graphics2D} object.  Since
      +     * {@code Graphics2D} is an abstract class, and since it must be
            * customized by subclasses for different output devices,
      -     * Graphics2D objects cannot be created directly.
      -     * Instead, Graphics2D objects must be obtained from another
      -     * Graphics2D object, created by a
      -     * Component, or obtained from images such as
      +     * {@code Graphics2D} objects cannot be created directly.
      +     * Instead, {@code Graphics2D} objects must be obtained from another
      +     * {@code Graphics2D} object, created by a
      +     * {@code Component}, or obtained from images such as
            * {@link BufferedImage} objects.
            * @see java.awt.Component#getGraphics
            * @see java.awt.Graphics#create
      @@ -431,8 +431,8 @@ public abstract class Graphics2D extends Graphics {
            * The resulting rectangle covers an area that is
            * width + 1 pixels wide
            * by height + 1 pixels tall.  This method
      -     * uses the current Color exclusively and ignores
      -     * the current Paint.
      +     * uses the current {@code Color} exclusively and ignores
      +     * the current {@code Paint}.
            * @param x the x coordinate of the rectangle to be drawn.
            * @param y the y coordinate of the rectangle to be drawn.
            * @param width the width of the rectangle to be drawn.
      @@ -467,9 +467,9 @@ public abstract class Graphics2D extends Graphics {
            * The edges of the rectangle are highlighted so that it appears
            * as if the edges were beveled and lit from the upper left corner.
            * The colors used for the highlighting effect and for filling are
      -     * determined from the current Color.  This method uses
      -     * the current Color exclusively and ignores the current
      -     * Paint.
      +     * determined from the current {@code Color}.  This method uses
      +     * the current {@code Color} exclusively and ignores the current
      +     * {@code Paint}.
            * @param x the x coordinate of the rectangle to be filled.
            * @param y the y coordinate of the rectangle to be filled.
            * @param       width the width of the rectangle to be filled.
      @@ -506,12 +506,12 @@ public abstract class Graphics2D extends Graphics {
           }
       
           /**
      -     * Strokes the outline of a Shape using the settings of the
      -     * current Graphics2D context.  The rendering attributes
      -     * applied include the Clip, Transform,
      -     * Paint, Composite and
      -     * Stroke attributes.
      -     * @param s the Shape to be rendered
      +     * Strokes the outline of a {@code Shape} using the settings of the
      +     * current {@code Graphics2D} context.  The rendering attributes
      +     * applied include the {@code Clip}, {@code Transform},
      +     * {@code Paint}, {@code Composite} and
      +     * {@code Stroke} attributes.
      +     * @param s the {@code Shape} to be rendered
            * @see #setStroke
            * @see #setPaint
            * @see java.awt.Graphics#setColor
      @@ -527,22 +527,22 @@ public abstract class Graphics2D extends Graphics {
            * Renders an image, applying a transform from image space into user space
            * before drawing.
            * The transformation from user space into device space is done with
      -     * the current Transform in the Graphics2D.
      +     * the current {@code Transform} in the {@code Graphics2D}.
            * The specified transformation is applied to the image before the
      -     * transform attribute in the Graphics2D context is applied.
      -     * The rendering attributes applied include the Clip,
      -     * Transform, and Composite attributes.
      +     * transform attribute in the {@code Graphics2D} context is applied.
      +     * The rendering attributes applied include the {@code Clip},
      +     * {@code Transform}, and {@code Composite} attributes.
            * Note that no rendering is done if the specified transform is
            * noninvertible.
            * @param img the specified image to be rendered.
      -     *            This method does nothing if img is null.
      +     *            This method does nothing if {@code img} is null.
            * @param xform the transformation from image space into user space
            * @param obs the {@link ImageObserver}
      -     * to be notified as more of the Image
      +     * to be notified as more of the {@code Image}
            * is converted
      -     * @return true if the Image is
      +     * @return {@code true} if the {@code Image} is
            * fully loaded and completely rendered, or if it's null;
      -     * false if the Image is still being loaded.
      +     * {@code false} if the {@code Image} is still being loaded.
            * @see #transform
            * @see #setTransform
            * @see #setComposite
      @@ -554,19 +554,19 @@ public abstract class Graphics2D extends Graphics {
                                             ImageObserver obs);
       
           /**
      -     * Renders a BufferedImage that is
      +     * Renders a {@code BufferedImage} that is
            * filtered with a
            * {@link BufferedImageOp}.
      -     * The rendering attributes applied include the Clip,
      -     * Transform
      -     * and Composite attributes.  This is equivalent to:
      +     * The rendering attributes applied include the {@code Clip},
      +     * {@code Transform}
      +     * and {@code Composite} attributes.  This is equivalent to:
            * 
            * img1 = op.filter(img, null);
            * drawImage(img1, new AffineTransform(1f,0f,0f,1f,x,y), null);
            * 
      * @param op the filter to be applied to the image before rendering - * @param img the specified BufferedImage to be rendered. - * This method does nothing if img is null. + * @param img the specified {@code BufferedImage} to be rendered. + * This method does nothing if {@code img} is null. * @param x the x coordinate of the location in user space where * the upper left corner of the image is rendered * @param y the y coordinate of the location in user space where @@ -588,15 +588,15 @@ public abstract class Graphics2D extends Graphics { * applying a transform from image * space into user space before drawing. * The transformation from user space into device space is done with - * the current Transform in the Graphics2D. + * the current {@code Transform} in the {@code Graphics2D}. * The specified transformation is applied to the image before the - * transform attribute in the Graphics2D context is applied. - * The rendering attributes applied include the Clip, - * Transform, and Composite attributes. Note + * transform attribute in the {@code Graphics2D} context is applied. + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, and {@code Composite} attributes. Note * that no rendering is done if the specified transform is * noninvertible. * @param img the image to be rendered. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param xform the transformation from image space into user space * @see #transform * @see #setTransform @@ -612,24 +612,24 @@ public abstract class Graphics2D extends Graphics { * {@link RenderableImage}, * applying a transform from image space into user space before drawing. * The transformation from user space into device space is done with - * the current Transform in the Graphics2D. + * the current {@code Transform} in the {@code Graphics2D}. * The specified transformation is applied to the image before the - * transform attribute in the Graphics2D context is applied. - * The rendering attributes applied include the Clip, - * Transform, and Composite attributes. Note + * transform attribute in the {@code Graphics2D} context is applied. + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, and {@code Composite} attributes. Note * that no rendering is done if the specified transform is * noninvertible. *

      - * Rendering hints set on the Graphics2D object might - * be used in rendering the RenderableImage. + * Rendering hints set on the {@code Graphics2D} object might + * be used in rendering the {@code RenderableImage}. * If explicit control is required over specific hints recognized by a - * specific RenderableImage, or if knowledge of which hints - * are used is required, then a RenderedImage should be - * obtained directly from the RenderableImage + * specific {@code RenderableImage}, or if knowledge of which hints + * are used is required, then a {@code RenderedImage} should be + * obtained directly from the {@code RenderableImage} * and rendered using *{@link #drawRenderedImage(RenderedImage, AffineTransform) drawRenderedImage}. * @param img the image to be rendered. This method does - * nothing if img is null. + * nothing if {@code img} is null. * @param xform the transformation from image space into user space * @see #transform * @see #setTransform @@ -642,24 +642,24 @@ public abstract class Graphics2D extends Graphics { AffineTransform xform); /** - * Renders the text of the specified String, using the - * current text attribute state in the Graphics2D context. + * Renders the text of the specified {@code String}, using the + * current text attribute state in the {@code Graphics2D} context. * The baseline of the * first character is at position (xy) in * the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script * systems such as Hebrew and Arabic, the glyphs can be rendered from * right to left, in which case the coordinate supplied is the * location of the leftmost character on the baseline. * @param str the string to be rendered * @param x the x coordinate of the location where the - * String should be rendered + * {@code String} should be rendered * @param y the y coordinate of the location where the - * String should be rendered - * @throws NullPointerException if str is - * null + * {@code String} should be rendered + * @throws NullPointerException if {@code str} is + * {@code null} * @see java.awt.Graphics#drawBytes * @see java.awt.Graphics#drawChars * @since 1.0 @@ -667,23 +667,23 @@ public abstract class Graphics2D extends Graphics { public abstract void drawString(String str, int x, int y); /** - * Renders the text specified by the specified String, - * using the current text attribute state in the Graphics2D context. + * Renders the text specified by the specified {@code String}, + * using the current text attribute state in the {@code Graphics2D} context. * The baseline of the first character is at position * (xy) in the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script systems + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script systems * such as Hebrew and Arabic, the glyphs can be rendered from right to * left, in which case the coordinate supplied is the location of the * leftmost character on the baseline. - * @param str the String to be rendered + * @param str the {@code String} to be rendered * @param x the x coordinate of the location where the - * String should be rendered + * {@code String} should be rendered * @param y the y coordinate of the location where the - * String should be rendered - * @throws NullPointerException if str is - * null + * {@code String} should be rendered + * @throws NullPointerException if {@code str} is + * {@code null} * @see #setPaint * @see java.awt.Graphics#setColor * @see java.awt.Graphics#setFont @@ -708,8 +708,8 @@ public abstract class Graphics2D extends Graphics { * rendered * @param y the y coordinate where the iterator's text is to be * rendered - * @throws NullPointerException if iterator is - * null + * @throws NullPointerException if {@code iterator} is + * {@code null} * @see #setPaint * @see java.awt.Graphics#setColor * @see #setTransform @@ -734,8 +734,8 @@ public abstract class Graphics2D extends Graphics { * rendered * @param y the y coordinate where the iterator's text is to be * rendered - * @throws NullPointerException if iterator is - * null + * @throws NullPointerException if {@code iterator} is + * {@code null} * @see #setPaint * @see java.awt.Graphics#setColor * @see #setTransform @@ -748,20 +748,20 @@ public abstract class Graphics2D extends Graphics { /** * Renders the text of the specified * {@link GlyphVector} using - * the Graphics2D context's rendering attributes. - * The rendering attributes applied include the Clip, - * Transform, Paint, and - * Composite attributes. The GlyphVector + * the {@code Graphics2D} context's rendering attributes. + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, and + * {@code Composite} attributes. The {@code GlyphVector} * specifies individual glyphs from a {@link Font}. - * The GlyphVector can also contain the glyph positions. + * The {@code GlyphVector} can also contain the glyph positions. * This is the fastest way to render a set of characters to the * screen. - * @param g the GlyphVector to be rendered + * @param g the {@code GlyphVector} to be rendered * @param x the x position in User Space where the glyphs should * be rendered * @param y the y position in User Space where the glyphs should * be rendered - * @throws NullPointerException if g is null. + * @throws NullPointerException if {@code g} is {@code null}. * * @see java.awt.Font#createGlyphVector * @see java.awt.font.GlyphVector @@ -774,11 +774,11 @@ public abstract class Graphics2D extends Graphics { public abstract void drawGlyphVector(GlyphVector g, float x, float y); /** - * Fills the interior of a Shape using the settings of the - * Graphics2D context. The rendering attributes applied - * include the Clip, Transform, - * Paint, and Composite. - * @param s the Shape to be filled + * Fills the interior of a {@code Shape} using the settings of the + * {@code Graphics2D} context. The rendering attributes applied + * include the {@code Clip}, {@code Transform}, + * {@code Paint}, and {@code Composite}. + * @param s the {@code Shape} to be filled * @see #setPaint * @see java.awt.Graphics#setColor * @see #transform @@ -790,25 +790,25 @@ public abstract class Graphics2D extends Graphics { public abstract void fill(Shape s); /** - * Checks whether or not the specified Shape intersects + * Checks whether or not the specified {@code Shape} intersects * the specified {@link Rectangle}, which is in device - * space. If onStroke is false, this method checks - * whether or not the interior of the specified Shape - * intersects the specified Rectangle. If - * onStroke is true, this method checks - * whether or not the Stroke of the specified - * Shape outline intersects the specified - * Rectangle. + * space. If {@code onStroke} is false, this method checks + * whether or not the interior of the specified {@code Shape} + * intersects the specified {@code Rectangle}. If + * {@code onStroke} is {@code true}, this method checks + * whether or not the {@code Stroke} of the specified + * {@code Shape} outline intersects the specified + * {@code Rectangle}. * The rendering attributes taken into account include the - * Clip, Transform, and Stroke + * {@code Clip}, {@code Transform}, and {@code Stroke} * attributes. * @param rect the area in device space to check for a hit - * @param s the Shape to check for a hit + * @param s the {@code Shape} to check for a hit * @param onStroke flag used to choose between testing the - * stroked or the filled shape. If the flag is true, the - * Stroke outline is tested. If the flag is - * false, the filled Shape is tested. - * @return true if there is a hit; false + * stroked or the filled shape. If the flag is {@code true}, the + * {@code Stroke} outline is tested. If the flag is + * {@code false}, the filled {@code Shape} is tested. + * @return {@code true} if there is a hit; {@code false} * otherwise. * @see #setStroke * @see #fill @@ -824,31 +824,31 @@ public abstract class Graphics2D extends Graphics { /** * Returns the device configuration associated with this - * Graphics2D. - * @return the device configuration of this Graphics2D. + * {@code Graphics2D}. + * @return the device configuration of this {@code Graphics2D}. */ public abstract GraphicsConfiguration getDeviceConfiguration(); /** - * Sets the Composite for the Graphics2D context. - * The Composite is used in all drawing methods such as - * drawImage, drawString, draw, - * and fill. It specifies how new pixels are to be combined + * Sets the {@code Composite} for the {@code Graphics2D} context. + * The {@code Composite} is used in all drawing methods such as + * {@code drawImage}, {@code drawString}, {@code draw}, + * and {@code fill}. It specifies how new pixels are to be combined * with the existing pixels on the graphics device during the rendering * process. - *

      If this Graphics2D context is drawing to a - * Component on the display screen and the - * Composite is a custom object rather than an - * instance of the AlphaComposite class, and if - * there is a security manager, its checkPermission - * method is called with an AWTPermission("readDisplayPixels") + *

      If this {@code Graphics2D} context is drawing to a + * {@code Component} on the display screen and the + * {@code Composite} is a custom object rather than an + * instance of the {@code AlphaComposite} class, and if + * there is a security manager, its {@code checkPermission} + * method is called with an {@code AWTPermission("readDisplayPixels")} * permission. * @throws SecurityException - * if a custom Composite object is being + * if a custom {@code Composite} object is being * used to render to the screen and a security manager - * is set and its checkPermission method + * is set and its {@code checkPermission} method * does not allow the operation. - * @param comp the Composite object to be used for rendering + * @param comp the {@code Composite} object to be used for rendering * @see java.awt.Graphics#setXORMode * @see java.awt.Graphics#setPaintMode * @see #getComposite @@ -859,13 +859,13 @@ public abstract class Graphics2D extends Graphics { public abstract void setComposite(Composite comp); /** - * Sets the Paint attribute for the - * Graphics2D context. Calling this method - * with a null Paint object does - * not have any effect on the current Paint attribute - * of this Graphics2D. - * @param paint the Paint object to be used to generate - * color during the rendering process, or null + * Sets the {@code Paint} attribute for the + * {@code Graphics2D} context. Calling this method + * with a {@code null Paint} object does + * not have any effect on the current {@code Paint} attribute + * of this {@code Graphics2D}. + * @param paint the {@code Paint} object to be used to generate + * color during the rendering process, or {@code null} * @see java.awt.Graphics#setColor * @see #getPaint * @see GradientPaint @@ -874,9 +874,9 @@ public abstract class Graphics2D extends Graphics { public abstract void setPaint( Paint paint ); /** - * Sets the Stroke for the Graphics2D context. - * @param s the Stroke object to be used to stroke a - * Shape during the rendering process + * Sets the {@code Stroke} for the {@code Graphics2D} context. + * @param s the {@code Stroke} object to be used to stroke a + * {@code Shape} during the rendering process * @see BasicStroke * @see #getStroke */ @@ -886,7 +886,7 @@ public abstract class Graphics2D extends Graphics { * Sets the value of a single preference for the rendering algorithms. * Hint categories include controls for rendering quality and overall * time/quality trade-off in the rendering process. Refer to the - * RenderingHints class for definitions of some common + * {@code RenderingHints} class for definitions of some common * keys and values. * @param hintKey the key of the hint to be set. * @param hintValue the value indicating preferences for the specified @@ -900,12 +900,12 @@ public abstract class Graphics2D extends Graphics { * Returns the value of a single preference for the rendering algorithms. * Hint categories include controls for rendering quality and overall * time/quality trade-off in the rendering process. Refer to the - * RenderingHints class for definitions of some common + * {@code RenderingHints} class for definitions of some common * keys and values. * @param hintKey the key corresponding to the hint to get. * @return an object representing the value for the specified hint key. * Some of the keys and their associated values are defined in the - * RenderingHints class. + * {@code RenderingHints} class. * @see RenderingHints * @see #setRenderingHint(RenderingHints.Key, Object) */ @@ -913,13 +913,13 @@ public abstract class Graphics2D extends Graphics { /** * Replaces the values of all preferences for the rendering - * algorithms with the specified hints. + * algorithms with the specified {@code hints}. * The existing values for all rendering hints are discarded and * the new set of known hints and values are initialized from the * specified {@link Map} object. * Hint categories include controls for rendering quality and * overall time/quality trade-off in the rendering process. - * Refer to the RenderingHints class for definitions of + * Refer to the {@code RenderingHints} class for definitions of * some common keys and values. * @param hints the rendering hints to be set * @see #getRenderingHints @@ -931,12 +931,12 @@ public abstract class Graphics2D extends Graphics { * Sets the values of an arbitrary number of preferences for the * rendering algorithms. * Only values for the rendering hints that are present in the - * specified Map object are modified. + * specified {@code Map} object are modified. * All other preferences not present in the specified * object are left unmodified. * Hint categories include controls for rendering quality and * overall time/quality trade-off in the rendering process. - * Refer to the RenderingHints class for definitions of + * Refer to the {@code RenderingHints} class for definitions of * some common keys and values. * @param hints the rendering hints to be set * @see RenderingHints @@ -949,9 +949,9 @@ public abstract class Graphics2D extends Graphics { * trade-off in the rendering process. * Returns all of the hint key/value pairs that were ever specified in * one operation. Refer to the - * RenderingHints class for definitions of some common + * {@code RenderingHints} class for definitions of some common * keys and values. - * @return a reference to an instance of RenderingHints + * @return a reference to an instance of {@code RenderingHints} * that contains the current preferences. * @see RenderingHints * @see #setRenderingHints(Map) @@ -959,11 +959,11 @@ public abstract class Graphics2D extends Graphics { public abstract RenderingHints getRenderingHints(); /** - * Translates the origin of the Graphics2D context to the + * Translates the origin of the {@code Graphics2D} context to the * point (xy) in the current coordinate system. - * Modifies the Graphics2D context so that its new origin + * Modifies the {@code Graphics2D} context so that its new origin * corresponds to the point (xy) in the - * Graphics2D context's former coordinate system. All + * {@code Graphics2D} context's former coordinate system. All * coordinates used in subsequent rendering operations on this graphics * context are relative to this new origin. * @param x the specified x coordinate @@ -974,12 +974,12 @@ public abstract class Graphics2D extends Graphics { /** * Concatenates the current - * Graphics2D Transform + * {@code Graphics2D Transform} * with a translation transform. * Subsequent rendering is translated by the specified * distance relative to the previous position. * This is equivalent to calling transform(T), where T is an - * AffineTransform represented by the following matrix: + * {@code AffineTransform} represented by the following matrix: *

            *          [   1    0    tx  ]
            *          [   0    1    ty  ]
      @@ -991,12 +991,12 @@ public abstract class Graphics2D extends Graphics {
           public abstract void translate(double tx, double ty);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a rotation transform.
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a rotation transform.
            * Subsequent rendering is rotated by the specified radians relative
            * to the previous origin.
      -     * This is equivalent to calling transform(R), where R is an
      -     * AffineTransform represented by the following matrix:
      +     * This is equivalent to calling {@code transform(R)}, where R is an
      +     * {@code AffineTransform} represented by the following matrix:
            * 
            *          [   cos(theta)    -sin(theta)    0   ]
            *          [   sin(theta)     cos(theta)    0   ]
      @@ -1009,8 +1009,8 @@ public abstract class Graphics2D extends Graphics {
           public abstract void rotate(double theta);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a translated rotation
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a translated rotation
            * transform.  Subsequent rendering is transformed by a transform
            * which is constructed by translating to the specified location,
            * rotating by the specified radians, and translating back by the same
      @@ -1030,12 +1030,12 @@ public abstract class Graphics2D extends Graphics {
           public abstract void rotate(double theta, double x, double y);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a scaling transformation
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a scaling transformation
            * Subsequent rendering is resized according to the specified scaling
            * factors relative to the previous scaling.
      -     * This is equivalent to calling transform(S), where S is an
      -     * AffineTransform represented by the following matrix:
      +     * This is equivalent to calling {@code transform(S)}, where S is an
      +     * {@code AffineTransform} represented by the following matrix:
            * 
            *          [   sx   0    0   ]
            *          [   0    sy   0   ]
      @@ -1051,12 +1051,12 @@ public abstract class Graphics2D extends Graphics {
           public abstract void scale(double sx, double sy);
       
           /**
      -     * Concatenates the current Graphics2D
      -     * Transform with a shearing transform.
      +     * Concatenates the current {@code Graphics2D}
      +     * {@code Transform} with a shearing transform.
            * Subsequent renderings are sheared by the specified
            * multiplier relative to the previous position.
      -     * This is equivalent to calling transform(SH), where SH
      -     * is an AffineTransform represented by the following
      +     * This is equivalent to calling {@code transform(SH)}, where SH
      +     * is an {@code AffineTransform} represented by the following
            * matrix:
            * 
            *          [   1   shx   0   ]
      @@ -1071,37 +1071,37 @@ public abstract class Graphics2D extends Graphics {
           public abstract void shear(double shx, double shy);
       
           /**
      -     * Composes an AffineTransform object with the
      -     * Transform in this Graphics2D according
      +     * Composes an {@code AffineTransform} object with the
      +     * {@code Transform} in this {@code Graphics2D} according
            * to the rule last-specified-first-applied.  If the current
      -     * Transform is Cx, the result of composition
      -     * with Tx is a new Transform Cx'.  Cx' becomes the
      -     * current Transform for this Graphics2D.
      -     * Transforming a point p by the updated Transform Cx' is
      +     * {@code Transform} is Cx, the result of composition
      +     * with Tx is a new {@code Transform} Cx'.  Cx' becomes the
      +     * current {@code Transform} for this {@code Graphics2D}.
      +     * Transforming a point p by the updated {@code Transform} Cx' is
            * equivalent to first transforming p by Tx and then transforming
      -     * the result by the original Transform Cx.  In other
      +     * the result by the original {@code Transform} Cx.  In other
            * words, Cx'(p) = Cx(Tx(p)).  A copy of the Tx is made, if necessary,
            * so further modifications to Tx do not affect rendering.
      -     * @param Tx the AffineTransform object to be composed with
      -     * the current Transform
      +     * @param Tx the {@code AffineTransform} object to be composed with
      +     * the current {@code Transform}
            * @see #setTransform
            * @see AffineTransform
            */
           public abstract void transform(AffineTransform Tx);
       
           /**
      -     * Overwrites the Transform in the Graphics2D context.
      +     * Overwrites the Transform in the {@code Graphics2D} context.
            * WARNING: This method should never be used to apply a new
            * coordinate transform on top of an existing transform because the
      -     * Graphics2D might already have a transform that is
      +     * {@code Graphics2D} might already have a transform that is
            * needed for other purposes, such as rendering Swing
            * components or applying a scaling transformation to adjust for the
            * resolution of a printer.
            * 

      To add a coordinate transform, use the - * transform, rotate, scale, - * or shear methods. The setTransform + * {@code transform}, {@code rotate}, {@code scale}, + * or {@code shear} methods. The {@code setTransform} * method is intended only for restoring the original - * Graphics2D transform after rendering, as shown in this + * {@code Graphics2D} transform after rendering, as shown in this * example: *

            * // Get the current transform
      @@ -1114,8 +1114,8 @@ public abstract class Graphics2D extends Graphics {
            * g2d.setTransform(saveAT);
            * 
      * - * @param Tx the AffineTransform that was retrieved - * from the getTransform method + * @param Tx the {@code AffineTransform} that was retrieved + * from the {@code getTransform} method * @see #transform * @see #getTransform * @see AffineTransform @@ -1123,19 +1123,19 @@ public abstract class Graphics2D extends Graphics { public abstract void setTransform(AffineTransform Tx); /** - * Returns a copy of the current Transform in the - * Graphics2D context. - * @return the current AffineTransform in the - * Graphics2D context. + * Returns a copy of the current {@code Transform} in the + * {@code Graphics2D} context. + * @return the current {@code AffineTransform} in the + * {@code Graphics2D} context. * @see #transform * @see #setTransform */ public abstract AffineTransform getTransform(); /** - * Returns the current Paint of the - * Graphics2D context. - * @return the current Graphics2D Paint, + * Returns the current {@code Paint} of the + * {@code Graphics2D} context. + * @return the current {@code Graphics2D Paint}, * which defines a color or pattern. * @see #setPaint * @see java.awt.Graphics#setColor @@ -1143,27 +1143,27 @@ public abstract class Graphics2D extends Graphics { public abstract Paint getPaint(); /** - * Returns the current Composite in the - * Graphics2D context. - * @return the current Graphics2D Composite, + * Returns the current {@code Composite} in the + * {@code Graphics2D} context. + * @return the current {@code Graphics2D Composite}, * which defines a compositing style. * @see #setComposite */ public abstract Composite getComposite(); /** - * Sets the background color for the Graphics2D context. + * Sets the background color for the {@code Graphics2D} context. * The background color is used for clearing a region. - * When a Graphics2D is constructed for a - * Component, the background color is - * inherited from the Component. Setting the background color - * in the Graphics2D context only affects the subsequent - * clearRect calls and not the background color of the - * Component. To change the background - * of the Component, use appropriate methods of - * the Component. + * When a {@code Graphics2D} is constructed for a + * {@code Component}, the background color is + * inherited from the {@code Component}. Setting the background color + * in the {@code Graphics2D} context only affects the subsequent + * {@code clearRect} calls and not the background color of the + * {@code Component}. To change the background + * of the {@code Component}, use appropriate methods of + * the {@code Component}. * @param color the background color that is used in - * subsequent calls to clearRect + * subsequent calls to {@code clearRect} * @see #getBackground * @see java.awt.Graphics#clearRect */ @@ -1171,52 +1171,52 @@ public abstract class Graphics2D extends Graphics { /** * Returns the background color used for clearing a region. - * @return the current Graphics2D Color, + * @return the current {@code Graphics2D Color}, * which defines the background color. * @see #setBackground */ public abstract Color getBackground(); /** - * Returns the current Stroke in the - * Graphics2D context. - * @return the current Graphics2D Stroke, + * Returns the current {@code Stroke} in the + * {@code Graphics2D} context. + * @return the current {@code Graphics2D Stroke}, * which defines the line style. * @see #setStroke */ public abstract Stroke getStroke(); /** - * Intersects the current Clip with the interior of the - * specified Shape and sets the Clip to the - * resulting intersection. The specified Shape is - * transformed with the current Graphics2D - * Transform before being intersected with the current - * Clip. This method is used to make the current - * Clip smaller. - * To make the Clip larger, use setClip. + * Intersects the current {@code Clip} with the interior of the + * specified {@code Shape} and sets the {@code Clip} to the + * resulting intersection. The specified {@code Shape} is + * transformed with the current {@code Graphics2D} + * {@code Transform} before being intersected with the current + * {@code Clip}. This method is used to make the current + * {@code Clip} smaller. + * To make the {@code Clip} larger, use {@code setClip}. * The user clip modified by this method is independent of the * clipping associated with device bounds and visibility. If no clip has * previously been set, or if the clip has been cleared using - * {@link Graphics#setClip(Shape) setClip} with a null - * argument, the specified Shape becomes the new + * {@link Graphics#setClip(Shape) setClip} with a {@code null} + * argument, the specified {@code Shape} becomes the new * user clip. - * @param s the Shape to be intersected with the current - * Clip. If s is null, - * this method clears the current Clip. + * @param s the {@code Shape} to be intersected with the current + * {@code Clip}. If {@code s} is {@code null}, + * this method clears the current {@code Clip}. */ public abstract void clip(Shape s); /** - * Get the rendering context of the Font within this - * Graphics2D context. + * Get the rendering context of the {@code Font} within this + * {@code Graphics2D} context. * The {@link FontRenderContext} * encapsulates application hints such as anti-aliasing and * fractional metrics, as well as target device specific information * such as dots-per-inch. This information should be provided by the * application when using objects that perform typographical - * formatting, such as Font and - * TextLayout. This information should also be provided + * formatting, such as {@code Font} and + * {@code TextLayout}. This information should also be provided * by applications that perform their own layout and need accurate * measurements of various characteristics of glyphs such as advance * and line height when various rendering hints have been applied to diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java index 7baec878444..d3799b3ef24 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfigTemplate.java @@ -28,14 +28,14 @@ package java.awt; import java.io.*; /** - * The GraphicsConfigTemplate class is used to obtain a valid + * The {@code GraphicsConfigTemplate} class is used to obtain a valid * {@link GraphicsConfiguration}. A user instantiates one of these * objects and then sets all non-default attributes as desired. The * {@link GraphicsDevice#getBestConfiguration} method found in the * {@link GraphicsDevice} class is then called with this - * GraphicsConfigTemplate. A valid - * GraphicsConfiguration is returned that meets or exceeds - * what was requested in the GraphicsConfigTemplate. + * {@code GraphicsConfigTemplate}. A valid + * {@code GraphicsConfiguration} is returned that meets or exceeds + * what was requested in the {@code GraphicsConfigTemplate}. * @see GraphicsDevice * @see GraphicsConfiguration * @@ -56,15 +56,15 @@ public abstract class GraphicsConfigTemplate implements Serializable { /** * Value used for "Enum" (Integer) type. States that this - * feature is required for the GraphicsConfiguration + * feature is required for the {@code GraphicsConfiguration} * object. If this feature is not available, do not select the - * GraphicsConfiguration object. + * {@code GraphicsConfiguration} object. */ public static final int REQUIRED = 1; /** * Value used for "Enum" (Integer) type. States that this - * feature is desired for the GraphicsConfiguration + * feature is desired for the {@code GraphicsConfiguration} * object. A selection with this feature is preferred over a * selection that does not include this feature, although both * selections can be considered valid matches. @@ -74,7 +74,7 @@ public abstract class GraphicsConfigTemplate implements Serializable { /** * Value used for "Enum" (Integer) type. States that this * feature is not necessary for the selection of the - * GraphicsConfiguration object. A selection + * {@code GraphicsConfiguration} object. A selection * without this feature is preferred over a selection that * includes this feature since it is not used. */ @@ -82,10 +82,10 @@ public abstract class GraphicsConfigTemplate implements Serializable { /** * Returns the "best" configuration possible that passes the - * criteria defined in the GraphicsConfigTemplate. - * @param gc the array of GraphicsConfiguration + * criteria defined in the {@code GraphicsConfigTemplate}. + * @param gc the array of {@code GraphicsConfiguration} * objects to choose from. - * @return a GraphicsConfiguration object that is + * @return a {@code GraphicsConfiguration} object that is * the best configuration possible. * @see GraphicsConfiguration */ @@ -93,15 +93,15 @@ public abstract class GraphicsConfigTemplate implements Serializable { getBestConfiguration(GraphicsConfiguration[] gc); /** - * Returns a boolean indicating whether or - * not the specified GraphicsConfiguration can be + * Returns a {@code boolean} indicating whether or + * not the specified {@code GraphicsConfiguration} can be * used to create a drawing surface that supports the indicated * features. - * @param gc the GraphicsConfiguration object to test - * @return true if this - * GraphicsConfiguration object can be used to create + * @param gc the {@code GraphicsConfiguration} object to test + * @return {@code true} if this + * {@code GraphicsConfiguration} object can be used to create * surfaces that support the indicated features; - * false if the GraphicsConfiguration can + * {@code false} if the {@code GraphicsConfiguration} can * not be used to create a drawing surface usable by this Java(tm) * API. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java index ef0e454a070..3a5640c8f84 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsConfiguration.java @@ -34,23 +34,23 @@ import java.awt.image.WritableRaster; import sun.awt.image.SunVolatileImage; /** - * The GraphicsConfiguration class describes the + * The {@code GraphicsConfiguration} class describes the * characteristics of a graphics destination such as a printer or monitor. - * There can be many GraphicsConfiguration objects associated + * There can be many {@code GraphicsConfiguration} objects associated * with a single graphics device, representing different drawing modes or * capabilities. The corresponding native structure will vary from platform * to platform. For example, on X11 windowing systems, - * each visual is a different GraphicsConfiguration. - * On Microsoft Windows, GraphicsConfigurations represent + * each visual is a different {@code GraphicsConfiguration}. + * On Microsoft Windows, {@code GraphicsConfiguration}s represent * PixelFormats available in the current resolution and color depth. *

      * In a virtual device multi-screen environment in which the desktop * area could span multiple physical screen devices, the bounds of the - * GraphicsConfiguration objects are relative to the + * {@code GraphicsConfiguration} objects are relative to the * virtual coordinate system. When setting the location of a * component, use {@link #getBounds() getBounds} to get the bounds of - * the desired GraphicsConfiguration and offset the location - * with the coordinates of the GraphicsConfiguration, + * the desired {@code GraphicsConfiguration} and offset the location + * with the coordinates of the {@code GraphicsConfiguration}, * as the following code sample illustrates: *

      * @@ -61,17 +61,17 @@ import sun.awt.image.SunVolatileImage; * *

      * To determine if your environment is a virtual device - * environment, call getBounds on all of the - * GraphicsConfiguration objects in your system. If + * environment, call {@code getBounds} on all of the + * {@code GraphicsConfiguration} objects in your system. If * any of the origins of the returned bounds is not (0, 0), * your environment is a virtual device environment. * *

      - * You can also use getBounds to determine the bounds - * of the virtual device. To do this, first call getBounds on all - * of the GraphicsConfiguration objects in your + * You can also use {@code getBounds} to determine the bounds + * of the virtual device. To do this, first call {@code getBounds} on all + * of the {@code GraphicsConfiguration} objects in your * system. Then calculate the union of all of the bounds returned - * from the calls to getBounds. The union is the + * from the calls to {@code getBounds}. The union is the * bounds of the virtual device. The following code sample * calculates the bounds of the virtual device. * @@ -125,24 +125,24 @@ public abstract class GraphicsConfiguration { /** * Returns the {@link GraphicsDevice} associated with this - * GraphicsConfiguration. - * @return a GraphicsDevice object that is - * associated with this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code GraphicsDevice} object that is + * associated with this {@code GraphicsConfiguration}. */ public abstract GraphicsDevice getDevice(); /** * Returns a {@link BufferedImage} with a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has + * a device. The returned {@code BufferedImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. */ public BufferedImage createCompatibleImage(int width, int height) { ColorModel model = getColorModel(); @@ -153,18 +153,18 @@ public abstract class GraphicsConfiguration { } /** - * Returns a BufferedImage that supports the specified + * Returns a {@code BufferedImage} that supports the specified * transparency and has a data layout and color model - * compatible with this GraphicsConfiguration. This + * compatible with this {@code GraphicsConfiguration}. This * method has nothing to do with memory-mapping - * a device. The returned BufferedImage has a layout and + * a device. The returned {@code BufferedImage} has a layout and * color model that can be optimally blitted to a device - * with this GraphicsConfiguration. - * @param width the width of the returned BufferedImage - * @param height the height of the returned BufferedImage + * with this {@code GraphicsConfiguration}. + * @param width the width of the returned {@code BufferedImage} + * @param height the height of the returned {@code BufferedImage} * @param transparency the specified transparency mode - * @return a BufferedImage whose data layout and color - * model is compatible with this GraphicsConfiguration + * @return a {@code BufferedImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration} * and also supports the specified transparency. * @throws IllegalArgumentException if the transparency is not a valid value * @see Transparency#OPAQUE @@ -190,15 +190,15 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration. - * The returned VolatileImage + * compatible with this {@code GraphicsConfiguration}. + * The returned {@code VolatileImage} * may have data that is stored optimally for the underlying graphics * device and may therefore benefit from platform-specific rendering * acceleration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @see Component#createVolatileImage(int, int) * @since 1.4 */ @@ -216,16 +216,16 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration. - * The returned VolatileImage + * compatible with this {@code GraphicsConfiguration}. + * The returned {@code VolatileImage} * may have data that is stored optimally for the underlying graphics * device and may therefore benefit from platform-specific rendering * acceleration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} * @param transparency the specified transparency mode - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @throws IllegalArgumentException if the transparency is not a valid value * @see Transparency#OPAQUE * @see Transparency#BITMASK @@ -248,20 +248,20 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration, using + * compatible with this {@code GraphicsConfiguration}, using * the specified image capabilities. - * If the caps parameter is null, it is effectively ignored + * If the {@code caps} parameter is null, it is effectively ignored * and this method will create a VolatileImage without regard to - * ImageCapabilities constraints. + * {@code ImageCapabilities} constraints. * - * The returned VolatileImage has + * The returned {@code VolatileImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} * @param caps the image capabilities * @exception AWTException if the supplied image capabilities could not * be met by this graphics configuration @@ -276,22 +276,22 @@ public abstract class GraphicsConfiguration { /** * Returns a {@link VolatileImage} with a data layout and color model - * compatible with this GraphicsConfiguration, using + * compatible with this {@code GraphicsConfiguration}, using * the specified image capabilities and transparency value. - * If the caps parameter is null, it is effectively ignored + * If the {@code caps} parameter is null, it is effectively ignored * and this method will create a VolatileImage without regard to - * ImageCapabilities constraints. + * {@code ImageCapabilities} constraints. * - * The returned VolatileImage has + * The returned {@code VolatileImage} has * a layout and color model that is closest to this native device * configuration and can therefore be optimally blitted to this * device. - * @param width the width of the returned VolatileImage - * @param height the height of the returned VolatileImage + * @param width the width of the returned {@code VolatileImage} + * @param height the height of the returned {@code VolatileImage} * @param caps the image capabilities * @param transparency the specified transparency mode - * @return a VolatileImage whose data layout and color - * model is compatible with this GraphicsConfiguration. + * @return a {@code VolatileImage} whose data layout and color + * model is compatible with this {@code GraphicsConfiguration}. * @see Transparency#OPAQUE * @see Transparency#BITMASK * @see Transparency#TRANSLUCENT @@ -317,19 +317,19 @@ public abstract class GraphicsConfiguration { /** * Returns the {@link ColorModel} associated with this - * GraphicsConfiguration. - * @return a ColorModel object that is associated with - * this GraphicsConfiguration. + * {@code GraphicsConfiguration}. + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration}. */ public abstract ColorModel getColorModel(); /** - * Returns the ColorModel associated with this - * GraphicsConfiguration that supports the specified + * Returns the {@code ColorModel} associated with this + * {@code GraphicsConfiguration} that supports the specified * transparency. * @param transparency the specified transparency mode - * @return a ColorModel object that is associated with - * this GraphicsConfiguration and supports the + * @return a {@code ColorModel} object that is associated with + * this {@code GraphicsConfiguration} and supports the * specified transparency or null if the transparency is not a valid * value. * @see Transparency#OPAQUE @@ -340,30 +340,30 @@ public abstract class GraphicsConfiguration { /** * Returns the default {@link AffineTransform} for this - * GraphicsConfiguration. This - * AffineTransform is typically the Identity transform - * for most normal screens. The default AffineTransform + * {@code GraphicsConfiguration}. This + * {@code AffineTransform} is typically the Identity transform + * for most normal screens. The default {@code AffineTransform} * maps coordinates onto the device such that 72 user space * coordinate units measure approximately 1 inch in device * space. The normalizing transform can be used to make * this mapping more exact. Coordinates in the coordinate space - * defined by the default AffineTransform for screen and + * defined by the default {@code AffineTransform} for screen and * printer devices have the origin in the upper left-hand corner of * the target region of the device, with X coordinates * increasing to the right and Y coordinates increasing downwards. * For image buffers not associated with a device, such as those not - * created by createCompatibleImage, - * this AffineTransform is the Identity transform. - * @return the default AffineTransform for this - * GraphicsConfiguration. + * created by {@code createCompatibleImage}, + * this {@code AffineTransform} is the Identity transform. + * @return the default {@code AffineTransform} for this + * {@code GraphicsConfiguration}. */ public abstract AffineTransform getDefaultTransform(); /** * - * Returns a AffineTransform that can be concatenated - * with the default AffineTransform - * of a GraphicsConfiguration so that 72 units in user + * Returns a {@code AffineTransform} that can be concatenated + * with the default {@code AffineTransform} + * of a {@code GraphicsConfiguration} so that 72 units in user * space equals 1 inch in device space. *

      * For a particular {@link Graphics2D}, g, one @@ -375,27 +375,27 @@ public abstract class GraphicsConfiguration { * g.setTransform(gc.getDefaultTransform()); * g.transform(gc.getNormalizingTransform()); *

      - * Note that sometimes this AffineTransform is identity, + * Note that sometimes this {@code AffineTransform} is identity, * such as for printers or metafile output, and that this - * AffineTransform is only as accurate as the information + * {@code AffineTransform} is only as accurate as the information * supplied by the underlying system. For image buffers not * associated with a device, such as those not created by - * createCompatibleImage, this - * AffineTransform is the Identity transform + * {@code createCompatibleImage}, this + * {@code AffineTransform} is the Identity transform * since there is no valid distance measurement. - * @return an AffineTransform to concatenate to the - * default AffineTransform so that 72 units in user + * @return an {@code AffineTransform} to concatenate to the + * default {@code AffineTransform} so that 72 units in user * space is mapped to 1 inch in device space. */ public abstract AffineTransform getNormalizingTransform(); /** - * Returns the bounds of the GraphicsConfiguration + * Returns the bounds of the {@code GraphicsConfiguration} * in the device coordinates. In a multi-screen environment * with a virtual device, the bounds can have negative X * or Y origins. * @return the bounds of the area covered by this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @since 1.3 */ public abstract Rectangle getBounds(); @@ -408,7 +408,7 @@ public abstract class GraphicsConfiguration { /** * Returns the buffering capabilities of this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @return the buffering capabilities of this graphics * configuration object * @since 1.4 @@ -423,7 +423,7 @@ public abstract class GraphicsConfiguration { /** * Returns the image capabilities of this - * GraphicsConfiguration. + * {@code GraphicsConfiguration}. * @return the image capabilities of this graphics * configuration object * @since 1.4 diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java index fdc44ca6ab7..b8947148a7e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsDevice.java @@ -33,19 +33,19 @@ import sun.awt.AppContext; import sun.awt.SunToolkit; /** - * The GraphicsDevice class describes the graphics devices + * The {@code GraphicsDevice} class describes the graphics devices * that might be available in a particular graphics environment. These * include screen and printer devices. Note that there can be many screens * and many printers in an instance of {@link GraphicsEnvironment}. Each * graphics device has one or more {@link GraphicsConfiguration} objects * associated with it. These objects specify the different configurations - * in which the GraphicsDevice can be used. + * in which the {@code GraphicsDevice} can be used. *

      - * In a multi-screen environment, the GraphicsConfiguration + * In a multi-screen environment, the {@code GraphicsConfiguration} * objects can be used to render components on multiple screens. The - * following code sample demonstrates how to create a JFrame - * object for each GraphicsConfiguration on each screen - * device in the GraphicsEnvironment: + * following code sample demonstrates how to create a {@code JFrame} + * object for each {@code GraphicsConfiguration} on each screen + * device in the {@code GraphicsEnvironment}: *

      {@code
        *   GraphicsEnvironment ge = GraphicsEnvironment.
        *   getLocalGraphicsEnvironment();
      @@ -142,8 +142,8 @@ public abstract class GraphicsDevice {
           }
       
           /**
      -     * Returns the type of this GraphicsDevice.
      -     * @return the type of this GraphicsDevice, which can
      +     * Returns the type of this {@code GraphicsDevice}.
      +     * @return the type of this {@code GraphicsDevice}, which can
            * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER.
            * @see #TYPE_RASTER_SCREEN
            * @see #TYPE_PRINTER
      @@ -153,52 +153,52 @@ public abstract class GraphicsDevice {
       
           /**
            * Returns the identification string associated with this
      -     * GraphicsDevice.
      +     * {@code GraphicsDevice}.
            * 

      * A particular program might use more than one - * GraphicsDevice in a GraphicsEnvironment. - * This method returns a String identifying a - * particular GraphicsDevice in the local - * GraphicsEnvironment. Although there is - * no public method to set this String, a programmer can - * use the String for debugging purposes. Vendors of + * {@code GraphicsDevice} in a {@code GraphicsEnvironment}. + * This method returns a {@code String} identifying a + * particular {@code GraphicsDevice} in the local + * {@code GraphicsEnvironment}. Although there is + * no public method to set this {@code String}, a programmer can + * use the {@code String} for debugging purposes. Vendors of * the Java™ Runtime Environment can - * format the return value of the String. To determine - * how to interpret the value of the String, contact the + * format the return value of the {@code String}. To determine + * how to interpret the value of the {@code String}, contact the * vendor of your Java Runtime. To find out who the vendor is, from * your program, call the * {@link System#getProperty(String) getProperty} method of the * System class with "java.vendor". - * @return a String that is the identification - * of this GraphicsDevice. + * @return a {@code String} that is the identification + * of this {@code GraphicsDevice}. */ public abstract String getIDstring(); /** - * Returns all of the GraphicsConfiguration - * objects associated with this GraphicsDevice. - * @return an array of GraphicsConfiguration + * Returns all of the {@code GraphicsConfiguration} + * objects associated with this {@code GraphicsDevice}. + * @return an array of {@code GraphicsConfiguration} * objects that are associated with this - * GraphicsDevice. + * {@code GraphicsDevice}. */ public abstract GraphicsConfiguration[] getConfigurations(); /** - * Returns the default GraphicsConfiguration - * associated with this GraphicsDevice. - * @return the default GraphicsConfiguration - * of this GraphicsDevice. + * Returns the default {@code GraphicsConfiguration} + * associated with this {@code GraphicsDevice}. + * @return the default {@code GraphicsConfiguration} + * of this {@code GraphicsDevice}. */ public abstract GraphicsConfiguration getDefaultConfiguration(); /** * Returns the "best" configuration possible that passes the * criteria defined in the {@link GraphicsConfigTemplate}. - * @param gct the GraphicsConfigTemplate object - * used to obtain a valid GraphicsConfiguration - * @return a GraphicsConfiguration that passes + * @param gct the {@code GraphicsConfigTemplate} object + * used to obtain a valid {@code GraphicsConfiguration} + * @return a {@code GraphicsConfiguration} that passes * the criteria defined in the specified - * GraphicsConfigTemplate. + * {@code GraphicsConfigTemplate}. * @see GraphicsConfigTemplate */ public GraphicsConfiguration @@ -208,12 +208,12 @@ public abstract class GraphicsDevice { } /** - * Returns true if this GraphicsDevice + * Returns {@code true} if this {@code GraphicsDevice} * supports full-screen exclusive mode. * If a SecurityManager is installed, its - * checkPermission method will be called - * with AWTPermission("fullScreenExclusive"). - * isFullScreenSupported returns true only if + * {@code checkPermission} method will be called + * with {@code AWTPermission("fullScreenExclusive")}. + * {@code isFullScreenSupported} returns true only if * that permission is granted. * @return whether full-screen exclusive mode is available for * this graphics device @@ -227,8 +227,8 @@ public abstract class GraphicsDevice { /** * Enter full-screen mode, or return to windowed mode. The entered * full-screen mode may be either exclusive or simulated. Exclusive - * mode is only available if isFullScreenSupported - * returns true. + * mode is only available if {@code isFullScreenSupported} + * returns {@code true}. *

      * Exclusive mode implies: *

        @@ -239,7 +239,7 @@ public abstract class GraphicsDevice { * will cause the existing full-screen window to * return to windowed mode. *
      • Input method windows are disabled. It is advisable to call - * Component.enableInputMethods(false) to make a component + * {@code Component.enableInputMethods(false)} to make a component * a non-client of the input method framework. *
      *

      @@ -341,10 +341,10 @@ public abstract class GraphicsDevice { } /** - * Returns the Window object representing the + * Returns the {@code Window} object representing the * full-screen window if the device is in full-screen mode. * - * @return the full-screen window, or null if the device is + * @return the full-screen window, or {@code null} if the device is * not in full-screen mode. * @see #setFullScreenWindow(Window) * @since 1.4 @@ -362,7 +362,7 @@ public abstract class GraphicsDevice { } /** - * Returns true if this GraphicsDevice + * Returns {@code true} if this {@code GraphicsDevice} * supports low-level display changes. * On some platforms low-level display changes may only be allowed in * full-screen exclusive mode (i.e., if {@link #isFullScreenSupported()} @@ -420,11 +420,11 @@ public abstract class GraphicsDevice { *

      * * @param dm The new display mode of this graphics device. - * @exception IllegalArgumentException if the DisplayMode - * supplied is null, or is not available in the array returned - * by getDisplayModes + * @exception IllegalArgumentException if the {@code DisplayMode} + * supplied is {@code null}, or is not available in the array returned + * by {@code getDisplayModes} * @exception UnsupportedOperationException if - * isDisplayChangeSupported returns false + * {@code isDisplayChangeSupported} returns {@code false} * @see #getDisplayMode * @see #getDisplayModes * @see #isDisplayChangeSupported @@ -436,7 +436,7 @@ public abstract class GraphicsDevice { /** * Returns the current display mode of this - * GraphicsDevice. + * {@code GraphicsDevice}. * The returned display mode is allowed to have a refresh rate * {@link DisplayMode#REFRESH_RATE_UNKNOWN} if it is indeterminate. * Likewise, the returned display mode is allowed to have a bit depth @@ -455,7 +455,7 @@ public abstract class GraphicsDevice { /** * Returns all display modes available for this - * GraphicsDevice. + * {@code GraphicsDevice}. * The returned display modes are allowed to have a refresh rate * {@link DisplayMode#REFRESH_RATE_UNKNOWN} if it is indeterminate. * Likewise, the returned display modes are allowed to have a bit depth diff --git a/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java b/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java index af6a7383649..ab2a8467e9a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java @@ -39,16 +39,16 @@ import sun.security.action.GetPropertyAction; /** * - * The GraphicsEnvironment class describes the collection + * The {@code GraphicsEnvironment} class describes the collection * of {@link GraphicsDevice} objects and {@link java.awt.Font} objects * available to a Java(tm) application on a particular platform. - * The resources in this GraphicsEnvironment might be local - * or on a remote machine. GraphicsDevice objects can be + * The resources in this {@code GraphicsEnvironment} might be local + * or on a remote machine. {@code GraphicsDevice} objects can be * screens, printers or image buffers and are the destination of - * {@link Graphics2D} drawing methods. Each GraphicsDevice + * {@link Graphics2D} drawing methods. Each {@code GraphicsDevice} * has a number of {@link GraphicsConfiguration} objects associated with * it. These objects specify the different configurations in which the - * GraphicsDevice can be used. + * {@code GraphicsDevice} can be used. * @see GraphicsDevice * @see GraphicsConfiguration */ @@ -74,8 +74,8 @@ public abstract class GraphicsEnvironment { } /** - * Returns the local GraphicsEnvironment. - * @return the local GraphicsEnvironment + * Returns the local {@code GraphicsEnvironment}. + * @return the local {@code GraphicsEnvironment} */ public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment() { if (localEnv == null) { @@ -132,8 +132,8 @@ public abstract class GraphicsEnvironment { * a HeadlessException is thrown from areas of the Toolkit * and GraphicsEnvironment that are dependent on a display, * keyboard, or mouse. - * @return true if this environment cannot support - * a display, keyboard, and mouse; false + * @return {@code true} if this environment cannot support + * a display, keyboard, and mouse; {@code false} * otherwise * @see java.awt.HeadlessException * @since 1.4 @@ -209,11 +209,11 @@ public abstract class GraphicsEnvironment { /** * Returns whether or not a display, keyboard, and mouse can be * supported in this graphics environment. If this returns true, - * HeadlessException will be thrown from areas of the + * {@code HeadlessException} will be thrown from areas of the * graphics environment that are dependent on a display, keyboard, or * mouse. - * @return true if a display, keyboard, and mouse - * can be supported in this environment; false + * @return {@code true} if a display, keyboard, and mouse + * can be supported in this environment; {@code false} * otherwise * @see java.awt.HeadlessException * @see #isHeadless @@ -226,9 +226,9 @@ public abstract class GraphicsEnvironment { } /** - * Returns an array of all of the screen GraphicsDevice + * Returns an array of all of the screen {@code GraphicsDevice} * objects. - * @return an array containing all the GraphicsDevice + * @return an array containing all the {@code GraphicsDevice} * objects that represent screen devices * @exception HeadlessException if isHeadless() returns true * @see #isHeadless() @@ -237,8 +237,8 @@ public abstract class GraphicsEnvironment { throws HeadlessException; /** - * Returns the default screen GraphicsDevice. - * @return the GraphicsDevice that represents the + * Returns the default screen {@code GraphicsDevice}. + * @return the {@code GraphicsDevice} that represents the * default screen device * @exception HeadlessException if isHeadless() returns true * @see #isHeadless() @@ -247,35 +247,35 @@ public abstract class GraphicsEnvironment { throws HeadlessException; /** - * Returns a Graphics2D object for rendering into the + * Returns a {@code Graphics2D} object for rendering into the * specified {@link BufferedImage}. - * @param img the specified BufferedImage - * @return a Graphics2D to be used for rendering into - * the specified BufferedImage - * @throws NullPointerException if img is null + * @param img the specified {@code BufferedImage} + * @return a {@code Graphics2D} to be used for rendering into + * the specified {@code BufferedImage} + * @throws NullPointerException if {@code img} is null */ public abstract Graphics2D createGraphics(BufferedImage img); /** * Returns an array containing a one-point size instance of all fonts - * available in this GraphicsEnvironment. Typical usage + * available in this {@code GraphicsEnvironment}. Typical usage * would be to allow a user to select a particular font. Then, the * application can size the font and set various font attributes by - * calling the deriveFont method on the chosen instance. + * calling the {@code deriveFont} method on the chosen instance. *

      * This method provides for the application the most precise control - * over which Font instance is used to render text. - * If a font in this GraphicsEnvironment has multiple + * over which {@code Font} instance is used to render text. + * If a font in this {@code GraphicsEnvironment} has multiple * programmable variations, only one - * instance of that Font is returned in the array, and + * instance of that {@code Font} is returned in the array, and * other variations must be derived by the application. *

      * If a font in this environment has multiple programmable variations, * such as Multiple-Master fonts, only one instance of that font is - * returned in the Font array. The other variations + * returned in the {@code Font} array. The other variations * must be derived by the application. * - * @return an array of Font objects + * @return an array of {@code Font} objects * @see #getAvailableFontFamilyNames * @see java.awt.Font * @see java.awt.Font#deriveFont @@ -286,8 +286,8 @@ public abstract class GraphicsEnvironment { /** * Returns an array containing the names of all font families in this - * GraphicsEnvironment localized for the default locale, - * as returned by Locale.getDefault(). + * {@code GraphicsEnvironment} localized for the default locale, + * as returned by {@code Locale.getDefault()}. *

      * Typical usage would be for presentation to a user for selection of * a particular family name. An application can then specify this name @@ -295,7 +295,7 @@ public abstract class GraphicsEnvironment { * italic, giving the font system flexibility in choosing its own best * match among multiple fonts in the same font family. * - * @return an array of String containing font family names + * @return an array of {@code String} containing font family names * localized for the default locale, or a suitable alternative * name if no name exists for this locale. * @see #getAllFonts @@ -307,7 +307,7 @@ public abstract class GraphicsEnvironment { /** * Returns an array containing the names of all font families in this - * GraphicsEnvironment localized for the specified locale. + * {@code GraphicsEnvironment} localized for the specified locale. *

      * Typical usage would be for presentation to a user for selection of * a particular family name. An application can then specify this name @@ -317,10 +317,10 @@ public abstract class GraphicsEnvironment { * * @param l a {@link Locale} object that represents a * particular geographical, political, or cultural region. - * Specifying null is equivalent to - * specifying Locale.getDefault(). - * @return an array of String containing font family names - * localized for the specified Locale, or a + * Specifying {@code null} is equivalent to + * specifying {@code Locale.getDefault()}. + * @return an array of {@code String} containing font family names + * localized for the specified {@code Locale}, or a * suitable alternative name if no name exists for the specified locale. * @see #getAllFonts * @see java.awt.Font @@ -330,24 +330,24 @@ public abstract class GraphicsEnvironment { public abstract String[] getAvailableFontFamilyNames(Locale l); /** - * Registers a created Fontin this - * GraphicsEnvironment. + * Registers a created {@code Font} in this + * {@code GraphicsEnvironment}. * A created font is one that was returned from calling * {@link Font#createFont}, or derived from a created font by * calling {@link Font#deriveFont}. * After calling this method for such a font, it is available to - * be used in constructing new Fonts by name or family name, + * be used in constructing new {@code Font}s by name or family name, * and is enumerated by {@link #getAvailableFontFamilyNames} and * {@link #getAllFonts} within the execution context of this * application or applet. This means applets cannot register fonts in * a way that they are visible to other applets. *

      * Reasons that this method might not register the font and therefore - * return false are: + * return {@code false} are: *

        - *
      • The font is not a created Font. - *
      • The font conflicts with a non-created Font already - * in this GraphicsEnvironment. For example if the name + *
      • The font is not a created {@code Font}. + *
      • The font conflicts with a non-created {@code Font} already + * in this {@code GraphicsEnvironment}. For example if the name * is that of a system font, or a logical font as described in the * documentation of the {@link Font} class. It is implementation dependent * whether a font may also conflict if it has the same family name @@ -357,9 +357,9 @@ public abstract class GraphicsEnvironment { *
      * * @param font the font to be registered - * @return true if the font is successfully - * registered in this GraphicsEnvironment. - * @throws NullPointerException if font is null + * @return true if the {@code font} is successfully + * registered in this {@code GraphicsEnvironment}. + * @throws NullPointerException if {@code font} is null * @since 1.6 */ public boolean registerFont(Font font) { @@ -444,8 +444,8 @@ public abstract class GraphicsEnvironment { * entire display area. *

      * To get the usable bounds of a single display, use - * GraphicsConfiguration.getBounds() and - * Toolkit.getScreenInsets(). + * {@code GraphicsConfiguration.getBounds()} and + * {@code Toolkit.getScreenInsets()}. * @return the maximum bounds for centered Windows * * @exception HeadlessException if isHeadless() returns true diff --git a/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java b/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java index e676e4c74ad..566c50b67dd 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GridBagConstraints.java @@ -25,9 +25,9 @@ package java.awt; /** - * The GridBagConstraints class specifies constraints + * The {@code GridBagConstraints} class specifies constraints * for components that are laid out using the - * GridBagLayout class. + * {@code GridBagLayout} class. * * @author Doug Stein * @author Bill Spitzak (orignial NeWS & OLIT implementation) @@ -38,9 +38,9 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { /** * Specifies that this component is the next-to-last component in its - * column or row (gridwidth, gridheight), + * column or row ({@code gridwidth}, {@code gridheight}), * or that this component be placed next to the previously added - * component (gridx, gridy). + * component ({@code gridx}, {@code gridy}). * @see java.awt.GridBagConstraints#gridwidth * @see java.awt.GridBagConstraints#gridheight * @see java.awt.GridBagConstraints#gridx @@ -194,7 +194,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int LAST_LINE_END = 26; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally centered and * vertically aligned along the baseline of the prevailing row. * If the component does not have a baseline it will be vertically @@ -205,7 +205,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BASELINE = 0x100; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * leading edge. For components with a left-to-right orientation, * the leading edge is the left edge. Vertically the component is @@ -218,7 +218,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BASELINE_LEADING = 0x200; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * trailing edge. For components with a left-to-right * orientation, the trailing edge is the right edge. Vertically @@ -231,7 +231,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BASELINE_TRAILING = 0x300; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally centered. Vertically * the component is positioned so that its bottom edge touches * the baseline of the starting row. If the starting row does not @@ -242,7 +242,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int ABOVE_BASELINE = 0x400; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * leading edge. For components with a left-to-right orientation, * the leading edge is the left edge. Vertically the component is @@ -255,7 +255,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int ABOVE_BASELINE_LEADING = 0x500; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * trailing edge. For components with a left-to-right * orientation, the trailing edge is the right edge. Vertically @@ -268,7 +268,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int ABOVE_BASELINE_TRAILING = 0x600; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally centered. Vertically * the component is positioned so that its top edge touches the * baseline of the starting row. If the starting row does not @@ -279,7 +279,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BELOW_BASELINE = 0x700; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * leading edge. For components with a left-to-right orientation, * the leading edge is the left edge. Vertically the component is @@ -292,7 +292,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { public static final int BELOW_BASELINE_LEADING = 0x800; /** - * Possible value for the anchor field. Specifies + * Possible value for the {@code anchor} field. Specifies * that the component should be horizontally placed along the * trailing edge. For components with a left-to-right * orientation, the trailing edge is the right edge. Vertically @@ -306,17 +306,17 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { /** * Specifies the cell containing the leading edge of the component's - * display area, where the first cell in a row has gridx=0. + * display area, where the first cell in a row has {@code gridx=0}. * The leading edge of a component's display area is its left edge for * a horizontal, left-to-right container and its right edge for a * horizontal, right-to-left container. * The value - * RELATIVE specifies that the component be placed + * {@code RELATIVE} specifies that the component be placed * immediately following the component that was added to the container * just before this component was added. *

      - * The default value is RELATIVE. - * gridx should be a non-negative value. + * The default value is {@code RELATIVE}. + * {@code gridx} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#gridy @@ -326,13 +326,13 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { /** * Specifies the cell at the top of the component's display area, - * where the topmost cell has gridy=0. The value - * RELATIVE specifies that the component be placed just + * where the topmost cell has {@code gridy=0}. The value + * {@code RELATIVE} specifies that the component be placed just * below the component that was added to the container just before * this component was added. *

      - * The default value is RELATIVE. - * gridy should be a non-negative value. + * The default value is {@code RELATIVE}. + * {@code gridy} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#gridx @@ -343,14 +343,14 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies the number of cells in a row for the component's * display area. *

      - * Use REMAINDER to specify that the component's - * display area will be from gridx to the last + * Use {@code REMAINDER} to specify that the component's + * display area will be from {@code gridx} to the last * cell in the row. - * Use RELATIVE to specify that the component's - * display area will be from gridx to the next + * Use {@code RELATIVE} to specify that the component's + * display area will be from {@code gridx} to the next * to the last one in its row. *

      - * gridwidth should be non-negative and the default + * {@code gridwidth} should be non-negative and the default * value is 1. * @serial * @see #clone() @@ -362,14 +362,14 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies the number of cells in a column for the component's * display area. *

      - * Use REMAINDER to specify that the component's - * display area will be from gridy to the last + * Use {@code REMAINDER} to specify that the component's + * display area will be from {@code gridy} to the last * cell in the column. - * Use RELATIVE to specify that the component's - * display area will be from gridy to the next + * Use {@code RELATIVE} to specify that the component's + * display area will be from {@code gridy} to the next * to the last one in its column. *

      - * gridheight should be a non-negative value and the + * {@code gridheight} should be a non-negative value and the * default value is 1. * @serial * @see #clone() @@ -381,7 +381,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies how to distribute extra horizontal space. *

      * The grid bag layout manager calculates the weight of a column to - * be the maximum weightx of all the components in a + * be the maximum {@code weightx} of all the components in a * column. If the resulting layout is smaller horizontally than the area * it needs to fill, the extra space is distributed to each column in * proportion to its weight. A column that has a weight of zero receives @@ -390,8 +390,8 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * If all the weights are zero, all the extra space appears between * the grids of the cell and the left and right edges. *

      - * The default value of this field is 0. - * weightx should be a non-negative value. + * The default value of this field is {@code 0}. + * {@code weightx} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#weighty @@ -402,7 +402,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * Specifies how to distribute extra vertical space. *

      * The grid bag layout manager calculates the weight of a row to be - * the maximum weighty of all the components in a row. + * the maximum {@code weighty} of all the components in a row. * If the resulting layout is smaller vertically than the area it * needs to fill, the extra space is distributed to each row in * proportion to its weight. A row that has a weight of zero receives no @@ -411,8 +411,8 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * If all the weights are zero, all the extra space appears between * the grids of the cell and the top and bottom edges. *

      - * The default value of this field is 0. - * weighty should be a non-negative value. + * The default value of this field is {@code 0}. + * {@code weighty} should be a non-negative value. * @serial * @see #clone() * @see java.awt.GridBagConstraints#weightx @@ -429,22 +429,22 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * orientation property, baseline relative values are interpreted * relative to the baseline and absolute values are not. The * absolute values are: - * CENTER, NORTH, NORTHEAST, - * EAST, SOUTHEAST, SOUTH, - * SOUTHWEST, WEST, and NORTHWEST. - * The orientation relative values are: PAGE_START, - * PAGE_END, - * LINE_START, LINE_END, - * FIRST_LINE_START, FIRST_LINE_END, - * LAST_LINE_START and LAST_LINE_END. The + * {@code CENTER}, {@code NORTH}, {@code NORTHEAST}, + * {@code EAST}, {@code SOUTHEAST}, {@code SOUTH}, + * {@code SOUTHWEST}, {@code WEST}, and {@code NORTHWEST}. + * The orientation relative values are: {@code PAGE_START}, + * {@code PAGE_END}, + * {@code LINE_START}, {@code LINE_END}, + * {@code FIRST_LINE_START}, {@code FIRST_LINE_END}, + * {@code LAST_LINE_START} and {@code LAST_LINE_END}. The * baseline relative values are: - * BASELINE, BASELINE_LEADING, - * BASELINE_TRAILING, - * ABOVE_BASELINE, ABOVE_BASELINE_LEADING, - * ABOVE_BASELINE_TRAILING, - * BELOW_BASELINE, BELOW_BASELINE_LEADING, - * and BELOW_BASELINE_TRAILING. - * The default value is CENTER. + * {@code BASELINE}, {@code BASELINE_LEADING}, + * {@code BASELINE_TRAILING}, + * {@code ABOVE_BASELINE}, {@code ABOVE_BASELINE_LEADING}, + * {@code ABOVE_BASELINE_TRAILING}, + * {@code BELOW_BASELINE}, {@code BELOW_BASELINE_LEADING}, + * and {@code BELOW_BASELINE_TRAILING}. + * The default value is {@code CENTER}. * @serial * @see #clone() * @see java.awt.ComponentOrientation @@ -456,23 +456,23 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * than the component's requested size. It determines whether to * resize the component, and if so, how. *

      - * The following values are valid for fill: + * The following values are valid for {@code fill}: * *

        *
      • - * NONE: Do not resize the component. + * {@code NONE}: Do not resize the component. *
      • - * HORIZONTAL: Make the component wide enough to fill + * {@code HORIZONTAL}: Make the component wide enough to fill * its display area horizontally, but do not change its height. *
      • - * VERTICAL: Make the component tall enough to fill its + * {@code VERTICAL}: Make the component tall enough to fill its * display area vertically, but do not change its width. *
      • - * BOTH: Make the component fill its display area + * {@code BOTH}: Make the component fill its display area * entirely. *
      *

      - * The default value is NONE. + * The default value is {@code NONE}. * @serial * @see #clone() */ @@ -483,7 +483,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * minimum amount of space between the component and the edges of its * display area. *

      - * The default value is new Insets(0, 0, 0, 0). + * The default value is {@code new Insets(0, 0, 0, 0)}. * @serial * @see #clone() */ @@ -493,9 +493,9 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * This field specifies the internal padding of the component, how much * space to add to the minimum width of the component. The width of * the component is at least its minimum width plus - * ipadx pixels. + * {@code ipadx} pixels. *

      - * The default value is 0. + * The default value is {@code 0}. * @serial * @see #clone() * @see java.awt.GridBagConstraints#ipady @@ -506,7 +506,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { * This field specifies the internal padding, that is, how much * space to add to the minimum height of the component. The height of * the component is at least its minimum height plus - * ipady pixels. + * {@code ipady} pixels. *

      * The default value is 0. * @serial @@ -537,14 +537,14 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { int tempHeight; /** * The minimum width of the component. It is used to calculate - * ipady, where the default will be 0. + * {@code ipady}, where the default will be 0. * @serial * @see #ipady */ int minWidth; /** * The minimum height of the component. It is used to calculate - * ipadx, where the default will be 0. + * {@code ipadx}, where the default will be 0. * @serial * @see #ipadx */ @@ -571,7 +571,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { private static final long serialVersionUID = -1000070633030801713L; /** - * Creates a GridBagConstraint object with + * Creates a {@code GridBagConstraint} object with * all of its fields set to their default value. */ public GridBagConstraints () { @@ -591,7 +591,7 @@ public class GridBagConstraints implements Cloneable, java.io.Serializable { } /** - * Creates a GridBagConstraints object with + * Creates a {@code GridBagConstraints} object with * all of its fields set to the passed-in arguments. * * Note: Because the use of this constructor hinders readability diff --git a/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java b/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java index 7c86dcc1f67..1ecf40840ea 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java +++ b/jdk/src/java.desktop/share/classes/java/awt/GridBagLayout.java @@ -28,18 +28,18 @@ import java.util.Hashtable; import java.util.Arrays; /** - * The GridBagLayout class is a flexible layout + * The {@code GridBagLayout} class is a flexible layout * manager that aligns components vertically, horizontally or along their * baseline without requiring that the components be of the same size. - * Each GridBagLayout object maintains a dynamic, + * Each {@code GridBagLayout} object maintains a dynamic, * rectangular grid of cells, with each component occupying * one or more cells, called its display area. *

      - * Each component managed by a GridBagLayout is associated with + * Each component managed by a {@code GridBagLayout} is associated with * an instance of {@link GridBagConstraints}. The constraints object * specifies where a component's display area should be located on the grid * and how the component should be positioned within its display area. In - * addition to its constraints object, the GridBagLayout also + * addition to its constraints object, the {@code GridBagLayout} also * considers each component's minimum and preferred sizes in order to * determine a component's size. *

      @@ -52,8 +52,8 @@ import java.util.Arrays; * increasing downward. *

      * To use a grid bag layout effectively, you must customize one or more - * of the GridBagConstraints objects that are associated - * with its components. You customize a GridBagConstraints + * of the {@code GridBagConstraints} objects that are associated + * with its components. You customize a {@code GridBagConstraints} * object by setting one or more of its instance variables: * *

      @@ -65,51 +65,51 @@ import java.util.Arrays; * gridy = 0. For horizontal left-to-right layout, * a component's leading corner is its upper left. For horizontal * right-to-left layout, a component's leading corner is its upper right. - * Use GridBagConstraints.RELATIVE (the default value) + * Use {@code GridBagConstraints.RELATIVE} (the default value) * to specify that the component be placed immediately following - * (along the x axis for gridx or the y axis for - * gridy) the component that was added to the container + * (along the x axis for {@code gridx} or the y axis for + * {@code gridy}) the component that was added to the container * just before this component was added. *
      {@link GridBagConstraints#gridwidth}, * {@link GridBagConstraints#gridheight} - *
      Specifies the number of cells in a row (for gridwidth) - * or column (for gridheight) + *
      Specifies the number of cells in a row (for {@code gridwidth}) + * or column (for {@code gridheight}) * in the component's display area. * The default value is 1. - * Use GridBagConstraints.REMAINDER to specify - * that the component's display area will be from gridx - * to the last cell in the row (for gridwidth) - * or from gridy to the last cell in the column - * (for gridheight). + * Use {@code GridBagConstraints.REMAINDER} to specify + * that the component's display area will be from {@code gridx} + * to the last cell in the row (for {@code gridwidth}) + * or from {@code gridy} to the last cell in the column + * (for {@code gridheight}). * - * Use GridBagConstraints.RELATIVE to specify - * that the component's display area will be from gridx - * to the next to the last cell in its row (for gridwidth - * or from gridy to the next to the last cell in its - * column (for gridheight). + * Use {@code GridBagConstraints.RELATIVE} to specify + * that the component's display area will be from {@code gridx} + * to the next to the last cell in its row (for {@code gridwidth} + * or from {@code gridy} to the next to the last cell in its + * column (for {@code gridheight}). * *
      {@link GridBagConstraints#fill} *
      Used when the component's display area * is larger than the component's requested size * to determine whether (and how) to resize the component. * Possible values are - * GridBagConstraints.NONE (the default), - * GridBagConstraints.HORIZONTAL + * {@code GridBagConstraints.NONE} (the default), + * {@code GridBagConstraints.HORIZONTAL} * (make the component wide enough to fill its display area * horizontally, but don't change its height), - * GridBagConstraints.VERTICAL + * {@code GridBagConstraints.VERTICAL} * (make the component tall enough to fill its display area * vertically, but don't change its width), and - * GridBagConstraints.BOTH + * {@code GridBagConstraints.BOTH} * (make the component fill its display area entirely). *
      {@link GridBagConstraints#ipadx}, * {@link GridBagConstraints#ipady} *
      Specifies the component's internal padding within the layout, * how much to add to the minimum size of the component. * The width of the component will be at least its minimum width - * plus ipadx pixels. Similarly, the height of + * plus {@code ipadx} pixels. Similarly, the height of * the component will be at least the minimum height plus - * ipady pixels. + * {@code ipady} pixels. *
      {@link GridBagConstraints#insets} *
      Specifies the component's external padding, the minimum * amount of space between the component and the edges of its display area. @@ -118,7 +118,7 @@ import java.util.Arrays; * There are three kinds of possible values: absolute, orientation-relative, * and baseline-relative * Orientation relative values are interpreted relative to the container's - * ComponentOrientation property while absolute values + * {@code ComponentOrientation} property while absolute values * are not. Baseline relative values are calculated relative to the * baseline. Valid values are: * @@ -132,40 +132,40 @@ import java.util.Arrays; * * *
        - *
      • GridBagConstraints.NORTH
      • - *
      • GridBagConstraints.SOUTH
      • - *
      • GridBagConstraints.WEST
      • - *
      • GridBagConstraints.EAST
      • - *
      • GridBagConstraints.NORTHWEST
      • - *
      • GridBagConstraints.NORTHEAST
      • - *
      • GridBagConstraints.SOUTHWEST
      • - *
      • GridBagConstraints.SOUTHEAST
      • - *
      • GridBagConstraints.CENTER (the default)
      • + *
      • {@code GridBagConstraints.NORTH}
      • + *
      • {@code GridBagConstraints.SOUTH}
      • + *
      • {@code GridBagConstraints.WEST}
      • + *
      • {@code GridBagConstraints.EAST}
      • + *
      • {@code GridBagConstraints.NORTHWEST}
      • + *
      • {@code GridBagConstraints.NORTHEAST}
      • + *
      • {@code GridBagConstraints.SOUTHWEST}
      • + *
      • {@code GridBagConstraints.SOUTHEAST}
      • + *
      • {@code GridBagConstraints.CENTER} (the default)
      • *
      * * *
        - *
      • GridBagConstraints.PAGE_START
      • - *
      • GridBagConstraints.PAGE_END
      • - *
      • GridBagConstraints.LINE_START
      • - *
      • GridBagConstraints.LINE_END
      • - *
      • GridBagConstraints.FIRST_LINE_START
      • - *
      • GridBagConstraints.FIRST_LINE_END
      • - *
      • GridBagConstraints.LAST_LINE_START
      • - *
      • GridBagConstraints.LAST_LINE_END
      • + *
      • {@code GridBagConstraints.PAGE_START}
      • + *
      • {@code GridBagConstraints.PAGE_END}
      • + *
      • {@code GridBagConstraints.LINE_START}
      • + *
      • {@code GridBagConstraints.LINE_END}
      • + *
      • {@code GridBagConstraints.FIRST_LINE_START}
      • + *
      • {@code GridBagConstraints.FIRST_LINE_END}
      • + *
      • {@code GridBagConstraints.LAST_LINE_START}
      • + *
      • {@code GridBagConstraints.LAST_LINE_END}
      • *
      * * *
        - *
      • GridBagConstraints.BASELINE
      • - *
      • GridBagConstraints.BASELINE_LEADING
      • - *
      • GridBagConstraints.BASELINE_TRAILING
      • - *
      • GridBagConstraints.ABOVE_BASELINE
      • - *
      • GridBagConstraints.ABOVE_BASELINE_LEADING
      • - *
      • GridBagConstraints.ABOVE_BASELINE_TRAILING
      • - *
      • GridBagConstraints.BELOW_BASELINE
      • - *
      • GridBagConstraints.BELOW_BASELINE_LEADING
      • - *
      • GridBagConstraints.BELOW_BASELINE_TRAILING
      • + *
      • {@code GridBagConstraints.BASELINE}
      • + *
      • {@code GridBagConstraints.BASELINE_LEADING}
      • + *
      • {@code GridBagConstraints.BASELINE_TRAILING}
      • + *
      • {@code GridBagConstraints.ABOVE_BASELINE}
      • + *
      • {@code GridBagConstraints.ABOVE_BASELINE_LEADING}
      • + *
      • {@code GridBagConstraints.ABOVE_BASELINE_TRAILING}
      • + *
      • {@code GridBagConstraints.BELOW_BASELINE}
      • + *
      • {@code GridBagConstraints.BELOW_BASELINE_LEADING}
      • + *
      • {@code GridBagConstraints.BELOW_BASELINE_TRAILING}
      • *
      * * @@ -175,10 +175,10 @@ import java.util.Arrays; *
      Used to determine how to distribute space, which is * important for specifying resizing behavior. * Unless you specify a weight for at least one component - * in a row (weightx) and column (weighty), + * in a row ({@code weightx}) and column ({@code weighty}), * all the components clump together in the center of their container. * This is because when the weight is zero (the default), - * the GridBagLayout object puts any extra space + * the {@code GridBagLayout} object puts any extra space * between its grid of cells and the edges of the container. *
      *

      @@ -206,12 +206,12 @@ import java.util.Arrays; * * This layout consists of three components: *

      • A panel that starts in row 0 and ends in row 1. The panel - * has a baseline-resize behavior of CONSTANT_DESCENT and has - * an anchor of BASELINE. As the baseline-resize behavior - * is CONSTANT_DESCENT the prevailing row for the panel is + * has a baseline-resize behavior of {@code CONSTANT_DESCENT} and has + * an anchor of {@code BASELINE}. As the baseline-resize behavior + * is {@code CONSTANT_DESCENT} the prevailing row for the panel is * row 1. *
      • Two buttons, each with a baseline-resize behavior of - * CENTER_OFFSET and an anchor of BASELINE. + * {@code CENTER_OFFSET} and an anchor of {@code BASELINE}. *
      * Because the second button and the panel share the same prevailing row, * they are both aligned along their baseline. @@ -221,7 +221,7 @@ import java.util.Arrays; * value. How components change is dictated by how the baseline of the * prevailing row changes. The baseline is anchored to the * bottom of the display area if any components with the same prevailing row - * have a baseline-resize behavior of CONSTANT_DESCENT, + * have a baseline-resize behavior of {@code CONSTANT_DESCENT}, * otherwise the baseline is anchored to the top of the display area. * The following rules dictate the resize behavior: *
        @@ -233,12 +233,12 @@ import java.util.Arrays; * only grow as high as the difference between the display height and the * baseline. *
      • Resizable components positioned on the baseline with a - * baseline-resize behavior of OTHER are only resized if + * baseline-resize behavior of {@code OTHER} are only resized if * the baseline at the resized size fits within the display area. If * the baseline is such that it does not fit within the display area * the component is not resized. *
      • Components positioned on the baseline that do not have a - * baseline-resize behavior of OTHER + * baseline-resize behavior of {@code OTHER} * can only grow as tall as {@code display height - baseline + baseline of component}. *
      * If you position a component along the baseline, but the @@ -266,9 +266,9 @@ import java.util.Arrays; * * *

      - * Each of the ten components has the fill field - * of its associated GridBagConstraints object - * set to GridBagConstraints.BOTH. + * Each of the ten components has the {@code fill} field + * of its associated {@code GridBagConstraints} object + * set to {@code GridBagConstraints.BOTH}. * In addition, the components have the following non-default constraints: * *

        @@ -387,8 +387,8 @@ java.io.Serializable { /** * This hashtable maintains the association between * a component and its gridbag constraints. - * The Keys in comptable are the components and the - * values are the instances of GridBagConstraints. + * The Keys in {@code comptable} are the components and the + * values are the instances of {@code GridBagConstraints}. * * @serial * @see java.awt.GridBagConstraints @@ -400,7 +400,7 @@ java.io.Serializable { * containing the default values, so if a component * does not have gridbag constraints associated with * it, then the component will be assigned a - * copy of the defaultConstraints. + * copy of the {@code defaultConstraints}. * * @serial * @see #getConstraints(Component) @@ -414,7 +414,7 @@ java.io.Serializable { * for the gridbag. The information in this field * is based on the most recent validation of the * gridbag. - * If layoutInfo is null + * If {@code layoutInfo} is {@code null} * this indicates that there are no components in * the gridbag or if there are components, they have * not yet been validated. @@ -426,7 +426,7 @@ java.io.Serializable { /** * This field holds the overrides to the column minimum - * width. If this field is non-null the values are + * width. If this field is non-{@code null} the values are * applied to the gridbag after all of the minimum columns * widths have been calculated. * If columnWidths has more elements than the number of @@ -440,12 +440,12 @@ java.io.Serializable { /** * This field holds the overrides to the row minimum - * heights. If this field is non-null the values are + * heights. If this field is non-{@code null} the values are * applied to the gridbag after all of the minimum row * heights have been calculated. - * If rowHeights has more elements than the number of + * If {@code rowHeights} has more elements than the number of * rows, rows are added to the gridbag to match - * the number of elements in rowHeights. + * the number of elements in {@code rowHeights}. * * @serial * @see #getLayoutDimensions() @@ -454,12 +454,12 @@ java.io.Serializable { /** * This field holds the overrides to the column weights. - * If this field is non-null the values are + * If this field is non-{@code null} the values are * applied to the gridbag after all of the columns * weights have been calculated. - * If columnWeights[i] > weight for column i, then - * column i is assigned the weight in columnWeights[i]. - * If columnWeights has more elements than the number + * If {@code columnWeights[i] >} weight for column i, then + * column i is assigned the weight in {@code columnWeights[i]}. + * If {@code columnWeights} has more elements than the number * of columns, the excess elements are ignored - they do * not cause more columns to be created. * @@ -469,12 +469,12 @@ java.io.Serializable { /** * This field holds the overrides to the row weights. - * If this field is non-null the values are + * If this field is non-{@code null} the values are * applied to the gridbag after all of the rows * weights have been calculated. - * If rowWeights[i] > weight for row i, then - * row i is assigned the weight in rowWeights[i]. - * If rowWeights has more elements than the number + * If {@code rowWeights[i] > } weight for row i, then + * row i is assigned the weight in {@code rowWeights[i]}. + * If {@code rowWeights} has more elements than the number * of rows, the excess elements are ignored - they do * not cause more rows to be created. * @@ -484,7 +484,7 @@ java.io.Serializable { /** * The component being positioned. This is set before calling into - * adjustForGravity. + * {@code adjustForGravity}. */ private Component componentAdjusting; @@ -507,7 +507,7 @@ java.io.Serializable { /** * Gets the constraints for the specified component. A copy of - * the actual GridBagConstraints object is returned. + * the actual {@code GridBagConstraints} object is returned. * @param comp the component to be queried * @return the constraint for the specified component in this * grid bag layout; a copy of the actual constraint @@ -525,12 +525,12 @@ java.io.Serializable { /** * Retrieves the constraints for the specified component. * The return value is not a copy, but is the actual - * GridBagConstraints object used by the layout mechanism. + * {@code GridBagConstraints} object used by the layout mechanism. *

        - * If comp is not in the GridBagLayout, - * a set of default GridBagConstraints are returned. - * A comp value of null is invalid - * and returns null. + * If {@code comp} is not in the {@code GridBagLayout}, + * a set of default {@code GridBagConstraints} are returned. + * A {@code comp} value of {@code null} is invalid + * and returns {@code null}. * * @param comp the component to be queried * @return the constraints for the specified component @@ -556,7 +556,7 @@ java.io.Serializable { * Determines the origin of the layout area, in the graphics coordinate * space of the target container. This value represents the pixel * coordinates of the top-left corner of the layout area regardless of - * the ComponentOrientation value of the container. This + * the {@code ComponentOrientation} value of the container. This * is distinct from the grid origin given by the cell coordinates (0,0). * Most applications do not call this method directly. * @return the graphics origin of the cell in the top-left @@ -631,16 +631,16 @@ java.io.Serializable { *

        * If the (x, y) point lies * outside the grid, the following rules are used. - * The column index is returned as zero if x lies to the + * The column index is returned as zero if {@code x} lies to the * left of the layout for a left-to-right container or to the right of * the layout for a right-to-left container. The column index is returned - * as the number of columns if x lies + * as the number of columns if {@code x} lies * to the right of the layout in a left-to-right container or to the left * in a right-to-left container. - * The row index is returned as zero if y lies above the - * layout, and as the number of rows if y lies + * The row index is returned as zero if {@code y} lies above the + * layout, and as the number of rows if {@code y} lies * below the layout. The orientation of a container is determined by its - * ComponentOrientation property. + * {@code ComponentOrientation} property. * @param x the x coordinate of a point * @param y the y coordinate of a point * @return an ordered pair of indexes that indicate which cell @@ -692,14 +692,14 @@ java.io.Serializable { /** * Adds the specified component to the layout, using the specified - * constraints object. Note that constraints + * {@code constraints} object. Note that constraints * are mutable and are, therefore, cloned when cached. * * @param comp the component to be added * @param constraints an object that determines how * the component is added to the layout - * @exception IllegalArgumentException if constraints - * is not a GridBagConstraint + * @exception IllegalArgumentException if {@code constraints} + * is not a {@code GridBagConstraint} */ public void addLayoutComponent(Component comp, Object constraints) { if (constraints instanceof GridBagConstraints) { @@ -722,14 +722,14 @@ java.io.Serializable { } /** - * Determines the preferred size of the parent + * Determines the preferred size of the {@code parent} * container using this grid bag layout. *

        * Most applications do not call this method directly. * * @param parent the container in which to do the layout * @see java.awt.Container#getPreferredSize - * @return the preferred size of the parent + * @return the preferred size of the {@code parent} * container */ public Dimension preferredLayoutSize(Container parent) { @@ -738,13 +738,13 @@ java.io.Serializable { } /** - * Determines the minimum size of the parent container + * Determines the minimum size of the {@code parent} container * using this grid bag layout. *

        * Most applications do not call this method directly. * @param parent the container in which to do the layout * @see java.awt.Container#doLayout - * @return the minimum size of the parent container + * @return the minimum size of the {@code parent} container */ public Dimension minimumLayoutSize(Container parent) { GridBagLayoutInfo info = getLayoutInfo(parent, MINSIZE); @@ -771,7 +771,7 @@ java.io.Serializable { * where 0 represents alignment along the origin, 1 is aligned * the furthest away from the origin, 0.5 is centered, etc. * - * @return the value 0.5f to indicate centered + * @return the value {@code 0.5f} to indicate centered */ public float getLayoutAlignmentX(Container parent) { return 0.5f; @@ -784,7 +784,7 @@ java.io.Serializable { * where 0 represents alignment along the origin, 1 is aligned * the furthest away from the origin, 0.5 is centered, etc. * - * @return the value 0.5f to indicate centered + * @return the value {@code 0.5f} to indicate centered */ public float getLayoutAlignmentY(Container parent) { return 0.5f; @@ -800,7 +800,7 @@ java.io.Serializable { /** * Lays out the specified container using this grid bag layout. * This method reshapes components in the specified container in - * order to satisfy the constraints of this GridBagLayout + * order to satisfy the constraints of this {@code GridBagLayout} * object. *

        * Most applications do not call this method directly. @@ -890,7 +890,7 @@ java.io.Serializable { */ /** - * Fills in an instance of GridBagLayoutInfo for the + * Fills in an instance of {@code GridBagLayoutInfo} for the * current set of managed children. This requires three passes through the * set of children: * @@ -904,12 +904,12 @@ java.io.Serializable { * first encountered (so subsequent loops don't need to ask again). *

        * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param parent the layout container - * @param sizeflag either PREFERREDSIZE or - * MINSIZE - * @return the GridBagLayoutInfo for the set of children + * @param sizeflag either {@code PREFERREDSIZE} or + * {@code MINSIZE} + * @return the {@code GridBagLayoutInfo} for the set of children * @since 1.4 */ protected GridBagLayoutInfo getLayoutInfo(Container parent, int sizeflag) { @@ -1605,10 +1605,10 @@ java.io.Serializable { * Adjusts the x, y, width, and height fields to the correct * values depending on the constraint geometry and pads. * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param constraints the constraints to be applied - * @param r the Rectangle to be adjusted + * @param r the {@code Rectangle} to be adjusted * @since 1.4 */ protected void adjustForGravity(GridBagConstraints constraints, @@ -1624,7 +1624,7 @@ java.io.Serializable { * compatibility only; new code should call {@link * #adjustForGravity(java.awt.GridBagConstraints, java.awt.Rectangle) * adjustForGravity} instead. - * This method is the same as adjustForGravity + * This method is the same as {@code adjustForGravity} * * @param constraints the constraints to be applied * @param r the {@code Rectangle} to be adjusted @@ -1987,13 +1987,13 @@ java.io.Serializable { /** * Figures out the minimum size of the - * master based on the information from getLayoutInfo. + * master based on the information from {@code getLayoutInfo}. * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param parent the layout container * @param info the layout info for this parent - * @return a Dimension object containing the + * @return a {@code Dimension} object containing the * minimum size * @since 1.4 */ @@ -2005,11 +2005,11 @@ java.io.Serializable { * This method is obsolete and supplied for backwards * compatibility only; new code should call {@link * #getMinSize(java.awt.Container, GridBagLayoutInfo) getMinSize} instead. - * This method is the same as getMinSize + * This method is the same as {@code getMinSize} * * @param parent the layout container * @param info the layout info for this parent - * @return a Dimension object containing the + * @return a {@code Dimension} object containing the * minimum size */ protected Dimension GetMinSize(Container parent, GridBagLayoutInfo info) { @@ -2035,7 +2035,7 @@ java.io.Serializable { /** * Lays out the grid. * This method should only be used internally by - * GridBagLayout. + * {@code GridBagLayout}. * * @param parent the layout container * @since 1.4 @@ -2048,7 +2048,7 @@ java.io.Serializable { * This method is obsolete and supplied for backwards * compatibility only; new code should call {@link * #arrangeGrid(Container) arrangeGrid} instead. - * This method is the same as arrangeGrid + * This method is the same as {@code arrangeGrid} * * @param parent the layout container */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Image.java b/jdk/src/java.desktop/share/classes/java/awt/Image.java index d18e02d5147..b2ab082aa2c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Image.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Image.java @@ -35,7 +35,7 @@ import sun.awt.image.SurfaceManager; /** - * The abstract class Image is the superclass of all + * The abstract class {@code Image} is the superclass of all * classes that represent graphical images. The image must be * obtained in a platform-specific manner. * @@ -57,17 +57,17 @@ public abstract class Image { * Priority for accelerating this image. Subclasses are free to * set different default priorities and applications are free to * set the priority for specific images via the - * setAccelerationPriority(float) method. + * {@code setAccelerationPriority(float)} method. * @since 1.5 */ protected float accelerationPriority = .5f; /** * Determines the width of the image. If the width is not yet known, - * this method returns -1 and the specified - * ImageObserver object is notified later. + * this method returns {@code -1} and the specified + * {@code ImageObserver} object is notified later. * @param observer an object waiting for the image to be loaded. - * @return the width of this image, or -1 + * @return the width of this image, or {@code -1} * if the width is not yet known. * @see java.awt.Image#getHeight * @see java.awt.image.ImageObserver @@ -76,10 +76,10 @@ public abstract class Image { /** * Determines the height of the image. If the height is not yet known, - * this method returns -1 and the specified - * ImageObserver object is notified later. + * this method returns {@code -1} and the specified + * {@code ImageObserver} object is notified later. * @param observer an object waiting for the image to be loaded. - * @return the height of this image, or -1 + * @return the height of this image, or {@code -1} * if the height is not yet known. * @see java.awt.Image#getWidth * @see java.awt.image.ImageObserver @@ -112,13 +112,13 @@ public abstract class Image { *

        * Individual property names are defined by the various image * formats. If a property is not defined for a particular image, this - * method returns the UndefinedProperty object. + * method returns the {@code UndefinedProperty} object. *

        * If the properties for this image are not yet known, this method - * returns null, and the ImageObserver + * returns {@code null}, and the {@code ImageObserver} * object is notified later. *

        - * The property name "comment" should be used to store + * The property name {@code "comment"} should be used to store * an optional comment which can be presented to the application as a * description of the image, its source, or its author. * @param name a property name. @@ -131,25 +131,25 @@ public abstract class Image { public abstract Object getProperty(String name, ImageObserver observer); /** - * The UndefinedProperty object should be returned whenever a + * The {@code UndefinedProperty} object should be returned whenever a * property which was not defined for a particular image is fetched. */ public static final Object UndefinedProperty = new Object(); /** * Creates a scaled version of this image. - * A new Image object is returned which will render - * the image at the specified width and - * height by default. The new Image object + * A new {@code Image} object is returned which will render + * the image at the specified {@code width} and + * {@code height} by default. The new {@code Image} object * may be loaded asynchronously even if the original source image * has already been loaded completely. * *

        * - * If either width - * or height is a negative number then a value is + * If either {@code width} + * or {@code height} is a negative number then a value is * substituted to maintain the aspect ratio of the original image - * dimensions. If both width and height + * dimensions. If both {@code width} and {@code height} * are negative, then the original image dimensions are used. * * @param width the width to which to scale the image. @@ -157,8 +157,8 @@ public abstract class Image { * @param hints flags to indicate the type of algorithm to use * for image resampling. * @return a scaled version of the image. - * @exception IllegalArgumentException if width - * or height is zero. + * @exception IllegalArgumentException if {@code width} + * or {@code height} is zero. * @see java.awt.Image#SCALE_DEFAULT * @see java.awt.Image#SCALE_FAST * @see java.awt.Image#SCALE_SMOOTH @@ -200,8 +200,8 @@ public abstract class Image { /** * Use the image scaling algorithm embodied in the - * ReplicateScaleFilter class. - * The Image object is free to substitute a different filter + * {@code ReplicateScaleFilter} class. + * The {@code Image} object is free to substitute a different filter * that performs the same algorithm yet integrates more efficiently * into the imaging infrastructure supplied by the toolkit. * @see java.awt.image.ReplicateScaleFilter @@ -274,11 +274,11 @@ public abstract class Image { * size on the given GraphicsConfiguration, so although the object * may be acceleratable in general, it * does not have that capability on this GraphicsConfiguration. - * @param gc a GraphicsConfiguration object. A value of null + * @param gc a {@code GraphicsConfiguration} object. A value of null * for this parameter will result in getting the image capabilities - * for the default GraphicsConfiguration. - * @return an ImageCapabilities object that contains - * the capabilities of this Image on the specified + * for the default {@code GraphicsConfiguration}. + * @return an {@code ImageCapabilities} object that contains + * the capabilities of this {@code Image} on the specified * GraphicsConfiguration. * @see java.awt.image.VolatileImage#getCapabilities() * VolatileImage.getCapabilities() @@ -313,7 +313,7 @@ public abstract class Image { * means that this Image should never be accelerated. Other values * are used simply to determine acceleration priority relative to other * Images. - * @throws IllegalArgumentException if priority is less + * @throws IllegalArgumentException if {@code priority} is less * than zero or greater than 1. * @since 1.5 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java b/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java index e02ccacfb77..9d21b924ff8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ImageCapabilities.java @@ -43,8 +43,8 @@ public class ImageCapabilities implements Cloneable { } /** - * Returns true if the object whose capabilities are - * encapsulated in this ImageCapabilities can be or is + * Returns {@code true} if the object whose capabilities are + * encapsulated in this {@code ImageCapabilities} can be or is * accelerated. * @return whether or not an image can be, or is, accelerated. There are * various platform-specific ways to accelerate an image, including @@ -56,8 +56,8 @@ public class ImageCapabilities implements Cloneable { } /** - * Returns true if the VolatileImage - * described by this ImageCapabilities can lose + * Returns {@code true} if the {@code VolatileImage} + * described by this {@code ImageCapabilities} can lose * its surfaces. * @return whether or not a volatile image is subject to losing its surfaces * at the whim of the operating system. diff --git a/jdk/src/java.desktop/share/classes/java/awt/Insets.java b/jdk/src/java.desktop/share/classes/java/awt/Insets.java index 66542fcf2a5..edd1473ef39 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Insets.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Insets.java @@ -26,7 +26,7 @@ package java.awt; /** - * An Insets object is a representation of the borders + * An {@code Insets} object is a representation of the borders * of a container. It specifies the space that a container must leave * at each of its edges. The space can be a border, a blank space, or * a title. @@ -93,7 +93,7 @@ public class Insets implements Cloneable, java.io.Serializable { } /** - * Creates and initializes a new Insets object with the + * Creates and initializes a new {@code Insets} object with the * specified top, left, bottom, and right insets. * @param top the inset from the top. * @param left the inset from the left. @@ -125,11 +125,11 @@ public class Insets implements Cloneable, java.io.Serializable { /** * Checks whether two insets objects are equal. Two instances - * of Insets are equal if the four integer values - * of the fields top, left, - * bottom, and right are all equal. - * @return true if the two insets are equal; - * otherwise false. + * of {@code Insets} are equal if the four integer values + * of the fields {@code top}, {@code left}, + * {@code bottom}, and {@code right} are all equal. + * @return {@code true} if the two insets are equal; + * otherwise {@code false}. * @since 1.1 */ public boolean equals(Object obj) { @@ -156,13 +156,13 @@ public class Insets implements Cloneable, java.io.Serializable { } /** - * Returns a string representation of this Insets object. + * Returns a string representation of this {@code Insets} object. * This method is intended to be used only for debugging purposes, and * the content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * - * @return a string representation of this Insets object. + * @return a string representation of this {@code Insets} object. */ public String toString() { return getClass().getName() + "[top=" + top + ",left=" + left + ",bottom=" + bottom + ",right=" + right + "]"; @@ -170,7 +170,7 @@ public class Insets implements Cloneable, java.io.Serializable { /** * Create a copy of this object. - * @return a copy of this Insets object. + * @return a copy of this {@code Insets} object. */ public Object clone() { try { diff --git a/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java b/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java index e11b70ef48f..2d26112027c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ItemSelectable.java @@ -37,7 +37,7 @@ import java.awt.event.*; public interface ItemSelectable { /** - * Returns the selected items or null if no + * Returns the selected items or {@code null} if no * items are selected. * * @return the list of selected objects, or {@code null} @@ -47,8 +47,8 @@ public interface ItemSelectable { /** * Adds a listener to receive item events when the state of an item is * changed by the user. Item events are not sent when an item's - * state is set programmatically. If l is - * null, no exception is thrown and no action is performed. + * state is set programmatically. If {@code l} is + * {@code null}, no exception is thrown and no action is performed. * * @param l the listener to receive events * @see ItemEvent @@ -57,7 +57,7 @@ public interface ItemSelectable { /** * Removes an item listener. - * If l is null, + * If {@code l} is {@code null}, * no exception is thrown and no action is performed. * * @param l the listener being removed diff --git a/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java b/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java index bbb94e3bb5c..6281d6e1e5e 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java +++ b/jdk/src/java.desktop/share/classes/java/awt/JobAttributes.java @@ -72,19 +72,19 @@ public final class JobAttributes implements Cloneable { }; /** - * The DefaultSelectionType instance to use for + * The {@code DefaultSelectionType} instance to use for * specifying that all pages of the job should be printed. */ public static final DefaultSelectionType ALL = new DefaultSelectionType(I_ALL); /** - * The DefaultSelectionType instance to use for + * The {@code DefaultSelectionType} instance to use for * specifying that a range of pages of the job should be printed. */ public static final DefaultSelectionType RANGE = new DefaultSelectionType(I_RANGE); /** - * The DefaultSelectionType instance to use for + * The {@code DefaultSelectionType} instance to use for * specifying that the current selection should be printed. */ public static final DefaultSelectionType SELECTION = @@ -108,13 +108,13 @@ public final class JobAttributes implements Cloneable { }; /** - * The DestinationType instance to use for + * The {@code DestinationType} instance to use for * specifying print to file. */ public static final DestinationType FILE = new DestinationType(I_FILE); /** - * The DestinationType instance to use for + * The {@code DestinationType} instance to use for * specifying print to printer. */ public static final DestinationType PRINTER = @@ -139,17 +139,17 @@ public final class JobAttributes implements Cloneable { }; /** - * The DialogType instance to use for + * The {@code DialogType} instance to use for * specifying the cross-platform, pure Java print dialog. */ public static final DialogType COMMON = new DialogType(I_COMMON); /** - * The DialogType instance to use for + * The {@code DialogType} instance to use for * specifying the platform's native print dialog. */ public static final DialogType NATIVE = new DialogType(I_NATIVE); /** - * The DialogType instance to use for + * The {@code DialogType} instance to use for * specifying no print dialog. */ public static final DialogType NONE = new DialogType(I_NONE); @@ -176,7 +176,7 @@ public final class JobAttributes implements Cloneable { }; /** - * The MultipleDocumentHandlingType instance to use for specifying + * The {@code MultipleDocumentHandlingType} instance to use for specifying * that the job should be divided into separate, collated copies. */ public static final MultipleDocumentHandlingType @@ -184,7 +184,7 @@ public final class JobAttributes implements Cloneable { new MultipleDocumentHandlingType( I_SEPARATE_DOCUMENTS_COLLATED_COPIES); /** - * The MultipleDocumentHandlingType instance to use for specifying + * The {@code MultipleDocumentHandlingType} instance to use for specifying * that the job should be divided into separate, uncollated copies. */ public static final MultipleDocumentHandlingType @@ -212,13 +212,13 @@ public final class JobAttributes implements Cloneable { }; /** - * The SidesType instance to use for specifying that + * The {@code SidesType} instance to use for specifying that * consecutive job pages should be printed upon the same side of * consecutive media sheets. */ public static final SidesType ONE_SIDED = new SidesType(I_ONE_SIDED); /** - * The SidesType instance to use for specifying that + * The {@code SidesType} instance to use for specifying that * consecutive job pages should be printed upon front and back sides * of consecutive media sheets, such that the orientation of each pair * of pages on the medium would be correct for the reader as if for @@ -227,7 +227,7 @@ public final class JobAttributes implements Cloneable { public static final SidesType TWO_SIDED_LONG_EDGE = new SidesType(I_TWO_SIDED_LONG_EDGE); /** - * The SidesType instance to use for specifying that + * The {@code SidesType} instance to use for specifying that * consecutive job pages should be printed upon front and back sides * of consecutive media sheets, such that the orientation of each pair * of pages on the medium would be correct for the reader as if for @@ -258,16 +258,16 @@ public final class JobAttributes implements Cloneable { private int toPage; /** - * Constructs a JobAttributes instance with default + * Constructs a {@code JobAttributes} instance with default * values for every attribute. The dialog defaults to - * DialogType.NATIVE. Min page defaults to - * 1. Max page defaults to Integer.MAX_VALUE. - * Destination defaults to DestinationType.PRINTER. - * Selection defaults to DefaultSelectionType.ALL. - * Number of copies defaults to 1. Multiple document handling defaults - * to MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES. - * Sides defaults to SidesType.ONE_SIDED. File name defaults - * to null. + * {@code DialogType.NATIVE}. Min page defaults to + * {@code 1}. Max page defaults to {@code Integer.MAX_VALUE}. + * Destination defaults to {@code DestinationType.PRINTER}. + * Selection defaults to {@code DefaultSelectionType.ALL}. + * Number of copies defaults to {@code 1}. Multiple document handling defaults + * to {@code MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES}. + * Sides defaults to {@code SidesType.ONE_SIDED}. File name defaults + * to {@code null}. */ public JobAttributes() { setCopiesToDefault(); @@ -281,36 +281,36 @@ public final class JobAttributes implements Cloneable { } /** - * Constructs a JobAttributes instance which is a copy - * of the supplied JobAttributes. + * Constructs a {@code JobAttributes} instance which is a copy + * of the supplied {@code JobAttributes}. * - * @param obj the JobAttributes to copy + * @param obj the {@code JobAttributes} to copy */ public JobAttributes(JobAttributes obj) { set(obj); } /** - * Constructs a JobAttributes instance with the + * Constructs a {@code JobAttributes} instance with the * specified values for every attribute. * * @param copies an integer greater than 0 - * @param defaultSelection DefaultSelectionType.ALL, - * DefaultSelectionType.RANGE, or - * DefaultSelectionType.SELECTION - * @param destination DestinationType.FILE or - * DestinationType.PRINTER - * @param dialog DialogType.COMMON, - * DialogType.NATIVE, or - * DialogType.NONE - * @param fileName the possibly null file name + * @param defaultSelection {@code DefaultSelectionType.ALL}, + * {@code DefaultSelectionType.RANGE}, or + * {@code DefaultSelectionType.SELECTION} + * @param destination {@code DestinationType.FILE} or + * {@code DestinationType.PRINTER} + * @param dialog {@code DialogType.COMMON}, + * {@code DialogType.NATIVE}, or + * {@code DialogType.NONE} + * @param fileName the possibly {@code null} file name * @param maxPage an integer greater than zero and greater than or equal * to minPage * @param minPage an integer greater than zero and less than or equal * to maxPage * @param multipleDocumentHandling - * MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES or - * MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES + * {@code MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_COLLATED_COPIES} or + * {@code MultipleDocumentHandlingType.SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} * @param pageRanges an array of integer arrays of two elements; an array * is interpreted as a range spanning all pages including and * between the specified pages; ranges must be in ascending @@ -322,13 +322,13 @@ public final class JobAttributes implements Cloneable { * new int[] { 15, 19 } }), *

      * specifies pages 1, 2, 3, 5, 15, 16, 17, 18, and 19. Note that - * (new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }), + * ({@code new int[][] { new int[] { 1, 1 }, new int[] { 1, 2 } }}), * is an invalid set of page ranges because the two ranges * overlap - * @param printer the possibly null printer name - * @param sides SidesType.ONE_SIDED, - * SidesType.TWO_SIDED_LONG_EDGE, or - * SidesType.TWO_SIDED_SHORT_EDGE + * @param printer the possibly {@code null} printer name + * @param sides {@code SidesType.ONE_SIDED}, + * {@code SidesType.TWO_SIDED_LONG_EDGE}, or + * {@code SidesType.TWO_SIDED_SHORT_EDGE} * @throws IllegalArgumentException if one or more of the above * conditions is violated */ @@ -351,10 +351,10 @@ public final class JobAttributes implements Cloneable { } /** - * Creates and returns a copy of this JobAttributes. + * Creates and returns a copy of this {@code JobAttributes}. * * @return the newly created copy; it is safe to cast this Object into - * a JobAttributes + * a {@code JobAttributes} */ public Object clone() { try { @@ -366,10 +366,10 @@ public final class JobAttributes implements Cloneable { } /** - * Sets all of the attributes of this JobAttributes to + * Sets all of the attributes of this {@code JobAttributes} to * the same values as the attributes of obj. * - * @param obj the JobAttributes to copy + * @param obj the {@code JobAttributes} to copy */ public void set(JobAttributes obj) { copies = obj.copies; @@ -404,10 +404,10 @@ public final class JobAttributes implements Cloneable { /** * Specifies the number of copies the application should render for jobs * using these attributes. Not specifying this attribute is equivalent to - * specifying 1. + * specifying {@code 1}. * * @param copies an integer greater than 0 - * @throws IllegalArgumentException if copies is less than + * @throws IllegalArgumentException if {@code copies} is less than * or equal to 0 */ public void setCopies(int copies) { @@ -429,7 +429,7 @@ public final class JobAttributes implements Cloneable { /** * Specifies whether, for jobs using these attributes, the application * should print all pages, the range specified by the return value of - * getPageRanges, or the current selection. This attribute + * {@code getPageRanges}, or the current selection. This attribute * is updated to the value chosen by the user. * * @return DefaultSelectionType.ALL, DefaultSelectionType.RANGE, or @@ -442,12 +442,12 @@ public final class JobAttributes implements Cloneable { /** * Specifies whether, for jobs using these attributes, the application * should print all pages, the range specified by the return value of - * getPageRanges, or the current selection. Not specifying + * {@code getPageRanges}, or the current selection. Not specifying * this attribute is equivalent to specifying DefaultSelectionType.ALL. * * @param defaultSelection DefaultSelectionType.ALL, * DefaultSelectionType.RANGE, or DefaultSelectionType.SELECTION. - * @throws IllegalArgumentException if defaultSelection is null + * @throws IllegalArgumentException if defaultSelection is {@code null} */ public void setDefaultSelection(DefaultSelectionType defaultSelection) { if (defaultSelection == null) { @@ -495,8 +495,8 @@ public final class JobAttributes implements Cloneable { * This attribute cannot be modified by, and is not subject to any * limitations of, the implementation or the target printer. * - * @return DialogType.COMMON, DialogType.NATIVE, or - * DialogType.NONE + * @return {@code DialogType.COMMON}, {@code DialogType.NATIVE}, or + * {@code DialogType.NONE} */ public DialogType getDialog() { return dialog; @@ -529,7 +529,7 @@ public final class JobAttributes implements Cloneable { * Specifies the file name for the output file for jobs using these * attributes. This attribute is updated to the value chosen by the user. * - * @return the possibly null file name + * @return the possibly {@code null} file name */ public String getFileName() { return fileName; @@ -549,9 +549,9 @@ public final class JobAttributes implements Cloneable { * Returns, for jobs using these attributes, the first page to be * printed, if a range of pages is to be printed. This attribute is * updated to the value chosen by the user. An application should ignore - * this attribute on output, unless the return value of the - * getDefaultSelection method is DefaultSelectionType.RANGE. An - * application should honor the return value of getPageRanges + * this attribute on output, unless the return value of the + * {@code getDefaultSelection} method is DefaultSelectionType.RANGE. An + * application should honor the return value of {@code getPageRanges} * over the return value of this method, if possible. * * @return an integer greater than zero and less than or equal to @@ -612,7 +612,7 @@ public final class JobAttributes implements Cloneable { /** * Specifies the maximum value the user can specify as the last page to * be printed for jobs using these attributes. Not specifying this - * attribute is equivalent to specifying Integer.MAX_VALUE. + * attribute is equivalent to specifying {@code Integer.MAX_VALUE}. * * @param maxPage an integer greater than zero and greater than or equal * to minPage @@ -643,7 +643,7 @@ public final class JobAttributes implements Cloneable { /** * Specifies the minimum value the user can specify as the first page to * be printed for jobs using these attributes. Not specifying this - * attribute is equivalent to specifying 1. + * attribute is equivalent to specifying {@code 1}. * * @param minPage an integer greater than zero and less than or equal * to maxPage. @@ -706,7 +706,7 @@ public final class JobAttributes implements Cloneable { * printed, if a range of pages is to be printed. All range numbers are * inclusive. This attribute is updated to the value chosen by the user. * An application should ignore this attribute on output, unless the - * return value of the getDefaultSelection method is + * return value of the {@code getDefaultSelection} method is * DefaultSelectionType.RANGE. * * @return an array of integer arrays of 2 elements. An array @@ -888,9 +888,9 @@ public final class JobAttributes implements Cloneable { * Returns, for jobs using these attributes, the last page (inclusive) * to be printed, if a range of pages is to be printed. This attribute is * updated to the value chosen by the user. An application should ignore - * this attribute on output, unless the return value of the - * getDefaultSelection method is DefaultSelectionType.RANGE. An - * application should honor the return value of getPageRanges + * this attribute on output, unless the return value of the + * {@code getDefaultSelection} method is DefaultSelectionType.RANGE. An + * application should honor the return value of {@code getPageRanges} * over the return value of this method, if possible. * * @return an integer greater than zero and greater than or equal diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java b/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java index 9970ac586e3..36ef562f3de 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyEventDispatcher.java @@ -62,28 +62,28 @@ public interface KeyEventDispatcher { * used to deliver KeyEvents to Components other than the focus owner. This * can be useful when navigating children of non-focusable Windows in an * accessible environment, for example. Note that if a KeyEventDispatcher - * dispatches the KeyEvent itself, it must use redispatchEvent + * dispatches the KeyEvent itself, it must use {@code redispatchEvent} * to prevent the current KeyboardFocusManager from recursively requesting * that this KeyEventDispatcher dispatch the event again. *

      - * If an implementation of this method returns false, then + * If an implementation of this method returns {@code false}, then * the KeyEvent is passed to the next KeyEventDispatcher in the chain, * ending with the current KeyboardFocusManager. If an implementation - * returns true, the KeyEvent is assumed to have been + * returns {@code true}, the KeyEvent is assumed to have been * dispatched (although this need not be the case), and the current * KeyboardFocusManager will take no further action with regard to the * KeyEvent. In such a case, - * KeyboardFocusManager.dispatchEvent should return - * true as well. If an implementation consumes the KeyEvent, - * but returns false, the consumed event will still be passed + * {@code KeyboardFocusManager.dispatchEvent} should return + * {@code true} as well. If an implementation consumes the KeyEvent, + * but returns {@code false}, the consumed event will still be passed * to the next KeyEventDispatcher in the chain. It is important for * developers to check whether the KeyEvent has been consumed before * dispatching it to a target. By default, the current KeyboardFocusManager * will not dispatch a consumed KeyEvent. * * @param e the KeyEvent to dispatch - * @return true if the KeyboardFocusManager should take no - * further action with regard to the KeyEvent; false + * @return {@code true} if the KeyboardFocusManager should take no + * further action with regard to the KeyEvent; {@code false} * otherwise * @see KeyboardFocusManager#redispatchEvent */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java b/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java index 5a36b9536b1..15f6cb9dddc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyEventPostProcessor.java @@ -68,17 +68,17 @@ public interface KeyEventPostProcessor { * will be used to implement features which require global KeyEvent * post-handling, such as menu shortcuts. Note that if a * KeyEventPostProcessor wishes to dispatch the KeyEvent, it must use - * redispatchEvent to prevent the AWT from recursively + * {@code redispatchEvent} to prevent the AWT from recursively * requesting that this KeyEventPostProcessor perform post-processing * of the event again. *

      - * If an implementation of this method returns false, then the + * If an implementation of this method returns {@code false}, then the * KeyEvent is passed to the next KeyEventPostProcessor in the chain, * ending with the current KeyboardFocusManager. If an implementation - * returns true, the KeyEvent is assumed to have been fully + * returns {@code true}, the KeyEvent is assumed to have been fully * handled (although this need not be the case), and the AWT will take no * further action with regard to the KeyEvent. If an implementation - * consumes the KeyEvent but returns false, the consumed + * consumes the KeyEvent but returns {@code false}, the consumed * event will still be passed to the next KeyEventPostProcessor in the * chain. It is important for developers to check whether the KeyEvent has * been consumed before performing any post-processing of the KeyEvent. By @@ -86,8 +86,8 @@ public interface KeyEventPostProcessor { * processing in response to a consumed KeyEvent. * * @param e the KeyEvent to post-process - * @return true if the AWT should take no further action with - * regard to the KeyEvent; false otherwise + * @return {@code true} if the AWT should take no further action with + * regard to the KeyEvent; {@code false} otherwise * @see KeyboardFocusManager#redispatchEvent */ boolean postProcessKeyEvent(KeyEvent e); diff --git a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java index d4d4a92e88c..6b7d779a7db 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java @@ -356,7 +356,7 @@ public abstract class KeyboardFocusManager /** * This KeyboardFocusManager's KeyEventDispatcher chain. The List does not * include this KeyboardFocusManager unless it was explicitly re-registered - * via a call to addKeyEventDispatcher. If no other + * via a call to {@code addKeyEventDispatcher}. If no other * KeyEventDispatchers are registered, this field may be null or refer to * a List of length 0. */ @@ -365,7 +365,7 @@ public abstract class KeyboardFocusManager /** * This KeyboardFocusManager's KeyEventPostProcessor chain. The List does * not include this KeyboardFocusManager unless it was explicitly - * re-registered via a call to addKeyEventPostProcessor. + * re-registered via a call to {@code addKeyEventPostProcessor}. * If no other KeyEventPostProcessors are registered, this field may be * null or refer to a List of length 0. */ @@ -518,8 +518,8 @@ public abstract class KeyboardFocusManager *

      * This method does not actually set the focus to the specified Component. * It merely stores the value to be subsequently returned by - * getFocusOwner(). Use Component.requestFocus() - * or Component.requestFocusInWindow() to change the focus + * {@code getFocusOwner()}. Use {@code Component.requestFocus()} + * or {@code Component.requestFocusInWindow()} to change the focus * owner, subject to platform limitations. * * @param focusOwner the focus owner @@ -607,7 +607,7 @@ public abstract class KeyboardFocusManager * FOCUS_LOST event. After this operation completes, the native windowing * system will discard all user-generated KeyEvents until the user selects * a new Component to receive focus, or a Component is given focus - * explicitly via a call to requestFocus(). This operation + * explicitly via a call to {@code requestFocus()}. This operation * does not change the focused or active Windows. *

      * If a SecurityManager is installed, the calling thread must be granted @@ -731,9 +731,9 @@ public abstract class KeyboardFocusManager *

      * This method does not actually set the focus to the specified Component. * It merely stores the value to be subsequently returned by - * getPermanentFocusOwner(). Use - * Component.requestFocus() or - * Component.requestFocusInWindow() to change the focus owner, + * {@code getPermanentFocusOwner()}. Use + * {@code Component.requestFocus()} or + * {@code Component.requestFocusInWindow()} to change the focus owner, * subject to platform limitations. * * @param permanentFocusOwner the permanent focus owner @@ -832,9 +832,9 @@ public abstract class KeyboardFocusManager *

      * This method does not actually change the focused Window as far as the * native windowing system is concerned. It merely stores the value to be - * subsequently returned by getFocusedWindow(). Use - * Component.requestFocus() or - * Component.requestFocusInWindow() to change the focused + * subsequently returned by {@code getFocusedWindow()}. Use + * {@code Component.requestFocus()} or + * {@code Component.requestFocusInWindow()} to change the focused * Window, subject to platform limitations. * * @param focusedWindow the focused Window @@ -936,9 +936,9 @@ public abstract class KeyboardFocusManager *

      * This method does not actually change the active Window as far as the * native windowing system is concerned. It merely stores the value to be - * subsequently returned by getActiveWindow(). Use - * Component.requestFocus() or - * Component.requestFocusInWindow()to change the active + * subsequently returned by {@code getActiveWindow()}. Use + * {@code Component.requestFocus()} or + * {@code Component.requestFocusInWindow()} to change the active * Window, subject to platform limitations. * * @param activeWindow the active Window @@ -1160,16 +1160,16 @@ public abstract class KeyboardFocusManager * have no such Set of their own explicitly defined. This Set will also be * inherited, recursively, by any child Component of those Windows that has * no such Set of its own explicitly defined. (See - * setDefaultFocusTraversalKeys for a full description of each + * {@code setDefaultFocusTraversalKeys} for a full description of each * operation.) * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS - * @return the Set of AWTKeyStrokes - * for the specified operation; the Set - * will be unmodifiable, and may be empty; null + * @return the {@code Set} of {@code AWTKeyStroke}s + * for the specified operation; the {@code Set} + * will be unmodifiable, and may be empty; {@code null} * will never be returned * @see #setDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys @@ -1359,7 +1359,7 @@ public abstract class KeyboardFocusManager * registered on this keyboard focus manager. * * @return all of this keyboard focus manager's - * PropertyChangeListeners + * {@code PropertyChangeListener}s * or an empty array if no property change * listeners are currently registered * @@ -1446,11 +1446,11 @@ public abstract class KeyboardFocusManager } /** - * Returns an array of all the PropertyChangeListeners + * Returns an array of all the {@code PropertyChangeListener}s * associated with the named property. * * @param propertyName the property name - * @return all of the PropertyChangeListeners associated with + * @return all of the {@code PropertyChangeListener}s associated with * the named property or an empty array if no such listeners have * been added. * @@ -1542,7 +1542,7 @@ public abstract class KeyboardFocusManager * registered on this keyboard focus manager. * * @return all of this keyboard focus manager's - * VetoableChangeListeners + * {@code VetoableChangeListener}s * or an empty array if no vetoable change * listeners are currently registered * @@ -1616,11 +1616,11 @@ public abstract class KeyboardFocusManager } /** - * Returns an array of all the VetoableChangeListeners + * Returns an array of all the {@code VetoableChangeListener}s * associated with the named property. * * @param propertyName the property name - * @return all of the VetoableChangeListeners associated with + * @return all of the {@code VetoableChangeListener}s associated with * the named property or an empty array if no such listeners have * been added. * @@ -1649,8 +1649,8 @@ public abstract class KeyboardFocusManager * @param oldValue the property's previous value * @param newValue the property's new value * @throws java.beans.PropertyVetoException if a - * VetoableChangeListener threw - * PropertyVetoException + * {@code VetoableChangeListener} threw + * {@code PropertyVetoException} */ protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) @@ -1673,8 +1673,8 @@ public abstract class KeyboardFocusManager * KeyEventDispatcher dispatch KeyEvents generated by the user before * finally dispatching the KeyEvent itself. KeyEventDispatchers will be * notified in the order in which they were added. Notifications will halt - * as soon as one KeyEventDispatcher returns true from its - * dispatchKeyEvent method. There is no limit to the total + * as soon as one KeyEventDispatcher returns {@code true} from its + * {@code dispatchKeyEvent} method. There is no limit to the total * number of KeyEventDispatchers which can be added, nor to the number of * times which a particular KeyEventDispatcher instance can be added. *

      @@ -1704,7 +1704,7 @@ public abstract class KeyboardFocusManager * Removes a KeyEventDispatcher which was previously added to this * KeyboardFocusManager's dispatcher chain. This KeyboardFocusManager * cannot itself be removed, unless it was explicitly re-registered via a - * call to addKeyEventDispatcher. + * call to {@code addKeyEventDispatcher}. *

      * If a null dispatcher is specified, if the specified dispatcher is not * in the dispatcher chain, or if this KeyboardFocusManager is specified @@ -1734,7 +1734,7 @@ public abstract class KeyboardFocusManager * Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List. * The List will not include this KeyboardFocusManager unless it was * explicitly re-registered via a call to - * addKeyEventDispatcher. If no other KeyEventDispatchers are + * {@code addKeyEventDispatcher}. If no other KeyEventDispatchers are * registered, implementations are free to return null or a List of length * 0. Client code should not assume one behavior over another, nor should * it assume that the behavior, once established, will not change. @@ -1760,8 +1760,8 @@ public abstract class KeyboardFocusManager * of the KeyEvent's final resolution. KeyEventPostProcessors * will be notified in the order in which they were added; the current * KeyboardFocusManager will be notified last. Notifications will halt - * as soon as one KeyEventPostProcessor returns true from its - * postProcessKeyEvent method. There is no limit to the + * as soon as one KeyEventPostProcessor returns {@code true} from its + * {@code postProcessKeyEvent} method. There is no limit to the * total number of KeyEventPostProcessors that can be added, nor to the * number of times that a particular KeyEventPostProcessor instance can be * added. @@ -1794,7 +1794,7 @@ public abstract class KeyboardFocusManager * Removes a previously added KeyEventPostProcessor from this * KeyboardFocusManager's post-processor chain. This KeyboardFocusManager * cannot itself be entirely removed from the chain. Only additional - * references added via addKeyEventPostProcessor can be + * references added via {@code addKeyEventPostProcessor} can be * removed. *

      * If a null post-processor is specified, if the specified post-processor @@ -1825,7 +1825,7 @@ public abstract class KeyboardFocusManager /** * Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a * List. The List will not include this KeyboardFocusManager unless it was - * explicitly added via a call to addKeyEventPostProcessor. If + * explicitly added via a call to {@code addKeyEventPostProcessor}. If * no KeyEventPostProcessors are registered, implementations are free to * return null or a List of length 0. Client code should not assume one * behavior over another, nor should it assume that the behavior, once @@ -1914,14 +1914,14 @@ public abstract class KeyboardFocusManager * These events should be dispatched based on the KeyboardFocusManager's * notion of the focus owner and the focused and active Windows, sometimes * overriding the source of the specified AWTEvent. Dispatching must be - * done using redispatchEvent to prevent the AWT event + * done using {@code redispatchEvent} to prevent the AWT event * dispatcher from recursively requesting that the KeyboardFocusManager - * dispatch the event again. If this method returns false, + * dispatch the event again. If this method returns {@code false}, * then the AWT event dispatcher will attempt to dispatch the event itself. * * @param e the AWTEvent to be dispatched - * @return true if this method dispatched the event; - * false otherwise + * @return {@code true} if this method dispatched the event; + * {@code false} otherwise * @see #redispatchEvent * @see #dispatchKeyEvent */ @@ -1931,9 +1931,9 @@ public abstract class KeyboardFocusManager * Redispatches an AWTEvent in such a way that the AWT event dispatcher * will not recursively request that the KeyboardFocusManager, or any * installed KeyEventDispatchers, dispatch the event again. Client - * implementations of dispatchEvent and client-defined - * KeyEventDispatchers must call redispatchEvent(target, e) - * instead of target.dispatchEvent(e) to dispatch an event. + * implementations of {@code dispatchEvent} and client-defined + * KeyEventDispatchers must call {@code redispatchEvent(target, e)} + * instead of {@code target.dispatchEvent(e)} to dispatch an event. *

      * This method is intended to be used only by KeyboardFocusManagers and * KeyEventDispatchers. It is not for general client use. @@ -1950,30 +1950,30 @@ public abstract class KeyboardFocusManager } /** - * Typically this method will be called by dispatchEvent if no + * Typically this method will be called by {@code dispatchEvent} if no * other KeyEventDispatcher in the dispatcher chain dispatched the * KeyEvent, or if no other KeyEventDispatchers are registered. If an - * implementation of this method returns false, - * dispatchEvent may try to dispatch the KeyEvent itself, or - * may simply return false. If true is returned, - * dispatchEvent should return true as well. + * implementation of this method returns {@code false}, + * {@code dispatchEvent} may try to dispatch the KeyEvent itself, or + * may simply return {@code false}. If {@code true} is returned, + * {@code dispatchEvent} should return {@code true} as well. * * @param e the KeyEvent which the current KeyboardFocusManager has * requested that this KeyEventDispatcher dispatch - * @return true if the KeyEvent was dispatched; - * false otherwise + * @return {@code true} if the KeyEvent was dispatched; + * {@code false} otherwise * @see #dispatchEvent */ public abstract boolean dispatchKeyEvent(KeyEvent e); /** - * This method will be called by dispatchKeyEvent. + * This method will be called by {@code dispatchKeyEvent}. * By default, this method will handle any unconsumed KeyEvents that - * map to an AWT MenuShortcut by consuming the event + * map to an AWT {@code MenuShortcut} by consuming the event * and activating the shortcut. * * @param e the KeyEvent to post-process - * @return true to indicate that no other + * @return {@code true} to indicate that no other * KeyEventPostProcessor will be notified of the KeyEvent. * @see #dispatchKeyEvent * @see MenuShortcut @@ -2005,8 +2005,8 @@ public abstract class KeyboardFocusManager * the KeyboardFocusManager to delay dispatching of KeyEvents with * timestamps later than the specified time stamp until the specified * Component receives a FOCUS_GAINED event, or the AWT cancels the delay - * request by invoking dequeueKeyEvents or - * discardKeyEvents. + * request by invoking {@code dequeueKeyEvents} or + * {@code discardKeyEvents}. * * @param after timestamp of current event, or the current, system time if * the current event has no timestamp, or the AWT cannot determine @@ -2022,16 +2022,16 @@ public abstract class KeyboardFocusManager /** * Called by the AWT to notify the KeyboardFocusManager that it should * cancel delayed dispatching of KeyEvents. All KeyEvents which were - * enqueued because of a call to enqueueKeyEvents with the + * enqueued because of a call to {@code enqueueKeyEvents} with the * same timestamp and Component should be released for normal dispatching * to the current focus owner. If the given timestamp is less than zero, * the outstanding enqueue request for the given Component with the * oldest timestamp (if any) should be cancelled. * * @param after the timestamp specified in the call to - * enqueueKeyEvents, or any value < 0 + * {@code enqueueKeyEvents}, or any value < 0 * @param untilFocused the Component specified in the call to - * enqueueKeyEvents + * {@code enqueueKeyEvents} * @see #enqueueKeyEvents * @see #discardKeyEvents */ @@ -2041,11 +2041,11 @@ public abstract class KeyboardFocusManager /** * Called by the AWT to notify the KeyboardFocusManager that it should * cancel delayed dispatching of KeyEvents. All KeyEvents which were - * enqueued because of one or more calls to enqueueKeyEvents + * enqueued because of one or more calls to {@code enqueueKeyEvents} * with the same Component should be discarded. * * @param comp the Component specified in one or more calls to - * enqueueKeyEvents + * {@code enqueueKeyEvents} * @see #enqueueKeyEvents * @see #dequeueKeyEvents */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Label.java b/jdk/src/java.desktop/share/classes/java/awt/Label.java index d0999399e84..32744ee2a60 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Label.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Label.java @@ -30,7 +30,7 @@ import java.io.ObjectInputStream; import javax.accessibility.*; /** - * A Label object is a component for placing text in a + * A {@code Label} object is a component for placing text in a * container. A label displays a single line of read-only text. * The text can be changed by the application, but a user cannot edit it * directly. @@ -107,7 +107,7 @@ public class Label extends Component implements Accessible { /** * Constructs an empty label. - * The text of the label is the empty string "". + * The text of the label is the empty string {@code ""}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -120,7 +120,7 @@ public class Label extends Component implements Accessible { * Constructs a new label with the specified string of text, * left justified. * @param text the string that the label presents. - * A null value + * A {@code null} value * will be accepted without causing a NullPointerException * to be thrown. * @exception HeadlessException if GraphicsEnvironment.isHeadless() @@ -134,10 +134,10 @@ public class Label extends Component implements Accessible { /** * Constructs a new label that presents the specified string of * text with the specified alignment. - * Possible values for alignment are Label.LEFT, - * Label.RIGHT, and Label.CENTER. + * Possible values for {@code alignment} are {@code Label.LEFT}, + * {@code Label.RIGHT}, and {@code Label.CENTER}. * @param text the string that the label presents. - * A null value + * A {@code null} value * will be accepted without causing a NullPointerException * to be thrown. * @param alignment the alignment value. @@ -154,8 +154,8 @@ public class Label extends Component implements Accessible { /** * Read a label from an object input stream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @serial * @since 1.4 * @see java.awt.GraphicsEnvironment#isHeadless @@ -168,7 +168,7 @@ public class Label extends Component implements Accessible { /** * Construct a name for this component. Called by getName() when the - * name is null. + * name is {@code null}. */ String constructComponentName() { synchronized (Label.class) { @@ -191,8 +191,8 @@ public class Label extends Component implements Accessible { /** * Gets the current alignment of this label. Possible values are - * Label.LEFT, Label.RIGHT, and - * Label.CENTER. + * {@code Label.LEFT}, {@code Label.RIGHT}, and + * {@code Label.CENTER}. * @return the alignment of this label * @see java.awt.Label#setAlignment */ @@ -202,11 +202,11 @@ public class Label extends Component implements Accessible { /** * Sets the alignment for this label to the specified alignment. - * Possible values are Label.LEFT, - * Label.RIGHT, and Label.CENTER. + * Possible values are {@code Label.LEFT}, + * {@code Label.RIGHT}, and {@code Label.CENTER}. * @param alignment the alignment to be set. * @exception IllegalArgumentException if an improper value for - * alignment is given. + * {@code alignment} is given. * @see java.awt.Label#getAlignment */ public synchronized void setAlignment(int alignment) { @@ -226,8 +226,8 @@ public class Label extends Component implements Accessible { /** * Gets the text of this label. - * @return the text of this label, or null if - * the text has been set to null. + * @return the text of this label, or {@code null} if + * the text has been set to {@code null}. * @see java.awt.Label#setText */ public String getText() { @@ -237,9 +237,9 @@ public class Label extends Component implements Accessible { /** * Sets the text for this label to the specified text. * @param text the text that this label displays. If - * text is null, it is + * {@code text} is {@code null}, it is * treated for display purposes like an empty - * string "". + * string {@code ""}. * @see java.awt.Label#getText */ public void setText(String text) { @@ -263,11 +263,11 @@ public class Label extends Component implements Accessible { } /** - * Returns a string representing the state of this Label. + * Returns a string representing the state of this {@code Label}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this label */ @@ -311,7 +311,7 @@ public class Label extends Component implements Accessible { /** * This class implements accessibility support for the - * Label class. It provides an implementation of the + * {@code Label} class. It provides an implementation of the * Java Accessibility API appropriate to label user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java b/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java index d7abfbb1c29..b573ed0b83a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java +++ b/jdk/src/java.desktop/share/classes/java/awt/LayoutManager.java @@ -26,13 +26,13 @@ package java.awt; /** * Defines the interface for classes that know how to lay out - * Containers. + * {@code Container}s. *

      * Swing's painting architecture assumes the children of a - * JComponent do not overlap. If a - * JComponent's LayoutManager allows - * children to overlap, the JComponent must override - * isOptimizedDrawingEnabled to return false. + * {@code JComponent} do not overlap. If a + * {@code JComponent}'s {@code LayoutManager} allows + * children to overlap, the {@code JComponent} must override + * {@code isOptimizedDrawingEnabled} to return false. * * @see Container * @see javax.swing.JComponent#isOptimizedDrawingEnabled @@ -43,9 +43,9 @@ package java.awt; public interface LayoutManager { /** * If the layout manager uses a per-component string, - * adds the component comp to the layout, + * adds the component {@code comp} to the layout, * associating it - * with the string specified by name. + * with the string specified by {@code name}. * * @param name the string to be associated with the component * @param comp the component to be added diff --git a/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java index 635a3cbe45d..16d58af3e55 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/LinearGradientPaintContext.java @@ -56,7 +56,7 @@ final class LinearGradientPaintContext extends MultipleGradientPaintContext { * @param paint the {@code LinearGradientPaint} from which this context * is created * @param cm {@code ColorModel} that receives - * the Paint data. This is used only as a hint. + * the {@code Paint} data. This is used only as a hint. * @param deviceBounds the device space bounding box of the * graphics primitive being rendered * @param userBounds the user space bounding box of the diff --git a/jdk/src/java.desktop/share/classes/java/awt/List.java b/jdk/src/java.desktop/share/classes/java/awt/List.java index 4112f87fbe2..c0c22d206e8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/List.java +++ b/jdk/src/java.desktop/share/classes/java/awt/List.java @@ -36,7 +36,7 @@ import javax.accessibility.*; /** - * The List component presents the user with a + * The {@code List} component presents the user with a * scrolling list of text items. The list can be set up so that * the user can choose either one item or multiple items. *

      @@ -57,7 +57,7 @@ import javax.accessibility.*; * cnt.add(lst); *


      *

      - * where cnt is a container, produces the following + * where {@code cnt} is a container, produces the following * scrolling list: *

      * false. If the List does not allow multiple + * list is {@code false}. If the List does not allow multiple * selections, selecting an item causes any other selected item * to be deselected. *

      * Note that the list in the example shown was created with four visible * rows. Once the list has been created, the number of visible rows - * cannot be changed. A default List is created with - * four rows, so that lst = new List() is equivalent to - * list = new List(4, false). + * cannot be changed. A default {@code List} is created with + * four rows, so that {@code lst = new List()} is equivalent to + * {@code list = new List(4, false)}. *

      * Beginning with Java 1.1, the Abstract Window Toolkit - * sends the List object all mouse, keyboard, and focus events + * sends the {@code List} object all mouse, keyboard, and focus events * that occur over it. (The old AWT event model is being maintained * only for backwards compatibility, and its use is discouraged.) *

      * When an item is selected or deselected by the user, AWT sends an instance - * of ItemEvent to the list. + * of {@code ItemEvent} to the list. * When the user double-clicks on an item in a scrolling list, - * AWT sends an instance of ActionEvent to the + * AWT sends an instance of {@code ActionEvent} to the * list following the item event. AWT also generates an action event * when the user presses the return key while an item in the * list is selected. *

      * If an application wants to perform some action based on an item * in this list being selected or activated by the user, it should implement - * ItemListener or ActionListener + * {@code ItemListener} or {@code ActionListener} * as appropriate and register the new listener to receive * events from this list. *

      @@ -119,7 +119,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * This field will represent the number of visible rows in the - * List Component. It is specified only once, and + * {@code List} Component. It is specified only once, and * that is when the list component is actually * created. It will never change. * @@ -129,11 +129,11 @@ public class List extends Component implements ItemSelectable, Accessible { int rows = 0; /** - * multipleMode is a variable that will - * be set to true if a list component is to be set to + * {@code multipleMode} is a variable that will + * be set to {@code true} if a list component is to be set to * multiple selection mode, that is where the user can * select more than one item in a list at one time. - * multipleMode will be set to false if the + * {@code multipleMode} will be set to false if the * list component is set to single selection, that is where * the user can only select one item on the list at any * one time. @@ -145,7 +145,7 @@ public class List extends Component implements ItemSelectable, Accessible { boolean multipleMode = false; /** - * selected is an array that will contain + * {@code selected} is an array that will contain * the indices of items that have been selected. * * @serial @@ -178,7 +178,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Creates a new scrolling list. * By default, there are four visible lines and multiple selections are * not allowed. Note that this is a convenience method for - * List(0, false). Also note that the number of visible + * {@code List(0, false)}. Also note that the number of visible * lines in the list cannot be changed after it has been created. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -192,7 +192,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Creates a new scrolling list initialized with the specified * number of visible lines. By default, multiple selections are * not allowed. Note that this is a convenience method for - * List(rows, false). Also note that the number + * {@code List(rows, false)}. Also note that the number * of visible rows in the list cannot be changed after it has * been created. * @param rows the number of items to show. @@ -217,12 +217,12 @@ public class List extends Component implements ItemSelectable, Accessible { * the list will be created with a default of four rows. * Also note that the number of visible rows in the list cannot * be changed after it has been created. - * If the value of multipleMode is - * true, then the user can select multiple items from - * the list. If it is false, only one item at a time + * If the value of {@code multipleMode} is + * {@code true}, then the user can select multiple items from + * the list. If it is {@code false}, only one item at a time * can be selected. * @param rows the number of items to show. - * @param multipleMode if true, + * @param multipleMode if {@code true}, * then multiple selections are allowed; * otherwise, only one item can be selected at a time. * @exception HeadlessException if GraphicsEnvironment.isHeadless() @@ -237,7 +237,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Construct a name for this component. Called by - * getName when the name is null. + * {@code getName} when the name is {@code null}. */ String constructComponentName() { synchronized (List.class) { @@ -286,7 +286,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @return the number of items in the list * @deprecated As of JDK version 1.1, - * replaced by getItemCount(). + * replaced by {@code getItemCount()}. */ @Deprecated public int countItems() { @@ -339,7 +339,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Adds the specified item to the end of the list. * * @param item the item to be added - * @deprecated replaced by add(String). + * @deprecated replaced by {@code add(String)}. */ @Deprecated public void addItem(String item) { @@ -354,8 +354,8 @@ public class List extends Component implements ItemSelectable, Accessible { * the number of items in the list, then the item is added * to the end of the list. * @param item the item to be added; - * if this parameter is null then the item is - * treated as an empty string, "" + * if this parameter is {@code null} then the item is + * treated as an empty string, {@code ""} * @param index the position at which to add the item * @since 1.1 */ @@ -369,7 +369,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @param item the item to be added * @param index the position at which to add the item - * @deprecated replaced by add(String, int). + * @deprecated replaced by {@code add(String, int)}. */ @Deprecated public synchronized void addItem(String item, int index) { @@ -398,7 +398,7 @@ public class List extends Component implements ItemSelectable, Accessible { * with the new string. * @param newValue a new string to replace an existing item * @param index the position of the item to replace - * @exception ArrayIndexOutOfBoundsException if index + * @exception ArrayIndexOutOfBoundsException if {@code index} * is out of range */ public synchronized void replaceItem(String newValue, int index) { @@ -418,7 +418,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by removeAll(). + * replaced by {@code removeAll()}. */ @Deprecated public synchronized void clear() { @@ -458,8 +458,8 @@ public class List extends Component implements ItemSelectable, Accessible { * @see #add(String, int) * @since 1.1 * @exception ArrayIndexOutOfBoundsException - * if the position is less than 0 or - * greater than getItemCount()-1 + * if the {@code position} is less than 0 or + * greater than {@code getItemCount()-1} */ public void remove(int position) { delItem(position); @@ -469,8 +469,8 @@ public class List extends Component implements ItemSelectable, Accessible { * Removes the item at the specified position. * * @param position the index of the item to delete - * @deprecated replaced by remove(String) - * and remove(int). + * @deprecated replaced by {@code remove(String)} + * and {@code remove(int)}. */ @Deprecated public void delItem(int position) { @@ -482,7 +482,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @return the index of the selected item; * if no item is selected, or if multiple items are - * selected, -1 is returned. + * selected, {@code -1} is returned. * @see #select * @see #deselect * @see #isIndexSelected @@ -514,7 +514,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @return the selected item on the list; * if no item is selected, or if multiple items are - * selected, null is returned. + * selected, {@code null} is returned. * @see #select * @see #deselect * @see #isIndexSelected @@ -544,7 +544,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Gets the selected items on this scrolling list in an array of Objects. - * @return an array of Objects representing the + * @return an array of {@code Object}s representing the * selected items on this scrolling list; * if no item is selected, a zero-length array is returned. * @see #getSelectedItems @@ -563,8 +563,8 @@ public class List extends Component implements ItemSelectable, Accessible { *

      Note that this method should be primarily used to * initially select an item in this component. * Programmatically calling this method will not trigger - * an ItemEvent. The only way to trigger an - * ItemEvent is by user interaction. + * an {@code ItemEvent}. The only way to trigger an + * {@code ItemEvent} is by user interaction. * * @param index the position of the item to select * @see #getSelectedItem @@ -649,8 +649,8 @@ public class List extends Component implements ItemSelectable, Accessible { * Determines if the specified item in this scrolling list is * selected. * @param index the item to be checked - * @return true if the specified item has been - * selected; false otherwise + * @return {@code true} if the specified item has been + * selected; {@code false} otherwise * @see #select * @see #deselect * @since 1.1 @@ -665,7 +665,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @param index specifies the item to be checked * @return {@code true} if the item is selected; otherwise {@code false} * @deprecated As of JDK version 1.1, - * replaced by isIndexSelected(int). + * replaced by {@code isIndexSelected(int)}. */ @Deprecated public boolean isSelected(int index) { @@ -680,7 +680,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Gets the number of visible lines in this list. Note that - * once the List has been created, this number + * once the {@code List} has been created, this number * will never change. * @return the number of visible lines in this scrolling list */ @@ -691,8 +691,8 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Determines whether this list allows multiple selections. * - * @return true if this list allows multiple - * selections; otherwise, false + * @return {@code true} if this list allows multiple + * selections; otherwise, {@code false} * @see #setMultipleMode * @since 1.1 */ @@ -706,7 +706,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @return {@code true} if this list allows multiple * selections; otherwise {@code false} * @deprecated As of JDK version 1.1, - * replaced by isMultipleMode(). + * replaced by {@code isMultipleMode()}. */ @Deprecated public boolean allowsMultipleSelections() { @@ -721,7 +721,7 @@ public class List extends Component implements ItemSelectable, Accessible { * If a selected item has the location cursor, only that * item will remain selected. If no selected item has the * location cursor, all items will be deselected. - * @param b if true then multiple selections + * @param b if {@code true} then multiple selections * are allowed; otherwise, only one item from * the list can be selected at once * @see #isMultipleMode @@ -736,7 +736,7 @@ public class List extends Component implements ItemSelectable, Accessible { * * @param b {@code true} to enable multiple mode, {@code false} otherwise * @deprecated As of JDK version 1.1, - * replaced by setMultipleMode(boolean). + * replaced by {@code setMultipleMode(boolean)}. */ @Deprecated public synchronized void setMultipleSelections(boolean b) { @@ -751,7 +751,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Gets the index of the item that was last made visible by - * the method makeVisible. + * the method {@code makeVisible}. * @return the index of the item that was last made visible * @see #makeVisible */ @@ -792,7 +792,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @param rows the number of rows * @return the preferred dimensions for displaying this list * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(int). + * replaced by {@code getPreferredSize(int)}. */ @Deprecated public Dimension preferredSize(int rows) { @@ -816,7 +816,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -847,7 +847,7 @@ public class List extends Component implements ItemSelectable, Accessible { * @param rows the number of rows in the list * @return the minimum dimensions for displaying this list * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(int). + * replaced by {@code getMinimumSize(int)}. */ @Deprecated public Dimension minimumSize(int rows) { @@ -872,7 +872,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -884,8 +884,8 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Adds the specified item listener to receive item events from * this list. Item events are sent in response to user input, but not - * in response to calls to select or deselect. - * If listener l is null, + * in response to calls to {@code select} or {@code deselect}. + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -910,7 +910,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Removes the specified item listener so that it no longer * receives item events from this list. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -933,7 +933,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Returns an array of all the item listeners * registered on this list. * - * @return all of this list's ItemListeners + * @return all of this list's {@code ItemListener}s * or an empty array if no item * listeners are currently registered * @@ -953,7 +953,7 @@ public class List extends Component implements ItemSelectable, Accessible { * on a list item or types Enter when the list has the keyboard * focus. *

      - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -977,7 +977,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Removes the specified action listener so that it no longer * receives action events from this list. Action events * occur when a user double-clicks on a list item. - * If listener l is null, + * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -1000,7 +1000,7 @@ public class List extends Component implements ItemSelectable, Accessible { * Returns an array of all the action listeners * registered on this list. * - * @return all of this list's ActionListeners + * @return all of this list's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -1017,16 +1017,16 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this List. + * upon this {@code List}. * FooListeners are registered using the * addFooListener method. * *

      - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * List l + * {@code List l} * for its item listeners with the following code: * *

      ItemListener[] ils = (ItemListener[])(l.getListeners(ItemListener.class));
      @@ -1035,14 +1035,14 @@ public class List extends Component implements ItemSelectable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this list, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getItemListeners * @since 1.3 @@ -1082,13 +1082,13 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Processes events on this scrolling list. If an event is - * an instance of ItemEvent, it invokes the - * processItemEvent method. Else, if the - * event is an instance of ActionEvent, - * it invokes processActionEvent. + * an instance of {@code ItemEvent}, it invokes the + * {@code processItemEvent} method. Else, if the + * event is an instance of {@code ActionEvent}, + * it invokes {@code processActionEvent}. * If the event is not an item event or an action event, - * it invokes processEvent on the superclass. - *

      Note that if the event parameter is null + * it invokes {@code processEvent} on the superclass. + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1113,17 +1113,17 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Processes item events occurring on this list by * dispatching them to any registered - * ItemListener objects. + * {@code ItemListener} objects. *

      * This method is not called unless item events are * enabled for this component. Item events are enabled * when one of the following occurs: *

        - *
      • An ItemListener object is registered - * via addItemListener. - *
      • Item events are enabled via enableEvents. + *
      • An {@code ItemListener} object is registered + * via {@code addItemListener}. + *
      • Item events are enabled via {@code enableEvents}. *
      - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1144,17 +1144,17 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Processes action events occurring on this component * by dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. *

      * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: *

        - *
      • An ActionListener object is registered - * via addActionListener. - *
      • Action events are enabled via enableEvents. + *
      • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
      • Action events are enabled via {@code enableEvents}. *
      - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1209,7 +1209,7 @@ public class List extends Component implements ItemSelectable, Accessible { */ /** - * The List component's + * The {@code List} component's * Serialized Data Version. * * @serial @@ -1218,22 +1218,22 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ItemListeners - * and ActionListeners as optional data. + * a list of serializable {@code ItemListeners} + * and {@code ActionListeners} as optional data. * The non-serializable listeners are detected and * no attempt is made to serialize them. * - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} * indicates the type of object and is one of the * following: - * itemListenerK indicating an - * ItemListener object; - * actionListenerK indicating an - * ActionListener object + * {@code itemListenerK} indicating an + * {@code ItemListener} object; + * {@code actionListenerK} indicating an + * {@code ActionListener} object * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#itemListenerK * @see java.awt.Component#actionListenerK @@ -1256,17 +1256,17 @@ public class List extends Component implements ItemSelectable, Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive * both item events and action events (as specified * by the key stored in the stream) fired by the - * List. + * {@code List}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to write + * @param s the {@code ObjectInputStream} to write * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see #removeItemListener(ItemListener) * @see #addItemListener(ItemListener) * @see java.awt.GraphicsEnvironment#isHeadless @@ -1300,13 +1300,13 @@ public class List extends Component implements ItemSelectable, Accessible { /** - * Gets the AccessibleContext associated with this - * List. For lists, the AccessibleContext - * takes the form of an AccessibleAWTList. - * A new AccessibleAWTList instance is created, if necessary. + * Gets the {@code AccessibleContext} associated with this + * {@code List}. For lists, the {@code AccessibleContext} + * takes the form of an {@code AccessibleAWTList}. + * A new {@code AccessibleAWTList} instance is created, if necessary. * - * @return an AccessibleAWTList that serves as the - * AccessibleContext of this List + * @return an {@code AccessibleAWTList} that serves as the + * {@code AccessibleContext} of this {@code List} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -1318,7 +1318,7 @@ public class List extends Component implements ItemSelectable, Accessible { /** * This class implements accessibility support for the - * List class. It provides an implementation of the + * {@code List} class. It provides an implementation of the * Java Accessibility API appropriate to list user-interface elements. * @since 1.3 */ @@ -1930,13 +1930,13 @@ public class List extends Component implements ItemSelectable, Accessible { } /** - * Returns the Accessible child, if one exists, - * contained at the local coordinate Point. + * Returns the {@code Accessible} child, if one exists, + * contained at the local coordinate {@code Point}. * * @param p the point relative to the coordinate system of this * object - * @return the Accessible, if it exists, - * at the specified location; otherwise null + * @return the {@code Accessible}, if it exists, + * at the specified location; otherwise {@code null} */ public Accessible getAccessibleAt(Point p) { return null; // object cannot have children! @@ -1945,8 +1945,8 @@ public class List extends Component implements ItemSelectable, Accessible { /** * Returns whether this object can accept focus or not. Objects * that can accept focus will also have the - * AccessibleState.FOCUSABLE state set in their - * AccessibleStateSet. + * {@code AccessibleState.FOCUSABLE} state set in their + * {@code AccessibleStateSet}. * * @return true if object can accept focus; otherwise false * @see AccessibleContext#getAccessibleStateSet diff --git a/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java b/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java index dd8f9e0825f..8af10871768 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MediaTracker.java @@ -31,13 +31,13 @@ import java.awt.image.ImageObserver; import sun.awt.image.MultiResolutionToolkitImage; /** - * The MediaTracker class is a utility class to track + * The {@code MediaTracker} class is a utility class to track * the status of a number of media objects. Media objects could * include audio clips as well as images, though currently only * images are supported. *

      * To use a media tracker, create an instance of - * MediaTracker and call its addImage + * {@code MediaTracker} and call its {@code addImage} * method for each image to be tracked. In addition, each image can * be assigned a unique identifier. This identifier controls the * priority order in which the images are fetched. It can also be used @@ -52,20 +52,20 @@ import sun.awt.image.MultiResolutionToolkitImage; * due to the multi-part nature of animated image * loading and painting, * but it is supported. - * MediaTracker treats an animated image + * {@code MediaTracker} treats an animated image * as completely loaded * when the first frame is completely loaded. - * At that point, the MediaTracker + * At that point, the {@code MediaTracker} * signals any waiters * that the image is completely loaded. - * If no ImageObservers are observing the image + * If no {@code ImageObserver}s are observing the image * when the first frame has finished loading, * the image might flush itself * to conserve resources * (see {@link Image#flush()}). * *

      - * Here is an example of using MediaTracker: + * Here is an example of using {@code MediaTracker}: * *


      {@code
        * import java.applet.Applet;
      @@ -169,7 +169,7 @@ import sun.awt.image.MultiResolutionToolkitImage;
       public class MediaTracker implements java.io.Serializable {
       
           /**
      -     * A given Component that will be
      +     * A given {@code Component} that will be
            * tracked by a media tracker where the image will
            * eventually be drawn.
            *
      @@ -178,8 +178,8 @@ public class MediaTracker implements java.io.Serializable {
            */
           Component target;
           /**
      -     * The head of the list of Images that is being
      -     * tracked by the MediaTracker.
      +     * The head of the list of {@code Images} that is being
      +     * tracked by the {@code MediaTracker}.
            *
            * @serial
            * @see #addImage(Image, int)
      @@ -277,11 +277,11 @@ public class MediaTracker implements java.io.Serializable {
            * 

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkAll(boolean) * @see java.awt.MediaTracker#checkID * @see java.awt.MediaTracker#isErrorAny @@ -295,19 +295,19 @@ public class MediaTracker implements java.io.Serializable { * Checks to see if all images being tracked by this media tracker * have finished loading. *

      - * If the value of the load flag is true, + * If the value of the {@code load} flag is {@code true}, * then this method starts loading any images that are not yet * being loaded. *

      * If there is an error while loading or scaling an image, that * image is considered to have finished loading. Use the - * isErrorAny and isErrorID methods to + * {@code isErrorAny} and {@code isErrorID} methods to * check for errors. - * @param load if true, start loading any + * @param load if {@code true}, start loading any * images that are not yet being loaded - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkID * @see java.awt.MediaTracker#checkAll() * @see java.awt.MediaTracker#isErrorAny() @@ -331,9 +331,9 @@ public class MediaTracker implements java.io.Serializable { /** * Checks the error status of all of the images. - * @return true if any of the images tracked + * @return {@code true} if any of the images tracked * by this media tracker had an error during - * loading; false otherwise + * loading; {@code false} otherwise * @see java.awt.MediaTracker#isErrorID * @see java.awt.MediaTracker#getErrorsAny */ @@ -352,7 +352,7 @@ public class MediaTracker implements java.io.Serializable { * Returns a list of all media that have encountered an error. * @return an array of media objects tracked by this * media tracker that have encountered - * an error, or null if + * an error, or {@code null} if * there are none with errors * @see java.awt.MediaTracker#isErrorAny * @see java.awt.MediaTracker#getErrorsID @@ -388,7 +388,7 @@ public class MediaTracker implements java.io.Serializable { *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @see java.awt.MediaTracker#waitForID(int) * @see java.awt.MediaTracker#waitForAll(long) @@ -405,16 +405,16 @@ public class MediaTracker implements java.io.Serializable { * Starts loading all images tracked by this media tracker. This * method waits until all the images being tracked have finished * loading, or until the length of time specified in milliseconds - * by the ms argument has passed. + * by the {@code ms} argument has passed. *

      * If there is an error while loading or scaling an image, then * that image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @param ms the number of milliseconds to wait * for the loading to complete - * @return true if all images were successfully - * loaded; false otherwise + * @return {@code true} if all images were successfully + * loaded; {@code false} otherwise * @see java.awt.MediaTracker#waitForID(int) * @see java.awt.MediaTracker#waitForAll(long) * @see java.awt.MediaTracker#isErrorAny @@ -451,15 +451,15 @@ public class MediaTracker implements java.io.Serializable { * status of all media that are tracked by this media tracker. *

      * Possible flags defined by the - * MediaTracker class are LOADING, - * ABORTED, ERRORED, and - * COMPLETE. An image that hasn't started + * {@code MediaTracker} class are {@code LOADING}, + * {@code ABORTED}, {@code ERRORED}, and + * {@code COMPLETE}. An image that hasn't started * loading has zero as its status. *

      - * If the value of load is true, then + * If the value of {@code load} is {@code true}, then * this method starts loading any images that are not yet being loaded. * - * @param load if true, start loading + * @param load if {@code true}, start loading * any images that are not yet being loaded * @return the bitwise inclusive OR of the status of * all of the media being tracked @@ -492,12 +492,12 @@ public class MediaTracker implements java.io.Serializable { *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @param id the identifier of the images to check - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkID(int, boolean) * @see java.awt.MediaTracker#checkAll() * @see java.awt.MediaTracker#isErrorAny() @@ -511,20 +511,20 @@ public class MediaTracker implements java.io.Serializable { * Checks to see if all images tracked by this media tracker that * are tagged with the specified identifier have finished loading. *

      - * If the value of the load flag is true, + * If the value of the {@code load} flag is {@code true}, * then this method starts loading any images that are not yet * being loaded. *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny or isErrorID methods to + * {@code isErrorAny} or {@code isErrorID} methods to * check for errors. * @param id the identifier of the images to check - * @param load if true, start loading any + * @param load if {@code true}, start loading any * images that are not yet being loaded - * @return true if all images have finished loading, + * @return {@code true} if all images have finished loading, * have been aborted, or have encountered - * an error; false otherwise + * an error; {@code false} otherwise * @see java.awt.MediaTracker#checkID(int, boolean) * @see java.awt.MediaTracker#checkAll() * @see java.awt.MediaTracker#isErrorAny() @@ -553,9 +553,9 @@ public class MediaTracker implements java.io.Serializable { * Checks the error status of all of the images tracked by this * media tracker with the specified identifier. * @param id the identifier of the images to check - * @return true if any of the images with the + * @return {@code true} if any of the images with the * specified identifier had an error during - * loading; false otherwise + * loading; {@code false} otherwise * @see java.awt.MediaTracker#isErrorAny * @see java.awt.MediaTracker#getErrorsID */ @@ -579,7 +579,7 @@ public class MediaTracker implements java.io.Serializable { * @return an array of media objects tracked by this media * tracker with the specified identifier * that have encountered an error, or - * null if there are none with errors + * {@code null} if there are none with errors * @see java.awt.MediaTracker#isErrorID * @see java.awt.MediaTracker#isErrorAny * @see java.awt.MediaTracker#getErrorsAny @@ -619,7 +619,7 @@ public class MediaTracker implements java.io.Serializable { *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * isErrorAny and isErrorID methods to + * {@code isErrorAny} and {@code isErrorID} methods to * check for errors. * @param id the identifier of the images to check * @see java.awt.MediaTracker#waitForAll @@ -636,13 +636,13 @@ public class MediaTracker implements java.io.Serializable { * Starts loading all images tracked by this media tracker with the * specified identifier. This method waits until all the images with * the specified identifier have finished loading, or until the - * length of time specified in milliseconds by the ms + * length of time specified in milliseconds by the {@code ms} * argument has passed. *

      * If there is an error while loading or scaling an image, then that * image is considered to have finished loading. Use the - * statusID, isErrorID, and - * isErrorAny methods to check for errors. + * {@code statusID}, {@code isErrorID}, and + * {@code isErrorAny} methods to check for errors. * @param id the identifier of the images to check * @param ms the length of time, in milliseconds, to wait * for the loading to complete @@ -686,15 +686,15 @@ public class MediaTracker implements java.io.Serializable { * tracked by this media tracker. *

      * Possible flags defined by the - * MediaTracker class are LOADING, - * ABORTED, ERRORED, and - * COMPLETE. An image that hasn't started + * {@code MediaTracker} class are {@code LOADING}, + * {@code ABORTED}, {@code ERRORED}, and + * {@code COMPLETE}. An image that hasn't started * loading has zero as its status. *

      - * If the value of load is true, then + * If the value of {@code load} is {@code true}, then * this method starts loading any images that are not yet being loaded. * @param id the identifier of the images to check - * @param load if true, start loading + * @param load if {@code true}, start loading * any images that are not yet being loaded * @return the bitwise inclusive OR of the status of * all of the media with the specified @@ -761,7 +761,7 @@ public class MediaTracker implements java.io.Serializable { /** * Removes the specified image from the specified tracking * ID of this media tracker. - * All instances of Image being tracked + * All instances of {@code Image} being tracked * under the specified ID are removed regardless of scale. * @param image the image to be removed * @param id the tracking ID from which to remove the image diff --git a/jdk/src/java.desktop/share/classes/java/awt/Menu.java b/jdk/src/java.desktop/share/classes/java/awt/Menu.java index af7d4c6b734..70b5ee1f25f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Menu.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Menu.java @@ -34,7 +34,7 @@ import javax.accessibility.*; import sun.awt.AWTAccessor; /** - * A Menu object is a pull-down menu component + * A {@code Menu} object is a pull-down menu component * that is deployed from a menu bar. *

      * A menu can optionally be a tear-off menu. A tear-off menu @@ -45,10 +45,10 @@ import sun.awt.AWTAccessor; * On platforms that do not support tear-off menus, the tear-off * property is ignored. *

      - * Each item in a menu must belong to the MenuItem - * class. It can be an instance of MenuItem, a submenu - * (an instance of Menu), or a check box (an instance of - * CheckboxMenuItem). + * Each item in a menu must belong to the {@code MenuItem} + * class. It can be an instance of {@code MenuItem}, a submenu + * (an instance of {@code Menu}), or a check box (an instance of + * {@code CheckboxMenuItem}). * * @author Sami Shaio * @see java.awt.MenuItem @@ -83,8 +83,8 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * This field indicates whether the menu has the * tear of property or not. It will be set to - * true if the menu has the tear off - * property and it will be set to false + * {@code true} if the menu has the tear off + * property and it will be set to {@code false} * if it does not. * A torn off menu can be deleted by a user when * it is no longer needed. @@ -95,10 +95,10 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { boolean tearOff; /** - * This field will be set to true + * This field will be set to {@code true} * if the Menu in question is actually a help - * menu. Otherwise it will be set to - * false. + * menu. Otherwise it will be set to + * {@code false}. * * @serial */ @@ -146,7 +146,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * support tear-off menus, this value is silently ignored. * @param label the menu's label in the menu bar, or in * another menu of which this menu is a submenu. - * @param tearOff if true, the menu + * @param tearOff if {@code true}, the menu * is a tear-off menu. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -204,8 +204,8 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * Tear-off functionality may not be supported by all * implementations of AWT. If a particular implementation doesn't * support tear-off menus, this value is silently ignored. - * @return true if this is a tear-off menu; - * false otherwise. + * @return {@code true} if this is a tear-off menu; + * {@code false} otherwise. */ public boolean isTearOff() { return tearOff; @@ -225,7 +225,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * * @return the number of items in this menu * @deprecated As of JDK version 1.1, - * replaced by getItemCount(). + * replaced by {@code getItemCount()}. */ @Deprecated public int countItems() { @@ -304,7 +304,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @see java.awt.Menu#add(java.lang.String) * @see java.awt.Menu#add(java.awt.MenuItem) * @exception IllegalArgumentException if the value of - * index is less than zero + * {@code index} is less than zero * @since 1.1 */ @@ -340,7 +340,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * Inserts a menu item with the specified label into this menu * at the specified position. This is a convenience method for - * insert(menuItem, index). + * {@code insert(menuItem, index)}. * * @param label the text on the item * @param index the position at which the menu item @@ -348,7 +348,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @see java.awt.Menu#add(java.lang.String) * @see java.awt.Menu#add(java.awt.MenuItem) * @exception IllegalArgumentException if the value of - * index is less than zero + * {@code index} is less than zero * @since 1.1 */ @@ -369,7 +369,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * @param index the position at which the * menu separator should be inserted. * @exception IllegalArgumentException if the value of - * index is less than 0. + * {@code index} is less than 0. * @see java.awt.Menu#addSeparator * @since 1.1 */ @@ -423,7 +423,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * Removes the specified menu item from this menu. * @param item the item to be removed from the menu. - * If item is null + * If {@code item} is {@code null} * or is not in this menu, this method does * nothing. */ @@ -519,7 +519,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { /** * Writes default serializable fields to stream. * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(ObjectInputStream) */ @@ -530,13 +530,13 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { } /** - * Reads the ObjectInputStream. + * Reads the {@code ObjectInputStream}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see #writeObject(ObjectOutputStream) */ @@ -552,11 +552,11 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { } /** - * Returns a string representing the state of this Menu. + * Returns a string representing the state of this {@code Menu}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this menu */ @@ -606,7 +606,7 @@ public class Menu extends MenuItem implements MenuContainer, Accessible { * subclassed by menu component developers. *

      * This class implements accessibility support for the - * Menu class. It provides an implementation of the + * {@code Menu} class. It provides an implementation of the * Java Accessibility API appropriate to menu user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java index b8bb64d8efb..4a57b0dbf2c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java @@ -34,10 +34,10 @@ import java.awt.event.KeyEvent; import javax.accessibility.*; /** - * The MenuBar class encapsulates the platform's + * The {@code MenuBar} class encapsulates the platform's * concept of a menu bar bound to a frame. In order to associate - * the menu bar with a Frame object, call the - * frame's setMenuBar method. + * the menu bar with a {@code Frame} object, call the + * frame's {@code setMenuBar} method. *

      * * This is what a menu bar might look like: @@ -52,8 +52,8 @@ import javax.accessibility.*; * (Keyboard shortcuts, which are optional, provide the user with * an alternative to the mouse for invoking a menu item and the * action that is associated with it.) - * Each menu item can maintain an instance of MenuShortcut. - * The MenuBar class defines several methods, + * Each menu item can maintain an instance of {@code MenuShortcut}. + * The {@code MenuBar} class defines several methods, * {@link MenuBar#shortcuts} and * {@link MenuBar#getShortcutMenuItem} * that retrieve information about the shortcuts a given @@ -289,7 +289,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible * * @return the number of menus on the menu bar. * @deprecated As of JDK version 1.1, - * replaced by getMenuCount(). + * replaced by {@code getMenuCount()}. */ @Deprecated public int countMenus() { @@ -342,9 +342,9 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible } /** - * Gets the instance of MenuItem associated - * with the specified MenuShortcut object, - * or null if none of the menu items being managed + * Gets the instance of {@code MenuItem} associated + * with the specified {@code MenuShortcut} object, + * or {@code null} if none of the menu items being managed * by this menu bar is associated with the specified menu * shortcut. * @param s the specified menu shortcut. @@ -420,7 +420,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible /** * Writes default serializable fields to stream. * - * @param s the ObjectOutputStream to write + * @param s the {@code ObjectOutputStream} to write * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(java.io.ObjectInputStream) */ @@ -432,13 +432,13 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible } /** - * Reads the ObjectInputStream. + * Reads the {@code ObjectInputStream}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see #writeObject(java.io.ObjectOutputStream) */ @@ -494,7 +494,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible * subclassed by menu component developers. *

      * This class implements accessibility support for the - * MenuBar class. It provides an implementation of the + * {@code MenuBar} class. It provides an implementation of the * Java Accessibility API appropriate to menu bar user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java index fca144ac0f8..c6097397c98 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuComponent.java @@ -38,13 +38,13 @@ import java.security.AccessControlContext; import java.security.AccessController; /** - * The abstract class MenuComponent is the superclass + * The abstract class {@code MenuComponent} is the superclass * of all menu-related components. In this respect, the class - * MenuComponent is analogous to the abstract superclass - * Component for AWT components. + * {@code MenuComponent} is analogous to the abstract superclass + * {@code Component} for AWT components. *

      * Menu components receive and process AWT events, just as components do, - * through the method processEvent. + * through the method {@code processEvent}. * * @author Arthur van Hoff * @since 1.0 @@ -63,15 +63,15 @@ public abstract class MenuComponent implements java.io.Serializable { transient MenuContainer parent; /** - * The AppContext of the MenuComponent. + * The {@code AppContext} of the {@code MenuComponent}. * This is set in the constructor and never changes. */ transient AppContext appContext; /** * The menu component's font. This value can be - * null at which point a default will be used. - * This defaults to null. + * {@code null} at which point a default will be used. + * This defaults to {@code null}. * * @serial * @see #setFont(Font) @@ -80,7 +80,7 @@ public abstract class MenuComponent implements java.io.Serializable { volatile Font font; /** - * The menu component's name, which defaults to null. + * The menu component's name, which defaults to {@code null}. * @serial * @see #getName() * @see #setName(String) @@ -89,15 +89,15 @@ public abstract class MenuComponent implements java.io.Serializable { /** * A variable to indicate whether a name is explicitly set. - * If true the name will be set explicitly. - * This defaults to false. + * If {@code true} the name will be set explicitly. + * This defaults to {@code false}. * @serial * @see #setName(String) */ private boolean nameExplicitlySet = false; /** - * Defaults to false. + * Defaults to {@code false}. * @serial * @see #dispatchEvent(AWTEvent) */ @@ -164,10 +164,10 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Creates a MenuComponent. + * Creates a {@code MenuComponent}. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless - * returns true + * {@code GraphicsEnvironment.isHeadless} + * returns {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ public MenuComponent() throws HeadlessException { @@ -176,9 +176,9 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Constructs a name for this MenuComponent. - * Called by getName when the name is null. - * @return a name for this MenuComponent + * Constructs a name for this {@code MenuComponent}. + * Called by {@code getName} when the name is {@code null}. + * @return a name for this {@code MenuComponent} */ String constructComponentName() { return null; // For strict compliance with prior platform versions, a MenuComponent @@ -226,7 +226,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the parent container for this menu component. * @return the menu component containing this menu component, - * or null if this menu component + * or {@code null} if this menu component * is the outermost component, the menu bar itself */ public MenuContainer getParent() { @@ -243,7 +243,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the font used for this menu component. * @return the font used in this menu component, if there is one; - * null otherwise + * {@code null} otherwise * @see java.awt.MenuComponent#setFont */ public Font getFont() { @@ -290,7 +290,7 @@ public abstract class MenuComponent implements java.io.Serializable { * component, unless those subcomponents specify a different font. *

      * Some platforms may not support setting of all font attributes - * of a menu component; in such cases, calling setFont + * of a menu component; in such cases, calling {@code setFont} * will have no effect on the unsupported font attributes of this * menu component. Unless subcomponents of this menu component * specify a different font, this font will be used by those @@ -385,7 +385,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** * Processes events occurring on this menu component. - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -397,10 +397,10 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns a string representing the state of this - * MenuComponent. This method is intended to be used + * {@code MenuComponent}. This method is intended to be used * only for debugging purposes, and the content and format of the * returned string may vary between implementations. The returned - * string may be empty but may not be null. + * string may be empty but may not be {@code null}. * * @return the parameter string of this menu component */ @@ -430,10 +430,10 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Reads the menu component from an object input stream. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @serial * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -466,16 +466,16 @@ public abstract class MenuComponent implements java.io.Serializable { AccessibleContext accessibleContext = null; /** - * Gets the AccessibleContext associated with - * this MenuComponent. + * Gets the {@code AccessibleContext} associated with + * this {@code MenuComponent}. * - * The method implemented by this base class returns null. - * Classes that extend MenuComponent + * The method implemented by this base class returns {@code null}. + * Classes that extend {@code MenuComponent} * should implement this method to return the - * AccessibleContext associated with the subclass. + * {@code AccessibleContext} associated with the subclass. * - * @return the AccessibleContext of this - * MenuComponent + * @return the {@code AccessibleContext} of this + * {@code MenuComponent} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -483,7 +483,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Inner class of MenuComponent used to provide + * Inner class of {@code MenuComponent} used to provide * default support for accessibility. This class is not meant * to be used directly by application developers, but is instead * meant only to be subclassed by menu component developers. @@ -512,11 +512,11 @@ public abstract class MenuComponent implements java.io.Serializable { // /** - * Gets the AccessibleSelection associated with this - * object which allows its Accessible children to be selected. + * Gets the {@code AccessibleSelection} associated with this + * object which allows its {@code Accessible} children to be selected. * - * @return AccessibleSelection if supported by object; - * else return null + * @return {@code AccessibleSelection} if supported by object; + * else return {@code null} * @see AccessibleSelection */ public AccessibleSelection getAccessibleSelection() { @@ -525,14 +525,14 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the accessible name of this object. This should almost never - * return java.awt.MenuComponent.getName, as that + * return {@code java.awt.MenuComponent.getName}, as that * generally isn't a localized name, and doesn't have meaning for the * user. If the object is fundamentally a text object (e.g. a menu item), the * accessible name should be the text of the object (e.g. "save"). * If the object has a tooltip, the tooltip text may also be an * appropriate String to return. * - * @return the localized name of the object -- can be null + * @return the localized name of the object -- can be {@code null} * if this object does not have a name * @see AccessibleContext#setAccessibleName */ @@ -552,7 +552,7 @@ public abstract class MenuComponent implements java.io.Serializable { * text document" instead). * * @return the localized description of the object -- can be - * null if this object does not have a description + * {@code null} if this object does not have a description * @see AccessibleContext#setAccessibleDescription */ public String getAccessibleDescription() { @@ -562,7 +562,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the role of this object. * - * @return an instance of AccessibleRole + * @return an instance of {@code AccessibleRole} * describing the role of the object * @see AccessibleRole */ @@ -573,7 +573,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the state of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see AccessibleState */ @@ -582,13 +582,13 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Gets the Accessible parent of this object. - * If the parent of this object implements Accessible, - * this method should simply return getParent. + * Gets the {@code Accessible} parent of this object. + * If the parent of this object implements {@code Accessible}, + * this method should simply return {@code getParent}. * - * @return the Accessible parent of this object -- can - * be null if this object does not have an - * Accessible parent + * @return the {@code Accessible} parent of this object -- can + * be {@code null} if this object does not have an + * {@code Accessible} parent */ public Accessible getAccessibleParent() { if (accessibleParent != null) { @@ -615,7 +615,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the number of accessible children in the object. If all - * of the children of this object implement Accessible, + * of the children of this object implement {@code Accessible}, * then this method should return the number of children of this object. * * @return the number of accessible children in the object @@ -625,7 +625,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Returns the nth Accessible child of the object. + * Returns the nth {@code Accessible} child of the object. * * @param i zero-based index of child * @return the nth Accessible child of the object @@ -648,8 +648,8 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Gets the AccessibleComponent associated with - * this object if one exists. Otherwise return null. + * Gets the {@code AccessibleComponent} associated with + * this object if one exists. Otherwise return {@code null}. * * @return the component */ @@ -664,7 +664,7 @@ public abstract class MenuComponent implements java.io.Serializable { * Gets the background color of this object. * * @return the background color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getBackground() { return null; // Not supported for MenuComponents @@ -672,9 +672,9 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Sets the background color of this object. - * (For transparency, see isOpaque.) + * (For transparency, see {@code isOpaque}.) * - * @param c the new Color for the background + * @param c the new {@code Color} for the background * @see Component#isOpaque */ public void setBackground(Color c) { @@ -685,7 +685,7 @@ public abstract class MenuComponent implements java.io.Serializable { * Gets the foreground color of this object. * * @return the foreground color, if supported, of the object; - * otherwise, null + * otherwise, {@code null} */ public Color getForeground() { return null; // Not supported for MenuComponents @@ -694,59 +694,59 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Sets the foreground color of this object. * - * @param c the new Color for the foreground + * @param c the new {@code Color} for the foreground */ public void setForeground(Color c) { // Not supported for MenuComponents } /** - * Gets the Cursor of this object. + * Gets the {@code Cursor} of this object. * - * @return the Cursor, if supported, of the object; - * otherwise, null + * @return the {@code Cursor}, if supported, of the object; + * otherwise, {@code null} */ public Cursor getCursor() { return null; // Not supported for MenuComponents } /** - * Sets the Cursor of this object. + * Sets the {@code Cursor} of this object. *

      * The method may have no visual effect if the Java platform * implementation and/or the native system do not support * changing the mouse cursor shape. - * @param cursor the new Cursor for the object + * @param cursor the new {@code Cursor} for the object */ public void setCursor(Cursor cursor) { // Not supported for MenuComponents } /** - * Gets the Font of this object. + * Gets the {@code Font} of this object. * - * @return the Font,if supported, for the object; - * otherwise, null + * @return the {@code Font},if supported, for the object; + * otherwise, {@code null} */ public Font getFont() { return MenuComponent.this.getFont(); } /** - * Sets the Font of this object. + * Sets the {@code Font} of this object. * - * @param f the new Font for the object + * @param f the new {@code Font} for the object */ public void setFont(Font f) { MenuComponent.this.setFont(f); } /** - * Gets the FontMetrics of this object. + * Gets the {@code FontMetrics} of this object. * - * @param f the Font + * @param f the {@code Font} * @return the FontMetrics, if supported, the object; - * otherwise, null + * otherwise, {@code null} * @see #getFont */ public FontMetrics getFontMetrics(Font f) { @@ -776,7 +776,7 @@ public abstract class MenuComponent implements java.io.Serializable { * object intends to be visible; however, it may not in fact be * showing on the screen because one of the objects that this object * is contained by is not visible. To determine if an object is - * showing on the screen, use isShowing. + * showing on the screen, use {@code isShowing}. * * @return true if object is visible; otherwise, false */ @@ -811,9 +811,9 @@ public abstract class MenuComponent implements java.io.Serializable { * where the point's x and y coordinates are defined to be relative to * the coordinate system of the object. * - * @param p the Point relative to the coordinate + * @param p the {@code Point} relative to the coordinate * system of the object - * @return true if object contains Point; otherwise false + * @return true if object contains {@code Point}; otherwise false */ public boolean contains(Point p) { return false; // Not supported for MenuComponents @@ -822,7 +822,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the location of the object on the screen. * - * @return location of object on screen -- can be null + * @return location of object on screen -- can be {@code null} * if this object is not on the screen */ public Point getLocationOnScreen() { @@ -834,9 +834,9 @@ public abstract class MenuComponent implements java.io.Serializable { * of a point specifying the object's top-left corner in the screen's * coordinate space. * - * @return an instance of Point representing the + * @return an instance of {@code Point} representing the * top-left corner of the object's bounds in the coordinate - * space of the screen; null if + * space of the screen; {@code null} if * this object or its parent are not on the screen */ public Point getLocation() { @@ -852,12 +852,12 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the bounds of this object in the form of a - * Rectangle object. + * {@code Rectangle} object. * The bounds specify this object's width, height, and location * relative to its parent. * * @return a rectangle indicating this component's bounds; - * null if this object is not on the screen + * {@code null} if this object is not on the screen */ public Rectangle getBounds() { return null; // Not supported for MenuComponents @@ -865,7 +865,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Sets the bounds of this object in the form of a - * Rectangle object. + * {@code Rectangle} object. * The bounds specify this object's width, height, and location * relative to its parent. * @@ -877,13 +877,13 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Returns the size of this object in the form of a - * Dimension object. The height field of - * the Dimension object contains this object's - * height, and the width field of the Dimension + * {@code Dimension} object. The height field of + * the {@code Dimension} object contains this object's + * height, and the width field of the {@code Dimension} * object contains this object's width. * - * @return a Dimension object that indicates the - * size of this component; null + * @return a {@code Dimension} object that indicates the + * size of this component; {@code null} * if this object is not on the screen */ public Dimension getSize() { @@ -893,7 +893,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Resizes this object. * - * @param d - the Dimension specifying the + * @param d the {@code Dimension} specifying the * new size of the object */ public void setSize(Dimension d) { @@ -901,16 +901,16 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Returns the Accessible child, if one exists, - * contained at the local coordinate Point. - * If there is no Accessible child, null + * Returns the {@code Accessible} child, if one exists, + * contained at the local coordinate {@code Point}. + * If there is no {@code Accessible} child, {@code null} * is returned. * * @param p the point defining the top-left corner of the - * Accessible, given in the coordinate space + * {@code Accessible}, given in the coordinate space * of the object's parent - * @return the Accessible, if it exists, - * at the specified location; else null + * @return the {@code Accessible}, if it exists, + * at the specified location; else {@code null} */ public Accessible getAccessibleAt(Point p) { return null; // MenuComponents don't have children @@ -956,7 +956,7 @@ public abstract class MenuComponent implements java.io.Serializable { // /** - * Returns the number of Accessible children currently selected. + * Returns the number of {@code Accessible} children currently selected. * If no children are selected, the return value will be 0. * * @return the number of items currently selected @@ -966,10 +966,10 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Returns an Accessible representing the specified + * Returns an {@code Accessible} representing the specified * selected child in the object. If there isn't a selection, or there are * fewer children selected than the integer passed in, the return - * value will be null. + * value will be {@code null}. *

      Note that the index represents the i-th selected child, which * is different from the i-th child. * @@ -987,7 +987,7 @@ public abstract class MenuComponent implements java.io.Serializable { * @return true if the current child of this object is selected; * else false * @param i the zero-based index of the child in this - * Accessible object + * {@code Accessible} object * @see AccessibleContext#getAccessibleChild */ public boolean isAccessibleChildSelected(int i) { @@ -995,7 +995,7 @@ public abstract class MenuComponent implements java.io.Serializable { } /** - * Adds the specified Accessible child of the object + * Adds the specified {@code Accessible} child of the object * to the object's selection. If the object supports multiple selections, * the specified child is added to any existing selection, otherwise * it replaces any existing selection in the object. If the @@ -1068,7 +1068,7 @@ public abstract class MenuComponent implements java.io.Serializable { /** * Gets the state of this object. * - * @return an instance of AccessibleStateSet + * @return an instance of {@code AccessibleStateSet} * containing the current state set of the object * @see AccessibleState */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java index 6c289f1ccf5..3a70fe2bee0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuItem.java @@ -35,9 +35,9 @@ import sun.awt.AWTAccessor; /** * All items in a menu must belong to the class - * MenuItem, or one of its subclasses. + * {@code MenuItem}, or one of its subclasses. *

      - * The default MenuItem object embodies + * The default {@code MenuItem} object embodies * a simple labeled menu item. *

      * This picture of a menu bar shows five menu items: @@ -45,24 +45,24 @@ import sun.awt.AWTAccessor; * style="float:center; margin: 7px 10px;"> *
      * The first two items are simple menu items, labeled - * "Basic" and "Simple". + * {@code "Basic"} and {@code "Simple"}. * Following these two items is a separator, which is itself - * a menu item, created with the label "-". - * Next is an instance of CheckboxMenuItem - * labeled "Check". The final menu item is a + * a menu item, created with the label {@code "-"}. + * Next is an instance of {@code CheckboxMenuItem} + * labeled {@code "Check"}. The final menu item is a * submenu labeled "More Examples", - * and this submenu is an instance of Menu. + * and this submenu is an instance of {@code Menu}. *

      * When a menu item is selected, AWT sends an action event to * the menu item. Since the event is an - * instance of ActionEvent, the processEvent + * instance of {@code ActionEvent}, the {@code processEvent} * method examines the event and passes it along to - * processActionEvent. The latter method redirects the - * event to any ActionListener objects that have + * {@code processActionEvent}. The latter method redirects the + * event to any {@code ActionListener} objects that have * registered an interest in action events generated by this * menu item. *

      - * Note that the subclass Menu overrides this behavior and + * Note that the subclass {@code Menu} overrides this behavior and * does not send any event to the frame until one of its subitems is * selected. * @@ -103,8 +103,8 @@ public class MenuItem extends MenuComponent implements Accessible { /** * A value to indicate whether a menu item is enabled - * or not. If it is enabled, enabled will - * be set to true. Else enabled will + * or not. If it is enabled, {@code enabled} will + * be set to true. Else {@code enabled} will * be set to false. * * @serial @@ -114,7 +114,7 @@ public class MenuItem extends MenuComponent implements Accessible { boolean enabled = true; /** - * label is the label of a menu item. + * {@code label} is the label of a menu item. * It can be any string. * * @serial @@ -124,9 +124,9 @@ public class MenuItem extends MenuComponent implements Accessible { String label; /** - * This field indicates the command tha has been issued + * This field indicates the command that has been issued * by a particular menu item. - * By default the actionCommand + * By default the {@code actionCommand} * is the label of the menu item, unless it has been * set using setActionCommand. * @@ -204,7 +204,7 @@ public class MenuItem extends MenuComponent implements Accessible { * a separator between menu items. By default, all menu * items except for separators are enabled. * @param label the label for this menu item. - * @param s the instance of MenuShortcut + * @param s the instance of {@code MenuShortcut} * associated with this menu item. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -239,7 +239,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Gets the label for this menu item. - * @return the label of this menu item, or null + * @return the label of this menu item, or {@code null} if this menu item has no label. * @see java.awt.MenuItem#setLabel * @since 1.0 @@ -250,7 +250,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Sets the label for this menu item to the specified label. - * @param label the new label, or null for no label. + * @param label the new label, or {@code null} for no label. * @see java.awt.MenuItem#getLabel * @since 1.0 */ @@ -276,8 +276,8 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Sets whether or not this menu item can be chosen. - * @param b if true, enables this menu item; - * if false, disables it. + * @param b if {@code true}, enables this menu item; + * if {@code false}, disables it. * @see java.awt.MenuItem#isEnabled * @since 1.1 */ @@ -287,7 +287,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public synchronized void enable() { @@ -304,7 +304,7 @@ public class MenuItem extends MenuComponent implements Accessible { * @param b if {@code true}, enables this menu item; * otherwise disables * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public void enable(boolean b) { @@ -317,7 +317,7 @@ public class MenuItem extends MenuComponent implements Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by setEnabled(boolean). + * replaced by {@code setEnabled(boolean)}. */ @Deprecated public synchronized void disable() { @@ -329,10 +329,10 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Get the MenuShortcut object associated with this + * Get the {@code MenuShortcut} object associated with this * menu item, * @return the menu shortcut associated with this menu item, - * or null if none has been specified. + * or {@code null} if none has been specified. * @see java.awt.MenuItem#setShortcut * @since 1.1 */ @@ -341,7 +341,7 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Set the MenuShortcut object associated with this + * Set the {@code MenuShortcut} object associated with this * menu item. If a menu shortcut is already associated with * this menu item, it is replaced. * @param s the menu shortcut to associate @@ -358,7 +358,7 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Delete any MenuShortcut object associated + * Delete any {@code MenuShortcut} object associated * with this menu item. * @since 1.1 */ @@ -454,8 +454,8 @@ public class MenuItem extends MenuComponent implements Accessible { *

      * Since event types are automatically enabled when a listener for * that type is added to the menu item, this method only needs - * to be invoked by subclasses of MenuItem which desire to - * have the specified event types delivered to processEvent + * to be invoked by subclasses of {@code MenuItem} which desire to + * have the specified event types delivered to {@code processEvent} * regardless of whether a listener is registered. * * @param eventsToEnable the event mask defining the event types @@ -562,7 +562,7 @@ public class MenuItem extends MenuComponent implements Accessible { * Returns an array of all the action listeners * registered on this menu item. * - * @return all of this menu item's ActionListeners + * @return all of this menu item's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -579,16 +579,16 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this MenuItem. + * upon this {@code MenuItem}. * FooListeners are registered using the * addFooListener method. * *

      - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * MenuItem m + * {@code MenuItem m} * for its action listeners with the following code: * *

      ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));
      @@ -598,14 +598,14 @@ public class MenuItem extends MenuComponent implements Accessible { * @param the type of the listeners * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this menu item, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getActionListeners * @since 1.3 @@ -620,12 +620,12 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Processes events on this menu item. If the event is an - * instance of ActionEvent, it invokes - * processActionEvent, another method - * defined by MenuItem. + * instance of {@code ActionEvent}, it invokes + * {@code processActionEvent}, another method + * defined by {@code MenuItem}. *

      * Currently, menu items only support action events. - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -654,16 +654,16 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Processes action events occurring on this menu item, * by dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: *

        - *
      • An ActionListener object is registered - * via addActionListener. - *
      • Action events are enabled via enableEvents. + *
      • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
      • Action events are enabled via {@code enableEvents}. *
      - *

      Note that if the event parameter is null + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -681,11 +681,11 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Returns a string representing the state of this MenuItem. + * Returns a string representing the state of this {@code MenuItem}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this menu item */ @@ -710,17 +710,17 @@ public class MenuItem extends MenuComponent implements Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable ActionListeners + * a list of serializable {@code ActionListeners} * as optional data. The non-serializable listeners are * detected and no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} * indicates the type of object and is one of the following: - * actionListenerK indicating an - * ActionListener object + * {@code actionListenerK} indicating an + * {@code ActionListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see #readObject(ObjectInputStream) @@ -735,15 +735,15 @@ public class MenuItem extends MenuComponent implements Accessible { } /** - * Reads the ObjectInputStream and if it - * isn't null adds a listener to receive - * action events fired by the Menu Item. + * Reads the {@code ObjectInputStream} and if it + * isn't {@code null} adds a listener to receive + * action events fired by the {@code Menu} Item. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see #removeActionListener(ActionListener) * @see #addActionListener(ActionListener) * @see #writeObject(ObjectOutputStream) @@ -800,7 +800,7 @@ public class MenuItem extends MenuComponent implements Accessible { * subclassed by menu component developers. *

      * This class implements accessibility support for the - * MenuItem class. It provides an implementation of the + * {@code MenuItem} class. It provides an implementation of the * Java Accessibility API appropriate to menu item user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java b/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java index cba251bbf4b..57526ff4e6d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MenuShortcut.java @@ -27,27 +27,27 @@ package java.awt; import java.awt.event.KeyEvent; /** - * The MenuShortcutclass represents a keyboard accelerator + * The {@code MenuShortcut} class represents a keyboard accelerator * for a MenuItem. *

      * Menu shortcuts are created using virtual keycodes, not characters. * For example, a menu shortcut for Ctrl-a (assuming that Control is * the accelerator key) would be created with code like the following: *

      - * MenuShortcut ms = new MenuShortcut(KeyEvent.VK_A, false); + * {@code MenuShortcut ms = new MenuShortcut(KeyEvent.VK_A, false);} *

      or alternatively *

      - * MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('A'), false); + * {@code MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('A'), false);} *

      * Menu shortcuts may also be constructed for a wider set of keycodes - * using the java.awt.event.KeyEvent.getExtendedKeyCodeForChar call. + * using the {@code java.awt.event.KeyEvent.getExtendedKeyCodeForChar} call. * For example, a menu shortcut for "Ctrl+cyrillic ef" is created by *

      * MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('\u0444'), false); *

      - * Note that shortcuts created with a keycode or an extended keycode defined as a constant in KeyEvent + * Note that shortcuts created with a keycode or an extended keycode defined as a constant in {@code KeyEvent} * work regardless of the current keyboard layout. However, a shortcut made of - * an extended keycode not listed in KeyEvent + * an extended keycode not listed in {@code KeyEvent} * only work if the current keyboard layout produces a corresponding letter. *

      * The accelerator key is platform-dependent and may be obtained @@ -128,8 +128,8 @@ public class MenuShortcut implements java.io.Serializable /** * Returns whether this MenuShortcut must be invoked using the SHIFT key. - * @return true if this MenuShortcut must be invoked using the - * SHIFT key, false otherwise. + * @return {@code true} if this MenuShortcut must be invoked using the + * SHIFT key, {@code false} otherwise. * @since 1.1 */ public boolean usesShiftModifier() { @@ -141,8 +141,8 @@ public class MenuShortcut implements java.io.Serializable * equality is defined to mean that both MenuShortcuts use the same key * and both either use or don't use the SHIFT key. * @param s the MenuShortcut to compare with this. - * @return true if this MenuShortcut is the same as another, - * false otherwise. + * @return {@code true} if this MenuShortcut is the same as another, + * {@code false} otherwise. * @since 1.1 */ public boolean equals(MenuShortcut s) { @@ -155,8 +155,8 @@ public class MenuShortcut implements java.io.Serializable * equality is defined to mean that both MenuShortcuts use the same key * and both either use or don't use the SHIFT key. * @param obj the Object to compare with this. - * @return true if this MenuShortcut is the same as another, - * false otherwise. + * @return {@code true} if this MenuShortcut is the same as another, + * {@code false} otherwise. * @since 1.2 */ public boolean equals(Object obj) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java b/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java index c06e5f12767..60849fc1f5d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java +++ b/jdk/src/java.desktop/share/classes/java/awt/MouseInfo.java @@ -29,7 +29,7 @@ import sun.awt.AWTPermissions; import sun.awt.ComponentFactory; /** - * MouseInfo provides methods for getting information about the mouse, + * {@code MouseInfo} provides methods for getting information about the mouse, * such as mouse pointer location and the number of mouse buttons. * * @author Roman Poborchiy @@ -45,26 +45,26 @@ public class MouseInfo { } /** - * Returns a PointerInfo instance that represents the current + * Returns a {@code PointerInfo} instance that represents the current * location of the mouse pointer. - * The GraphicsDevice stored in this PointerInfo + * The {@code GraphicsDevice} stored in this {@code PointerInfo} * contains the mouse pointer. The coordinate system used for the mouse position - * depends on whether or not the GraphicsDevice is part of a virtual + * depends on whether or not the {@code GraphicsDevice} is part of a virtual * screen device. * For virtual screen devices, the coordinates are given in the virtual * coordinate system, otherwise they are returned in the coordinate system - * of the GraphicsDevice. See {@link GraphicsConfiguration} + * of the {@code GraphicsDevice}. See {@link GraphicsConfiguration} * for more information about the virtual screen devices. - * On systems without a mouse, returns null. + * On systems without a mouse, returns {@code null}. *

      - * If there is a security manager, its checkPermission method - * is called with an AWTPermission("watchMousePointer") - * permission before creating and returning a PointerInfo - * object. This may result in a SecurityException. + * If there is a security manager, its {@code checkPermission} method + * is called with an {@code AWTPermission("watchMousePointer")} + * permission before creating and returning a {@code PointerInfo} + * object. This may result in a {@code SecurityException}. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() returns true * @exception SecurityException if a security manager exists and its - * checkPermission method doesn't allow the operation + * {@code checkPermission} method doesn't allow the operation * @see GraphicsConfiguration * @see SecurityManager#checkPermission * @see java.awt.AWTPermission @@ -118,7 +118,7 @@ public class MouseInfo { /** * Returns the number of buttons on the mouse. - * On systems without a mouse, returns -1. + * On systems without a mouse, returns {@code -1}. * The number of buttons is obtained from the AWT Toolkit * by requesting the {@code "awt.mouse.numButtons"} desktop property * which is set by the underlying native platform. diff --git a/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java b/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java index d06ea4c562a..6b718f79536 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java +++ b/jdk/src/java.desktop/share/classes/java/awt/PageAttributes.java @@ -942,7 +942,7 @@ public final class PageAttributes implements Cloneable { * @param printerResolution an integer array of 3 elements. The first * element must be greater than 0. The second element must be * must be greater than 0. The third element must be either - * 3 or 4. + * {@code 3} or {@code 4}. * @throws IllegalArgumentException if one or more of the above * conditions is violated. */ @@ -1095,14 +1095,14 @@ public final class PageAttributes implements Cloneable { /** * Specifies the print orientation for pages using these attributes. - * Specifying 3 denotes portrait. Specifying 4 + * Specifying {@code 3} denotes portrait. Specifying {@code 4} * denotes landscape. Specifying any other value will generate an * IllegalArgumentException. Not specifying the property is equivalent * to calling setOrientationRequested(OrientationRequestedType.PORTRAIT). * - * @param orientationRequested 3 or 4 + * @param orientationRequested {@code 3} or {@code 4} * @throws IllegalArgumentException if orientationRequested is not - * 3 or 4 + * {@code 3} or {@code 4} */ public void setOrientationRequested(int orientationRequested) { switch (orientationRequested) { @@ -1189,15 +1189,15 @@ public final class PageAttributes implements Cloneable { /** * Specifies the print quality for pages using these attributes. - * Specifying 3 denotes draft. Specifying 4 - * denotes normal. Specifying 5 denotes high. Specifying + * Specifying {@code 3} denotes draft. Specifying {@code 4} + * denotes normal. Specifying {@code 5} denotes high. Specifying * any other value will generate an IllegalArgumentException. Not * specifying the property is equivalent to calling * setPrintQuality(PrintQualityType.NORMAL). * - * @param printQuality 3, 4, or 5 - * @throws IllegalArgumentException if printQuality is not 3 - * , 4, or 5 + * @param printQuality {@code 3}, {@code 4}, or {@code 5} + * @throws IllegalArgumentException if printQuality is not + * {@code 3}, {@code 4}, or {@code 5} */ public void setPrintQuality(int printQuality) { switch (printQuality) { @@ -1231,13 +1231,13 @@ public final class PageAttributes implements Cloneable { * (typically the horizontal resolution). Index 1 of the array specifies * the feed direction resolution (typically the vertical resolution). * Index 2 of the array specifies whether the resolutions are in dots per - * inch or dots per centimeter. 3 denotes dots per inch. - * 4 denotes dots per centimeter. + * inch or dots per centimeter. {@code 3} denotes dots per inch. + * {@code 4} denotes dots per centimeter. * * @return an integer array of 3 elements. The first * element must be greater than 0. The second element must be * must be greater than 0. The third element must be either - * 3 or 4. + * {@code 3} or {@code 4}. */ public int[] getPrinterResolution() { // Return a copy because otherwise client code could circumvent the @@ -1258,7 +1258,7 @@ public final class PageAttributes implements Cloneable { * resolution). Index 1 of the array specifies the feed direction * resolution (typically the vertical resolution). Index 2 of the array * specifies whether the resolutions are in dots per inch or dots per - * centimeter. 3 denotes dots per inch. 4 + * centimeter. {@code 3} denotes dots per inch. {@code 4} * denotes dots per centimeter. Note that the 1.1 printing implementation * (Toolkit.getPrintJob) requires that the feed and cross feed resolutions * be the same. Not specifying the property is equivalent to calling @@ -1267,7 +1267,7 @@ public final class PageAttributes implements Cloneable { * @param printerResolution an integer array of 3 elements. The first * element must be greater than 0. The second element must be * must be greater than 0. The third element must be either - * 3 or 4. + * {@code 3} or {@code 4}. * @throws IllegalArgumentException if one or more of the above * conditions is violated. */ @@ -1295,7 +1295,7 @@ public final class PageAttributes implements Cloneable { * inch for pages using these attributes. The same value is used for both * resolutions. The actual resolutions will be determined by the * limitations of the implementation and the target printer. Not - * specifying the property is equivalent to specifying 72. + * specifying the property is equivalent to specifying {@code 72}. * * @param printerResolution an integer greater than 0. * @throws IllegalArgumentException if printerResolution is less than or diff --git a/jdk/src/java.desktop/share/classes/java/awt/Paint.java b/jdk/src/java.desktop/share/classes/java/awt/Paint.java index b2e0dabb13e..ba4d601769b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Paint.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Paint.java @@ -30,16 +30,16 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; /** - * This Paint interface defines how color patterns + * This {@code Paint} interface defines how color patterns * can be generated for {@link Graphics2D} operations. A class - * implementing the Paint interface is added to the - * Graphics2D context in order to define the color - * pattern used by the draw and fill methods. + * implementing the {@code Paint} interface is added to the + * {@code Graphics2D} context in order to define the color + * pattern used by the {@code draw} and {@code fill} methods. *

      - * Instances of classes implementing Paint must be - * read-only because the Graphics2D does not clone + * Instances of classes implementing {@code Paint} must be + * read-only because the {@code Graphics2D} does not clone * these objects when they are set as an attribute with the - * setPaint method or when the Graphics2D + * {@code setPaint} method or when the {@code Graphics2D} * object is itself cloned. * @see PaintContext * @see Color @@ -74,22 +74,22 @@ public interface Paint extends Transparency { * of the graphics primitive being rendered. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code deviceBounds}. + * for a {@code null deviceBounds}. * @param userBounds the user space bounding box * of the graphics primitive being rendered. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code userBounds}. + * for a {@code null userBounds}. * @param xform the {@link AffineTransform} from user * space into device space. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code xform}. + * for a {@code null xform}. * @param hints the set of hints that the context object can use to * choose between rendering alternatives. * Implementations of the {@code Paint} interface * are allowed to throw {@code NullPointerException} - * for a {@code null} {@code hints}. + * for a {@code null hints}. * @return the {@code PaintContext} for * generating color patterns. * @see PaintContext diff --git a/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java b/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java index 4efafff27d4..faca59d2c8b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/PaintContext.java @@ -29,13 +29,13 @@ import java.awt.image.Raster; import java.awt.image.ColorModel; /** - * The PaintContext interface defines the encapsulated + * The {@code PaintContext} interface defines the encapsulated * and optimized environment to generate color patterns in device * space for fill or stroke operations on a - * {@link Graphics2D}. The PaintContext provides - * the necessary colors for Graphics2D operations in the + * {@link Graphics2D}. The {@code PaintContext} provides + * the necessary colors for {@code Graphics2D} operations in the * form of a {@link Raster} associated with a {@link ColorModel}. - * The PaintContext maintains state for a particular paint + * The {@code PaintContext} maintains state for a particular paint * operation. In a multi-threaded environment, several * contexts can exist simultaneously for a single {@link Paint} object. * @see Paint @@ -48,20 +48,20 @@ public interface PaintContext { public void dispose(); /** - * Returns the ColorModel of the output. Note that - * this ColorModel might be different from the hint + * Returns the {@code ColorModel} of the output. Note that + * this {@code ColorModel} might be different from the hint * specified in the * {@link Paint#createContext(ColorModel, Rectangle, Rectangle2D, AffineTransform, RenderingHints) createContext} method of - * Paint. Not all PaintContext objects are + * {@code Paint}. Not all {@code PaintContext} objects are * capable of generating color patterns in an arbitrary - * ColorModel. - * @return the ColorModel of the output. + * {@code ColorModel}. + * @return the {@code ColorModel} of the output. */ ColorModel getColorModel(); /** - * Returns a Raster containing the colors generated for + * Returns a {@code Raster} containing the colors generated for * the graphics operation. * @param x the x coordinate of the area in device space * for which colors are generated. @@ -69,7 +69,7 @@ AffineTransform, RenderingHints) createContext} method of * for which colors are generated. * @param w the width of the area in device space * @param h the height of the area in device space - * @return a Raster representing the specified + * @return a {@code Raster} representing the specified * rectangular area and containing the colors generated for * the graphics operation. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Panel.java b/jdk/src/java.desktop/share/classes/java/awt/Panel.java index db8d2c412ad..345db85f793 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Panel.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Panel.java @@ -27,12 +27,12 @@ package java.awt; import javax.accessibility.*; /** - * Panel is the simplest container class. A panel + * {@code Panel} is the simplest container class. A panel * provides space in which an application can attach any other * component, including other panels. *

      * The default layout manager for a panel is the - * FlowLayout layout manager. + * {@code FlowLayout} layout manager. * * @author Sami Shaio * @see java.awt.FlowLayout @@ -50,7 +50,7 @@ public class Panel extends Container implements Accessible { /** * Creates a new panel using the default layout manager. * The default layout manager for all panels is the - * FlowLayout class. + * {@code FlowLayout} class. */ public Panel() { this(new FlowLayout()); @@ -111,7 +111,7 @@ public class Panel extends Container implements Accessible { /** * This class implements accessibility support for the - * Panel class. It provides an implementation of the + * {@code Panel} class. It provides an implementation of the * Java Accessibility API appropriate to panel user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Point.java b/jdk/src/java.desktop/share/classes/java/awt/Point.java index 03337998cb5..e967d33a035 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Point.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Point.java @@ -37,7 +37,7 @@ import java.beans.Transient; */ public class Point extends Point2D implements java.io.Serializable { /** - * The X coordinate of this Point. + * The X coordinate of this {@code Point}. * If no X coordinate is set it will default to 0. * * @serial @@ -48,7 +48,7 @@ public class Point extends Point2D implements java.io.Serializable { public int x; /** - * The Y coordinate of this Point. + * The Y coordinate of this {@code Point}. * If no Y coordinate is set it will default to 0. * * @serial @@ -74,7 +74,7 @@ public class Point extends Point2D implements java.io.Serializable { /** * Constructs and initializes a point with the same location as - * the specified Point object. + * the specified {@code Point} object. * @param p a point * @since 1.1 */ @@ -85,8 +85,8 @@ public class Point extends Point2D implements java.io.Serializable { /** * Constructs and initializes a point at the specified * {@code (x,y)} location in the coordinate space. - * @param x the X coordinate of the newly constructed Point - * @param y the Y coordinate of the newly constructed Point + * @param x the X coordinate of the newly constructed {@code Point} + * @param y the Y coordinate of the newly constructed {@code Point} * @since 1.0 */ public Point(int x, int y) { @@ -113,7 +113,7 @@ public class Point extends Point2D implements java.io.Serializable { /** * Returns the location of this point. * This method is included for completeness, to parallel the - * getLocation method of Component. + * {@code getLocation} method of {@code Component}. * @return a copy of this point, at the same location * @see java.awt.Component#getLocation * @see java.awt.Point#setLocation(java.awt.Point) @@ -128,7 +128,7 @@ public class Point extends Point2D implements java.io.Serializable { /** * Sets the location of the point to the specified location. * This method is included for completeness, to parallel the - * setLocation method of Component. + * {@code setLocation} method of {@code Component}. * @param p a point, the new location for this point * @see java.awt.Component#setLocation(java.awt.Point) * @see java.awt.Point#getLocation @@ -142,7 +142,7 @@ public class Point extends Point2D implements java.io.Serializable { * Changes the point to have the specified location. *

      * This method is included for completeness, to parallel the - * setLocation method of Component. + * {@code setLocation} method of {@code Component}. * Its behavior is identical with move(int, int). * @param x the X coordinate of the new location * @param y the Y coordinate of the new location @@ -158,10 +158,10 @@ public class Point extends Point2D implements java.io.Serializable { /** * Sets the location of this point to the specified double coordinates. * The double values will be rounded to integer values. - * Any number smaller than Integer.MIN_VALUE - * will be reset to MIN_VALUE, and any number - * larger than Integer.MAX_VALUE will be - * reset to MAX_VALUE. + * Any number smaller than {@code Integer.MIN_VALUE} + * will be reset to {@code MIN_VALUE}, and any number + * larger than {@code Integer.MAX_VALUE} will be + * reset to {@code MAX_VALUE}. * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location @@ -203,13 +203,13 @@ public class Point extends Point2D implements java.io.Serializable { /** * Determines whether or not two points are equal. Two instances of - * Point2D are equal if the values of their - * x and y member fields, representing + * {@code Point2D} are equal if the values of their + * {@code x} and {@code y} member fields, representing * their position in the coordinate space, are the same. - * @param obj an object to be compared with this Point2D - * @return true if the object to be compared is - * an instance of Point2D and has - * the same values; false otherwise. + * @param obj an object to be compared with this {@code Point2D} + * @return {@code true} if the object to be compared is + * an instance of {@code Point2D} and has + * the same values; {@code false} otherwise. */ public boolean equals(Object obj) { if (obj instanceof Point) { @@ -224,7 +224,7 @@ public class Point extends Point2D implements java.io.Serializable { * in the {@code (x,y)} coordinate space. This method is * intended to be used only for debugging purposes, and the content * and format of the returned string may vary between implementations. - * The returned string may be empty but may not be null. + * The returned string may be empty but may not be {@code null}. * * @return a string representation of this point */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Polygon.java b/jdk/src/java.desktop/share/classes/java/awt/Polygon.java index 7a30a958f45..90ae45ad352 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Polygon.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Polygon.java @@ -32,7 +32,7 @@ import sun.awt.geom.Crossings; import java.util.Arrays; /** - * The Polygon class encapsulates a description of a + * The {@code Polygon} class encapsulates a description of a * closed, two-dimensional region within a coordinate space. This * region is bounded by an arbitrary number of line segments, each of * which is one side of the polygon. Internally, a polygon @@ -41,12 +41,12 @@ import java.util.Arrays; * polygon, and two successive pairs are the endpoints of a * line that is a side of the polygon. The first and final * pairs of {@code (x,y)} points are joined by a line segment - * that closes the polygon. This Polygon is defined with + * that closes the polygon. This {@code Polygon} is defined with * an even-odd winding rule. See * {@link java.awt.geom.PathIterator#WIND_EVEN_ODD WIND_EVEN_ODD} * for a definition of the even-odd winding rule. * This class's hit-testing methods, which include the - * contains, intersects and inside + * {@code contains}, {@code intersects} and {@code inside} * methods, use the insideness definition described in the * {@link Shape} class comments. * @@ -58,8 +58,8 @@ import java.util.Arrays; public class Polygon implements Shape, java.io.Serializable { /** - * The total number of points. The value of npoints - * represents the number of valid points in this Polygon + * The total number of points. The value of {@code npoints} + * represents the number of valid points in this {@code Polygon} * and might be less than the number of elements in * {@link #xpoints xpoints} or {@link #ypoints ypoints}. * This value can be NULL. @@ -73,10 +73,10 @@ public class Polygon implements Shape, java.io.Serializable { /** * The array of X coordinates. The number of elements in * this array might be more than the number of X coordinates - * in this Polygon. The extra elements allow new points - * to be added to this Polygon without re-creating this + * in this {@code Polygon}. The extra elements allow new points + * to be added to this {@code Polygon} without re-creating this * array. The value of {@link #npoints npoints} is equal to the - * number of valid points in this Polygon. + * number of valid points in this {@code Polygon}. * * @serial * @see #addPoint(int, int) @@ -87,10 +87,10 @@ public class Polygon implements Shape, java.io.Serializable { /** * The array of Y coordinates. The number of elements in * this array might be more than the number of Y coordinates - * in this Polygon. The extra elements allow new points - * to be added to this Polygon without re-creating this - * array. The value of npoints is equal to the - * number of valid points in this Polygon. + * in this {@code Polygon}. The extra elements allow new points + * to be added to this {@code Polygon} without re-creating this + * array. The value of {@code npoints} is equal to the + * number of valid points in this {@code Polygon}. * * @serial * @see #addPoint(int, int) @@ -129,19 +129,19 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Constructs and initializes a Polygon from the specified + * Constructs and initializes a {@code Polygon} from the specified * parameters. * @param xpoints an array of X coordinates * @param ypoints an array of Y coordinates * @param npoints the total number of points in the - * Polygon + * {@code Polygon} * @exception NegativeArraySizeException if the value of - * npoints is negative. - * @exception IndexOutOfBoundsException if npoints is - * greater than the length of xpoints - * or the length of ypoints. - * @exception NullPointerException if xpoints or - * ypoints is null. + * {@code npoints} is negative. + * @exception IndexOutOfBoundsException if {@code npoints} is + * greater than the length of {@code xpoints} + * or the length of {@code ypoints}. + * @exception NullPointerException if {@code xpoints} or + * {@code ypoints} is {@code null}. * @since 1.0 */ public Polygon(int xpoints[], int ypoints[], int npoints) { @@ -164,7 +164,7 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Resets this Polygon object to an empty polygon. + * Resets this {@code Polygon} object to an empty polygon. * The coordinate arrays and the data in them are left untouched * but the number of points is reset to zero to mark the old * vertex data as invalid and to start accumulating new vertex @@ -172,7 +172,7 @@ public class Polygon implements Shape, java.io.Serializable { * All internally-cached data relating to the old vertices * are discarded. * Note that since the coordinate arrays from before the reset - * are reused, creating a new empty Polygon might + * are reused, creating a new empty {@code Polygon} might * be more memory efficient than resetting the current one if * the number of vertices in the new polygon data is significantly * smaller than the number of vertices in the data from before the @@ -187,11 +187,11 @@ public class Polygon implements Shape, java.io.Serializable { /** * Invalidates or flushes any internally-cached data that depends - * on the vertex coordinates of this Polygon. + * on the vertex coordinates of this {@code Polygon}. * This method should be called after any direct manipulation - * of the coordinates in the xpoints or - * ypoints arrays to avoid inconsistent results - * from methods such as getBounds or contains + * of the coordinates in the {@code xpoints} or + * {@code ypoints} arrays to avoid inconsistent results + * from methods such as {@code getBounds} or {@code contains} * that might cache data from earlier computations relating to * the vertex coordinates. * @see java.awt.Polygon#getBounds @@ -202,9 +202,9 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Translates the vertices of the Polygon by - * deltaX along the x axis and by - * deltaY along the y axis. + * Translates the vertices of the {@code Polygon} by + * {@code deltaX} along the x axis and by + * {@code deltaY} along the y axis. * @param deltaX the amount to translate along the X axis * @param deltaY the amount to translate along the Y axis * @since 1.1 @@ -221,7 +221,7 @@ public class Polygon implements Shape, java.io.Serializable { /* * Calculates the bounding box of the points passed to the constructor. - * Sets bounds to the result. + * Sets {@code bounds} to the result. * @param xpoints[] array of x coordinates * @param ypoints[] array of y coordinates * @param npoints the total number of points @@ -270,11 +270,11 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Appends the specified coordinates to this Polygon. + * Appends the specified coordinates to this {@code Polygon}. *

      * If an operation that calculates the bounding box of this - * Polygon has already been performed, such as - * getBounds or contains, then this + * {@code Polygon} has already been performed, such as + * {@code getBounds} or {@code contains}, then this * method updates the bounding box. * @param x the specified X coordinate * @param y the specified Y coordinate @@ -305,12 +305,12 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Gets the bounding box of this Polygon. + * Gets the bounding box of this {@code Polygon}. * The bounding box is the smallest {@link Rectangle} whose * sides are parallel to the x and y axes of the - * coordinate space, and can completely contain the Polygon. - * @return a Rectangle that defines the bounds of this - * Polygon. + * coordinate space, and can completely contain the {@code Polygon}. + * @return a {@code Rectangle} that defines the bounds of this + * {@code Polygon}. * @since 1.1 */ public Rectangle getBounds() { @@ -318,10 +318,10 @@ public class Polygon implements Shape, java.io.Serializable { } /** - * Returns the bounds of this Polygon. - * @return the bounds of this Polygon. + * Returns the bounds of this {@code Polygon}. + * @return the bounds of this {@code Polygon}. * @deprecated As of JDK version 1.1, - * replaced by getBounds(). + * replaced by {@code getBounds()}. * @since 1.0 */ @Deprecated @@ -337,10 +337,10 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified {@link Point} is inside this - * Polygon. - * @param p the specified Point to be tested - * @return true if the Polygon contains the - * Point; false otherwise. + * {@code Polygon}. + * @param p the specified {@code Point} to be tested + * @return {@code true} if the {@code Polygon} contains the + * {@code Point}; {@code false} otherwise. * @see #contains(double, double) * @since 1.0 */ @@ -350,7 +350,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are inside this - * Polygon. + * {@code Polygon}. * * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested @@ -366,7 +366,7 @@ public class Polygon implements Shape, java.io.Serializable { /** * Determines whether the specified coordinates are contained in this - * Polygon. + * {@code Polygon}. * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested * @return {@code true} if this {@code Polygon} contains @@ -374,7 +374,7 @@ public class Polygon implements Shape, java.io.Serializable { * {@code false} otherwise. * @see #contains(double, double) * @deprecated As of JDK version 1.1, - * replaced by contains(int, int). + * replaced by {@code contains(int, int)}. * @since 1.0 */ @Deprecated @@ -531,15 +531,15 @@ public class Polygon implements Shape, java.io.Serializable { /** * Returns an iterator object that iterates along the boundary of this - * Polygon and provides access to the geometry - * of the outline of this Polygon. An optional + * {@code Polygon} and provides access to the geometry + * of the outline of this {@code Polygon}. An optional * {@link AffineTransform} can be specified so that the coordinates * returned in the iteration are transformed accordingly. - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired * @return a {@link PathIterator} object that provides access to the - * geometry of this Polygon. + * geometry of this {@code Polygon}. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at) { @@ -548,23 +548,23 @@ public class Polygon implements Shape, java.io.Serializable { /** * Returns an iterator object that iterates along the boundary of - * the Shape and provides access to the geometry of the - * outline of the Shape. Only SEG_MOVETO, SEG_LINETO, and + * the {@code Shape} and provides access to the geometry of the + * outline of the {@code Shape}. Only SEG_MOVETO, SEG_LINETO, and * SEG_CLOSE point types are returned by the iterator. - * Since polygons are already flat, the flatness parameter - * is ignored. An optional AffineTransform can be specified + * Since polygons are already flat, the {@code flatness} parameter + * is ignored. An optional {@code AffineTransform} can be specified * in which case the coordinates returned in the iteration are transformed * accordingly. - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired * @param flatness the maximum amount that the control points * for a given curve can vary from collinear before a subdivided * curve is replaced by a straight line connecting the * endpoints. Since polygons are already flat the - * flatness parameter is ignored. - * @return a PathIterator object that provides access to the - * Shape object's geometry. + * {@code flatness} parameter is ignored. + * @return a {@code PathIterator} object that provides access to the + * {@code Shape} object's geometry. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at, double flatness) { @@ -597,8 +597,8 @@ public class Polygon implements Shape, java.io.Serializable { /** * Tests if there are more points to read. - * @return true if there are more points to read; - * false otherwise. + * @return {@code true} if there are more points to read; + * {@code false} otherwise. */ public boolean isDone() { return index > poly.npoints; @@ -618,12 +618,12 @@ public class Polygon implements Shape, java.io.Serializable { * the iteration. * The return value is the path segment type: * SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. - * A float array of length 2 must be passed in and + * A {@code float} array of length 2 must be passed in and * can be used to store the coordinates of the point(s). - * Each point is stored as a pair of float x, y + * Each point is stored as a pair of {@code float} x, y * coordinates. SEG_MOVETO and SEG_LINETO types return one * point, and SEG_CLOSE does not return any points. - * @param coords a float array that specifies the + * @param coords a {@code float} array that specifies the * coordinates of the point(s) * @return an integer representing the type and coordinates of the * current path segment. @@ -648,13 +648,13 @@ public class Polygon implements Shape, java.io.Serializable { * the iteration. * The return value is the path segment type: * SEG_MOVETO, SEG_LINETO, or SEG_CLOSE. - * A double array of length 2 must be passed in and + * A {@code double} array of length 2 must be passed in and * can be used to store the coordinates of the point(s). - * Each point is stored as a pair of double x, y + * Each point is stored as a pair of {@code double} x, y * coordinates. * SEG_MOVETO and SEG_LINETO types return one point, * and SEG_CLOSE does not return any points. - * @param coords a double array that specifies the + * @param coords a {@code double} array that specifies the * coordinates of the point(s) * @return an integer representing the type and coordinates of the * current path segment. diff --git a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java index 7e4ffc8cb91..253351f164a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java +++ b/jdk/src/java.desktop/share/classes/java/awt/PopupMenu.java @@ -35,11 +35,11 @@ import sun.awt.AWTAccessor; * A class that implements a menu which can be dynamically popped up * at a specified position within a component. *

      - * As the inheritance hierarchy implies, a PopupMenu - * can be used anywhere a Menu can be used. - * However, if you use a PopupMenu like a Menu - * (e.g., you add it to a MenuBar), then you cannot - * call show on that PopupMenu. + * As the inheritance hierarchy implies, a {@code PopupMenu} + * can be used anywhere a {@code Menu} can be used. + * However, if you use a {@code PopupMenu} like a {@code Menu} + * (e.g., you add it to a {@code MenuBar}), then you cannot + * call {@code show} on that {@code PopupMenu}. * * @author Amy Fowler */ @@ -77,7 +77,7 @@ public class PopupMenu extends Menu { /** * Creates a new popup menu with the specified name. * - * @param label a non-null string specifying + * @param label a non-{@code null} string specifying * the popup menu's label * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. @@ -98,8 +98,8 @@ public class PopupMenu extends Menu { } /** - * Constructs a name for this MenuComponent. - * Called by getName when the name is null. + * Constructs a name for this {@code MenuComponent}. + * Called by {@code getName} when the name is {@code null}. */ String constructComponentName() { synchronized (PopupMenu.class) { @@ -139,16 +139,16 @@ public class PopupMenu extends Menu { * hierarchy of the popup menu's parent. Both the origin and the parent * must be showing on the screen for this method to be valid. *

      - * If this PopupMenu is being used as a Menu - * (i.e., it has a non-Component parent), - * then you cannot call this method on the PopupMenu. + * If this {@code PopupMenu} is being used as a {@code Menu} + * (i.e., it has a non-{@code Component} parent), + * then you cannot call this method on the {@code PopupMenu}. * * @param origin the component which defines the coordinate space * @param x the x coordinate position to popup the menu * @param y the y coordinate position to popup the menu - * @exception NullPointerException if the parent is null - * @exception IllegalArgumentException if this PopupMenu - * has a non-Component parent + * @exception NullPointerException if the parent is {@code null} + * @exception IllegalArgumentException if this {@code PopupMenu} + * has a non-{@code Component} parent * @exception IllegalArgumentException if the origin is not in the * parent's hierarchy * @exception RuntimeException if the parent is not showing on screen @@ -196,11 +196,11 @@ public class PopupMenu extends Menu { //////////////// /** - * Gets the AccessibleContext associated with this - * PopupMenu. + * Gets the {@code AccessibleContext} associated with this + * {@code PopupMenu}. * - * @return the AccessibleContext of this - * PopupMenu + * @return the {@code AccessibleContext} of this + * {@code PopupMenu} * @since 1.3 */ public AccessibleContext getAccessibleContext() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java b/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java index 04bfc026499..fcc5cf3c729 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Rectangle.java @@ -29,14 +29,14 @@ import java.awt.geom.Rectangle2D; import java.beans.Transient; /** - * A Rectangle specifies an area in a coordinate space that is - * enclosed by the Rectangle object's upper-left point + * A {@code Rectangle} specifies an area in a coordinate space that is + * enclosed by the {@code Rectangle} object's upper-left point * {@code (x,y)} * in the coordinate space, its width, and its height. *

      - * A Rectangle object's width and - * height are public fields. The constructors - * that create a Rectangle, and the methods that can modify + * A {@code Rectangle} object's {@code width} and + * {@code height} are {@code public} fields. The constructors + * that create a {@code Rectangle}, and the methods that can modify * one, do not prevent setting a negative value for width or height. *

      * @@ -120,7 +120,7 @@ public class Rectangle extends Rectangle2D { /** - * The X coordinate of the upper-left corner of the Rectangle. + * The X coordinate of the upper-left corner of the {@code Rectangle}. * * @serial * @see #setLocation(int, int) @@ -130,7 +130,7 @@ public class Rectangle extends Rectangle2D public int x; /** - * The Y coordinate of the upper-left corner of the Rectangle. + * The Y coordinate of the upper-left corner of the {@code Rectangle}. * * @serial * @see #setLocation(int, int) @@ -140,7 +140,7 @@ public class Rectangle extends Rectangle2D public int y; /** - * The width of the Rectangle. + * The width of the {@code Rectangle}. * @serial * @see #setSize(int, int) * @see #getSize() @@ -149,7 +149,7 @@ public class Rectangle extends Rectangle2D public int width; /** - * The height of the Rectangle. + * The height of the {@code Rectangle}. * * @serial * @see #setSize(int, int) @@ -177,7 +177,7 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle whose upper-left corner + * Constructs a new {@code Rectangle} whose upper-left corner * is at (0, 0) in the coordinate space, and whose width and * height are both zero. */ @@ -186,10 +186,10 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle, initialized to match - * the values of the specified Rectangle. - * @param r the Rectangle from which to copy initial values - * to a newly constructed Rectangle + * Constructs a new {@code Rectangle}, initialized to match + * the values of the specified {@code Rectangle}. + * @param r the {@code Rectangle} from which to copy initial values + * to a newly constructed {@code Rectangle} * @since 1.1 */ public Rectangle(Rectangle r) { @@ -197,14 +197,14 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle whose upper-left corner is + * Constructs a new {@code Rectangle} whose upper-left corner is * specified as * {@code (x,y)} and whose width and height * are specified by the arguments of the same name. * @param x the specified X coordinate * @param y the specified Y coordinate - * @param width the width of the Rectangle - * @param height the height of the Rectangle + * @param width the width of the {@code Rectangle} + * @param height the height of the {@code Rectangle} * @since 1.0 */ public Rectangle(int x, int y, int width, int height) { @@ -215,94 +215,94 @@ public class Rectangle extends Rectangle2D } /** - * Constructs a new Rectangle whose upper-left corner + * Constructs a new {@code Rectangle} whose upper-left corner * is at (0, 0) in the coordinate space, and whose width and * height are specified by the arguments of the same name. - * @param width the width of the Rectangle - * @param height the height of the Rectangle + * @param width the width of the {@code Rectangle} + * @param height the height of the {@code Rectangle} */ public Rectangle(int width, int height) { this(0, 0, width, height); } /** - * Constructs a new Rectangle whose upper-left corner is + * Constructs a new {@code Rectangle} whose upper-left corner is * specified by the {@link Point} argument, and * whose width and height are specified by the * {@link Dimension} argument. - * @param p a Point that is the upper-left corner of - * the Rectangle - * @param d a Dimension, representing the - * width and height of the Rectangle + * @param p a {@code Point} that is the upper-left corner of + * the {@code Rectangle} + * @param d a {@code Dimension}, representing the + * width and height of the {@code Rectangle} */ public Rectangle(Point p, Dimension d) { this(p.x, p.y, d.width, d.height); } /** - * Constructs a new Rectangle whose upper-left corner is the - * specified Point, and whose width and height are both zero. - * @param p a Point that is the top left corner - * of the Rectangle + * Constructs a new {@code Rectangle} whose upper-left corner is the + * specified {@code Point}, and whose width and height are both zero. + * @param p a {@code Point} that is the top left corner + * of the {@code Rectangle} */ public Rectangle(Point p) { this(p.x, p.y, 0, 0); } /** - * Constructs a new Rectangle whose top left corner is + * Constructs a new {@code Rectangle} whose top left corner is * (0, 0) and whose width and height are specified - * by the Dimension argument. - * @param d a Dimension, specifying width and height + * by the {@code Dimension} argument. + * @param d a {@code Dimension}, specifying width and height */ public Rectangle(Dimension d) { this(0, 0, d.width, d.height); } /** - * Returns the X coordinate of the bounding Rectangle in - * double precision. - * @return the X coordinate of the bounding Rectangle. + * Returns the X coordinate of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the X coordinate of the bounding {@code Rectangle}. */ public double getX() { return x; } /** - * Returns the Y coordinate of the bounding Rectangle in - * double precision. - * @return the Y coordinate of the bounding Rectangle. + * Returns the Y coordinate of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the Y coordinate of the bounding {@code Rectangle}. */ public double getY() { return y; } /** - * Returns the width of the bounding Rectangle in - * double precision. - * @return the width of the bounding Rectangle. + * Returns the width of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the width of the bounding {@code Rectangle}. */ public double getWidth() { return width; } /** - * Returns the height of the bounding Rectangle in - * double precision. - * @return the height of the bounding Rectangle. + * Returns the height of the bounding {@code Rectangle} in + * {@code double} precision. + * @return the height of the bounding {@code Rectangle}. */ public double getHeight() { return height; } /** - * Gets the bounding Rectangle of this Rectangle. + * Gets the bounding {@code Rectangle} of this {@code Rectangle}. *

      * This method is included for completeness, to parallel the - * getBounds method of + * {@code getBounds} method of * {@link Component}. - * @return a new Rectangle, equal to the - * bounding Rectangle for this Rectangle. + * @return a new {@code Rectangle}, equal to the + * bounding {@code Rectangle} for this {@code Rectangle}. * @see java.awt.Component#getBounds * @see #setBounds(Rectangle) * @see #setBounds(int, int, int, int) @@ -322,12 +322,12 @@ public class Rectangle extends Rectangle2D } /** - * Sets the bounding Rectangle of this Rectangle - * to match the specified Rectangle. + * Sets the bounding {@code Rectangle} of this {@code Rectangle} + * to match the specified {@code Rectangle}. *

      * This method is included for completeness, to parallel the - * setBounds method of Component. - * @param r the specified Rectangle + * {@code setBounds} method of {@code Component}. + * @param r the specified {@code Rectangle} * @see #getBounds * @see java.awt.Component#setBounds(java.awt.Rectangle) * @since 1.1 @@ -337,19 +337,19 @@ public class Rectangle extends Rectangle2D } /** - * Sets the bounding Rectangle of this - * Rectangle to the specified - * x, y, width, - * and height. + * Sets the bounding {@code Rectangle} of this + * {@code Rectangle} to the specified + * {@code x}, {@code y}, {@code width}, + * and {@code height}. *

      * This method is included for completeness, to parallel the - * setBounds method of Component. + * {@code setBounds} method of {@code Component}. * @param x the new X coordinate for the upper-left - * corner of this Rectangle + * corner of this {@code Rectangle} * @param y the new Y coordinate for the upper-left - * corner of this Rectangle - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * corner of this {@code Rectangle} + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @see #getBounds * @see java.awt.Component#setBounds(int, int, int, int) * @since 1.1 @@ -417,19 +417,19 @@ public class Rectangle extends Rectangle2D } /** - * Sets the bounding Rectangle of this - * Rectangle to the specified - * x, y, width, - * and height. + * Sets the bounding {@code Rectangle} of this + * {@code Rectangle} to the specified + * {@code x}, {@code y}, {@code width}, + * and {@code height}. * * @param x the new X coordinate for the upper-left - * corner of this Rectangle + * corner of this {@code Rectangle} * @param y the new Y coordinate for the upper-left - * corner of this Rectangle - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * corner of this {@code Rectangle} + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @deprecated As of JDK version 1.1, - * replaced by setBounds(int, int, int, int). + * replaced by {@code setBounds(int, int, int, int)}. */ @Deprecated public void reshape(int x, int y, int width, int height) { @@ -440,12 +440,12 @@ public class Rectangle extends Rectangle2D } /** - * Returns the location of this Rectangle. + * Returns the location of this {@code Rectangle}. *

      * This method is included for completeness, to parallel the - * getLocation method of Component. - * @return the Point that is the upper-left corner of - * this Rectangle. + * {@code getLocation} method of {@code Component}. + * @return the {@code Point} that is the upper-left corner of + * this {@code Rectangle}. * @see java.awt.Component#getLocation * @see #setLocation(Point) * @see #setLocation(int, int) @@ -456,12 +456,12 @@ public class Rectangle extends Rectangle2D } /** - * Moves this Rectangle to the specified location. + * Moves this {@code Rectangle} to the specified location. *

      * This method is included for completeness, to parallel the - * setLocation method of Component. - * @param p the Point specifying the new location - * for this Rectangle + * {@code setLocation} method of {@code Component}. + * @param p the {@code Point} specifying the new location + * for this {@code Rectangle} * @see java.awt.Component#setLocation(java.awt.Point) * @see #getLocation * @since 1.1 @@ -471,10 +471,10 @@ public class Rectangle extends Rectangle2D } /** - * Moves this Rectangle to the specified location. + * Moves this {@code Rectangle} to the specified location. *

      * This method is included for completeness, to parallel the - * setLocation method of Component. + * {@code setLocation} method of {@code Component}. * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @see #getLocation @@ -486,12 +486,12 @@ public class Rectangle extends Rectangle2D } /** - * Moves this Rectangle to the specified location. + * Moves this {@code Rectangle} to the specified location. * * @param x the X coordinate of the new location * @param y the Y coordinate of the new location * @deprecated As of JDK version 1.1, - * replaced by setLocation(int, int). + * replaced by {@code setLocation(int, int)}. */ @Deprecated public void move(int x, int y) { @@ -500,12 +500,12 @@ public class Rectangle extends Rectangle2D } /** - * Translates this Rectangle the indicated distance, + * Translates this {@code Rectangle} the indicated distance, * to the right along the X coordinate axis, and * downward along the Y coordinate axis. - * @param dx the distance to move this Rectangle + * @param dx the distance to move this {@code Rectangle} * along the X axis - * @param dy the distance to move this Rectangle + * @param dy the distance to move this {@code Rectangle} * along the Y axis * @see java.awt.Rectangle#setLocation(int, int) * @see java.awt.Rectangle#setLocation(java.awt.Point) @@ -578,13 +578,13 @@ public class Rectangle extends Rectangle2D } /** - * Gets the size of this Rectangle, represented by - * the returned Dimension. + * Gets the size of this {@code Rectangle}, represented by + * the returned {@code Dimension}. *

      * This method is included for completeness, to parallel the - * getSize method of Component. - * @return a Dimension, representing the size of - * this Rectangle. + * {@code getSize} method of {@code Component}. + * @return a {@code Dimension}, representing the size of + * this {@code Rectangle}. * @see java.awt.Component#getSize * @see #setSize(Dimension) * @see #setSize(int, int) @@ -595,12 +595,12 @@ public class Rectangle extends Rectangle2D } /** - * Sets the size of this Rectangle to match the - * specified Dimension. + * Sets the size of this {@code Rectangle} to match the + * specified {@code Dimension}. *

      * This method is included for completeness, to parallel the - * setSize method of Component. - * @param d the new size for the Dimension object + * {@code setSize} method of {@code Component}. + * @param d the new size for the {@code Dimension} object * @see java.awt.Component#setSize(java.awt.Dimension) * @see #getSize * @since 1.1 @@ -610,13 +610,13 @@ public class Rectangle extends Rectangle2D } /** - * Sets the size of this Rectangle to the specified + * Sets the size of this {@code Rectangle} to the specified * width and height. *

      * This method is included for completeness, to parallel the - * setSize method of Component. - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * {@code setSize} method of {@code Component}. + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @see java.awt.Component#setSize(int, int) * @see #getSize * @since 1.1 @@ -626,13 +626,13 @@ public class Rectangle extends Rectangle2D } /** - * Sets the size of this Rectangle to the specified + * Sets the size of this {@code Rectangle} to the specified * width and height. * - * @param width the new width for this Rectangle - * @param height the new height for this Rectangle + * @param width the new width for this {@code Rectangle} + * @param height the new height for this {@code Rectangle} * @deprecated As of JDK version 1.1, - * replaced by setSize(int, int). + * replaced by {@code setSize(int, int)}. */ @Deprecated public void resize(int width, int height) { @@ -641,12 +641,12 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle contains the - * specified Point. - * @param p the Point to test - * @return true if the specified Point - * is inside this Rectangle; - * false otherwise. + * Checks whether or not this {@code Rectangle} contains the + * specified {@code Point}. + * @param p the {@code Point} to test + * @return {@code true} if the specified {@code Point} + * is inside this {@code Rectangle}; + * {@code false} otherwise. * @since 1.1 */ public boolean contains(Point p) { @@ -654,15 +654,15 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle contains the + * Checks whether or not this {@code Rectangle} contains the * point at the specified location {@code (x,y)}. * * @param x the specified X coordinate * @param y the specified Y coordinate - * @return true if the point + * @return {@code true} if the point * {@code (x,y)} is inside this - * Rectangle; - * false otherwise. + * {@code Rectangle}; + * {@code false} otherwise. * @since 1.1 */ public boolean contains(int x, int y) { @@ -670,13 +670,13 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle entirely contains - * the specified Rectangle. + * Checks whether or not this {@code Rectangle} entirely contains + * the specified {@code Rectangle}. * - * @param r the specified Rectangle - * @return true if the Rectangle - * is contained entirely inside this Rectangle; - * false otherwise + * @param r the specified {@code Rectangle} + * @return {@code true} if the {@code Rectangle} + * is contained entirely inside this {@code Rectangle}; + * {@code false} otherwise * @since 1.2 */ public boolean contains(Rectangle r) { @@ -684,18 +684,18 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether this Rectangle entirely contains - * the Rectangle + * Checks whether this {@code Rectangle} entirely contains + * the {@code Rectangle} * at the specified location {@code (X,Y)} with the * specified dimensions {@code (W,H)}. * @param X the specified X coordinate * @param Y the specified Y coordinate - * @param W the width of the Rectangle - * @param H the height of the Rectangle - * @return true if the Rectangle specified by + * @param W the width of the {@code Rectangle} + * @param H the height of the {@code Rectangle} + * @return {@code true} if the {@code Rectangle} specified by * {@code (X, Y, W, H)} - * is entirely enclosed inside this Rectangle; - * false otherwise. + * is entirely enclosed inside this {@code Rectangle}; + * {@code false} otherwise. * @since 1.1 */ public boolean contains(int X, int Y, int W, int H) { @@ -736,17 +736,17 @@ public class Rectangle extends Rectangle2D } /** - * Checks whether or not this Rectangle contains the + * Checks whether or not this {@code Rectangle} contains the * point at the specified location {@code (X,Y)}. * * @param X the specified X coordinate * @param Y the specified Y coordinate - * @return true if the point + * @return {@code true} if the point * {@code (X,Y)} is inside this - * Rectangle; - * false otherwise. + * {@code Rectangle}; + * {@code false} otherwise. * @deprecated As of JDK version 1.1, - * replaced by contains(int, int). + * replaced by {@code contains(int, int)}. */ @Deprecated public boolean inside(int X, int Y) { @@ -770,14 +770,14 @@ public class Rectangle extends Rectangle2D } /** - * Determines whether or not this Rectangle and the specified - * Rectangle intersect. Two rectangles intersect if + * Determines whether or not this {@code Rectangle} and the specified + * {@code Rectangle} intersect. Two rectangles intersect if * their intersection is nonempty. * - * @param r the specified Rectangle - * @return true if the specified Rectangle - * and this Rectangle intersect; - * false otherwise. + * @param r the specified {@code Rectangle} + * @return {@code true} if the specified {@code Rectangle} + * and this {@code Rectangle} intersect; + * {@code false} otherwise. */ public boolean intersects(Rectangle r) { int tw = this.width; @@ -803,16 +803,16 @@ public class Rectangle extends Rectangle2D } /** - * Computes the intersection of this Rectangle with the - * specified Rectangle. Returns a new Rectangle + * Computes the intersection of this {@code Rectangle} with the + * specified {@code Rectangle}. Returns a new {@code Rectangle} * that represents the intersection of the two rectangles. * If the two rectangles do not intersect, the result will be * an empty rectangle. * - * @param r the specified Rectangle - * @return the largest Rectangle contained in both the - * specified Rectangle and in - * this Rectangle; or if the rectangles + * @param r the specified {@code Rectangle} + * @return the largest {@code Rectangle} contained in both the + * specified {@code Rectangle} and in + * this {@code Rectangle}; or if the rectangles * do not intersect, an empty rectangle. */ public Rectangle intersection(Rectangle r) { @@ -839,9 +839,9 @@ public class Rectangle extends Rectangle2D } /** - * Computes the union of this Rectangle with the - * specified Rectangle. Returns a new - * Rectangle that + * Computes the union of this {@code Rectangle} with the + * specified {@code Rectangle}. Returns a new + * {@code Rectangle} that * represents the union of the two rectangles. *

      * If either {@code Rectangle} has any dimension less than zero @@ -856,10 +856,10 @@ public class Rectangle extends Rectangle2D * too large to be expressed as an {@code int}, the result * will have a dimension of {@code Integer.MAX_VALUE} along * that dimension. - * @param r the specified Rectangle - * @return the smallest Rectangle containing both - * the specified Rectangle and this - * Rectangle. + * @param r the specified {@code Rectangle} + * @return the smallest {@code Rectangle} containing both + * the specified {@code Rectangle} and this + * {@code Rectangle}. */ public Rectangle union(Rectangle r) { long tx2 = this.width; @@ -911,14 +911,14 @@ public class Rectangle extends Rectangle2D * have a location equal to the specified coordinates and * width and height equal to zero. *

      - * After adding a point, a call to contains with the + * After adding a point, a call to {@code contains} with the * added point as an argument does not necessarily return - * true. The contains method does not - * return true for points on the right or bottom - * edges of a Rectangle. Therefore, if the added point + * {@code true}. The {@code contains} method does not + * return {@code true} for points on the right or bottom + * edges of a {@code Rectangle}. Therefore, if the added point * falls on the right or bottom edge of the enlarged - * Rectangle, contains returns - * false for that point. + * {@code Rectangle}, {@code contains} returns + * {@code false} for that point. * If the specified point must be contained within the new * {@code Rectangle}, a 1x1 rectangle should be added instead: *

      @@ -962,29 +962,29 @@ public class Rectangle extends Rectangle2D
            * have a location equal to the coordinates of the specified
            * {@code Point} and width and height equal to zero.
            * 

      - * After adding a Point, a call to contains - * with the added Point as an argument does not - * necessarily return true. The contains - * method does not return true for points on the right - * or bottom edges of a Rectangle. Therefore if the added - * Point falls on the right or bottom edge of the - * enlarged Rectangle, contains returns - * false for that Point. + * After adding a {@code Point}, a call to {@code contains} + * with the added {@code Point} as an argument does not + * necessarily return {@code true}. The {@code contains} + * method does not return {@code true} for points on the right + * or bottom edges of a {@code Rectangle}. Therefore if the added + * {@code Point} falls on the right or bottom edge of the + * enlarged {@code Rectangle}, {@code contains} returns + * {@code false} for that {@code Point}. * If the specified point must be contained within the new * {@code Rectangle}, a 1x1 rectangle should be added instead: *

            *     r.add(pt.x, pt.y, 1, 1);
            * 
      - * @param pt the new Point to add to this - * Rectangle + * @param pt the new {@code Point} to add to this + * {@code Rectangle} */ public void add(Point pt) { add(pt.x, pt.y); } /** - * Adds a Rectangle to this Rectangle. - * The resulting Rectangle is the union of the two + * Adds a {@code Rectangle} to this {@code Rectangle}. + * The resulting {@code Rectangle} is the union of the two * rectangles. *

      * If either {@code Rectangle} has any dimension less than 0, the @@ -1003,7 +1003,7 @@ public class Rectangle extends Rectangle2D * too large to be expressed as an {@code int}, the result * will have a dimension of {@code Integer.MAX_VALUE} along * that dimension. - * @param r the specified Rectangle + * @param r the specified {@code Rectangle} */ public void add(Rectangle r) { long tx2 = this.width; @@ -1039,19 +1039,19 @@ public class Rectangle extends Rectangle2D } /** - * Resizes the Rectangle both horizontally and vertically. + * Resizes the {@code Rectangle} both horizontally and vertically. *

      - * This method modifies the Rectangle so that it is - * h units larger on both the left and right side, - * and v units larger at both the top and bottom. + * This method modifies the {@code Rectangle} so that it is + * {@code h} units larger on both the left and right side, + * and {@code v} units larger at both the top and bottom. *

      - * The new Rectangle has {@code (x - h, y - v)} + * The new {@code Rectangle} has {@code (x - h, y - v)} * as its upper-left corner, * width of {@code (width + 2h)}, * and a height of {@code (height + 2v)}. *

      - * If negative values are supplied for h and - * v, the size of the Rectangle + * If negative values are supplied for {@code h} and + * {@code v}, the size of the {@code Rectangle} * decreases accordingly. * The {@code grow} method will check for integer overflow * and underflow, but does not check whether the resulting @@ -1183,14 +1183,14 @@ public class Rectangle extends Rectangle2D /** * Checks whether two rectangles are equal. *

      - * The result is true if and only if the argument is not - * null and is a Rectangle object that has the + * The result is {@code true} if and only if the argument is not + * {@code null} and is a {@code Rectangle} object that has the * same upper-left corner, width, and height as - * this Rectangle. - * @param obj the Object to compare with - * this Rectangle - * @return true if the objects are equal; - * false otherwise. + * this {@code Rectangle}. + * @param obj the {@code Object} to compare with + * this {@code Rectangle} + * @return {@code true} if the objects are equal; + * {@code false} otherwise. */ public boolean equals(Object obj) { if (obj instanceof Rectangle) { @@ -1204,10 +1204,10 @@ public class Rectangle extends Rectangle2D } /** - * Returns a String representing this - * Rectangle and its values. - * @return a String representing this - * Rectangle object's coordinate and size values. + * Returns a {@code String} representing this + * {@code Rectangle} and its values. + * @return a {@code String} representing this + * {@code Rectangle} object's coordinate and size values. */ public String toString() { return getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + ",height=" + height + "]"; diff --git a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java index 524fc999ad1..6403821b66a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java +++ b/jdk/src/java.desktop/share/classes/java/awt/RenderingHints.java @@ -161,9 +161,9 @@ public class RenderingHints /** * Returns true if the specified object is a valid value * for this Key. - * @param val the Object to test for validity - * @return true if val is valid; - * false otherwise. + * @param val the {@code Object} to test for validity + * @return {@code true} if {@code val} is valid; + * {@code false} otherwise. */ public abstract boolean isCompatibleValue(Object val); @@ -519,7 +519,7 @@ public class RenderingHints /** * LCD text contrast rendering hint key. - * The value is an Integer object which is used as a text + * The value is an {@code Integer} object which is used as a text * contrast adjustment when used in conjunction with an LCD text * anti-aliasing hint such as * {@link #VALUE_TEXT_ANTIALIAS_LCD_HRGB}. @@ -1028,7 +1028,7 @@ public class RenderingHints * Constructs a new object with the specified key/value pair. * @param key the key of the particular hint property * @param value the value of the hint property specified with - * key + * {@code key} */ public RenderingHints(Key key, Object value) { hintmap.put(key, value); @@ -1036,21 +1036,21 @@ public class RenderingHints /** * Returns the number of key-value mappings in this - * RenderingHints. + * {@code RenderingHints}. * * @return the number of key-value mappings in this - * RenderingHints. + * {@code RenderingHints}. */ public int size() { return hintmap.size(); } /** - * Returns true if this - * RenderingHints contains no key-value mappings. + * Returns {@code true} if this + * {@code RenderingHints} contains no key-value mappings. * - * @return true if this - * RenderingHints contains no key-value mappings. + * @return {@code true} if this + * {@code RenderingHints} contains no key-value mappings. */ public boolean isEmpty() { return hintmap.isEmpty(); @@ -1074,19 +1074,19 @@ public class RenderingHints /** * Returns true if this RenderingHints maps one or more keys to the * specified value. - * More formally, returns true if and only - * if this RenderingHints - * contains at least one mapping to a value v such that + * More formally, returns {@code true} if and only + * if this {@code RenderingHints} + * contains at least one mapping to a value {@code v} such that *

            * (value==null ? v==null : value.equals(v))
            * 
      . * This operation will probably require time linear in the - * RenderingHints size for most implementations - * of RenderingHints. + * {@code RenderingHints} size for most implementations + * of {@code RenderingHints}. * * @param value value whose presence in this - * RenderingHints is to be tested. - * @return true if this RenderingHints + * {@code RenderingHints} is to be tested. + * @return {@code true} if this {@code RenderingHints} * maps one or more keys to the specified value. */ public boolean containsValue(Object value) { @@ -1139,19 +1139,19 @@ public class RenderingHints /** * Adds all of the keys and corresponding values from the specified - * RenderingHints object to this - * RenderingHints object. Keys that are present in - * this RenderingHints object, but not in the specified - * RenderingHints object are not affected. + * {@code RenderingHints} object to this + * {@code RenderingHints} object. Keys that are present in + * this {@code RenderingHints} object, but not in the specified + * {@code RenderingHints} object are not affected. * @param hints the set of key/value pairs to be added to this - * RenderingHints object + * {@code RenderingHints} object */ public void add(RenderingHints hints) { hintmap.putAll(hints.hintmap); } /** - * Clears this RenderingHints object of all key/value + * Clears this {@code RenderingHints} object of all key/value * pairs. */ public void clear() { @@ -1202,93 +1202,93 @@ public class RenderingHints } /** - * Returns a Set view of the Keys contained in this - * RenderingHints. The Set is backed by the - * RenderingHints, so changes to the - * RenderingHints are reflected in the Set, - * and vice-versa. If the RenderingHints is modified - * while an iteration over the Set is in progress, - * the results of the iteration are undefined. The Set + * Returns a {@code Set} view of the Keys contained in this + * {@code RenderingHints}. The Set is backed by the + * {@code RenderingHints}, so changes to the + * {@code RenderingHints} are reflected in the {@code Set}, + * and vice-versa. If the {@code RenderingHints} is modified + * while an iteration over the {@code Set} is in progress, + * the results of the iteration are undefined. The {@code Set} * supports element removal, which removes the corresponding - * mapping from the RenderingHints, via the - * Iterator.remove, Set.remove, - * removeAll retainAll, and - * clear operations. It does not support - * the add or addAll operations. + * mapping from the {@code RenderingHints}, via the + * {@code Iterator.remove}, {@code Set.remove}, + * {@code removeAll retainAll}, and + * {@code clear} operations. It does not support + * the {@code add} or {@code addAll} operations. * - * @return a Set view of the keys contained - * in this RenderingHints. + * @return a {@code Set} view of the keys contained + * in this {@code RenderingHints}. */ public Set keySet() { return hintmap.keySet(); } /** - * Returns a Collection view of the values - * contained in this RenderingHints. - * The Collection is backed by the - * RenderingHints, so changes to - * the RenderingHints are reflected in - * the Collection, and vice-versa. - * If the RenderingHints is modified while - * an iteration over the Collection is + * Returns a {@code Collection} view of the values + * contained in this {@code RenderingHints}. + * The {@code Collection} is backed by the + * {@code RenderingHints}, so changes to + * the {@code RenderingHints} are reflected in + * the {@code Collection}, and vice-versa. + * If the {@code RenderingHints} is modified while + * an iteration over the {@code Collection} is * in progress, the results of the iteration are undefined. - * The Collection supports element removal, + * The {@code Collection} supports element removal, * which removes the corresponding mapping from the - * RenderingHints, via the - * Iterator.remove, - * Collection.remove, removeAll, - * retainAll and clear operations. - * It does not support the add or - * addAll operations. + * {@code RenderingHints}, via the + * {@code Iterator.remove}, + * {@code Collection.remove}, {@code removeAll}, + * {@code retainAll} and {@code clear} operations. + * It does not support the {@code add} or + * {@code addAll} operations. * - * @return a Collection view of the values - * contained in this RenderingHints. + * @return a {@code Collection} view of the values + * contained in this {@code RenderingHints}. */ public Collection values() { return hintmap.values(); } /** - * Returns a Set view of the mappings contained - * in this RenderingHints. Each element in the - * returned Set is a Map.Entry. - * The Set is backed by the RenderingHints, - * so changes to the RenderingHints are reflected - * in the Set, and vice-versa. If the - * RenderingHints is modified while - * while an iteration over the Set is in progress, + * Returns a {@code Set} view of the mappings contained + * in this {@code RenderingHints}. Each element in the + * returned {@code Set} is a {@code Map.Entry}. + * The {@code Set} is backed by the {@code RenderingHints}, + * so changes to the {@code RenderingHints} are reflected + * in the {@code Set}, and vice-versa. If the + * {@code RenderingHints} is modified while + * while an iteration over the {@code Set} is in progress, * the results of the iteration are undefined. *

      - * The entrySet returned from a RenderingHints object + * The entrySet returned from a {@code RenderingHints} object * is not modifiable. * - * @return a Set view of the mappings contained in - * this RenderingHints. + * @return a {@code Set} view of the mappings contained in + * this {@code RenderingHints}. */ public Set> entrySet() { return Collections.unmodifiableMap(hintmap).entrySet(); } /** - * Compares the specified Object with this - * RenderingHints for equality. - * Returns true if the specified object is also a - * Map and the two Map objects represent - * the same mappings. More formally, two Map objects - * t1 and t2 represent the same mappings - * if t1.keySet().equals(t2.keySet()) and for every - * key k in t1.keySet(), + * Compares the specified {@code Object} with this + * {@code RenderingHints} for equality. + * Returns {@code true} if the specified object is also a + * {@code Map} and the two {@code Map} objects represent + * the same mappings. More formally, two {@code Map} objects + * {@code t1} and {@code t2} represent the same mappings + * if {@code t1.keySet().equals(t2.keySet())} and for every + * key {@code k} in {@code t1.keySet()}, *

            * (t1.get(k)==null ? t2.get(k)==null : t1.get(k).equals(t2.get(k)))
            * 
      . - * This ensures that the equals method works properly across - * different implementations of the Map interface. + * This ensures that the {@code equals} method works properly across + * different implementations of the {@code Map} interface. * - * @param o Object to be compared for equality with - * this RenderingHints. - * @return true if the specified Object - * is equal to this RenderingHints. + * @param o {@code Object} to be compared for equality with + * this {@code RenderingHints}. + * @return {@code true} if the specified {@code Object} + * is equal to this {@code RenderingHints}. */ public boolean equals(Object o) { if (o instanceof RenderingHints) { @@ -1300,16 +1300,16 @@ public class RenderingHints } /** - * Returns the hash code value for this RenderingHints. - * The hash code of a RenderingHints is defined to be - * the sum of the hashCodes of each Entry in the - * RenderingHints object's entrySet view. This ensures that - * t1.equals(t2) implies that - * t1.hashCode()==t2.hashCode() for any two Map - * objects t1 and t2, as required by the general - * contract of Object.hashCode. + * Returns the hash code value for this {@code RenderingHints}. + * The hash code of a {@code RenderingHints} is defined to be + * the sum of the hashCodes of each {@code Entry} in the + * {@code RenderingHints} object's entrySet view. This ensures that + * {@code t1.equals(t2)} implies that + * {@code t1.hashCode()==t2.hashCode()} for any two {@code Map} + * objects {@code t1} and {@code t2}, as required by the general + * contract of {@code Object.hashCode}. * - * @return the hash code value for this RenderingHints. + * @return the hash code value for this {@code RenderingHints}. * @see java.util.Map.Entry#hashCode() * @see Object#hashCode() * @see Object#equals(Object) @@ -1320,8 +1320,8 @@ public class RenderingHints } /** - * Creates a clone of this RenderingHints object - * that has the same contents as this RenderingHints + * Creates a clone of this {@code RenderingHints} object + * that has the same contents as this {@code RenderingHints} * object. * @return a clone of this instance. */ @@ -1344,7 +1344,7 @@ public class RenderingHints /** * Returns a rather long string representation of the hashmap * which contains the mappings of keys to values for this - * RenderingHints object. + * {@code RenderingHints} object. * @return a string representation of this object. */ public String toString() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Robot.java b/jdk/src/java.desktop/share/classes/java/awt/Robot.java index a915b2232b9..8483ed35297 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Robot.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Robot.java @@ -49,12 +49,12 @@ import sun.awt.image.SunWritableRaster; * Using the class to generate input events differs from posting * events to the AWT event queue or AWT components in that the * events are generated in the platform's native input - * queue. For example, Robot.mouseMove will actually move + * queue. For example, {@code Robot.mouseMove} will actually move * the mouse cursor instead of just generating mouse move events. *

      * Note that some platforms require special privileges or extensions * to access low-level input control. If the current platform configuration - * does not allow input control, an AWTException will be thrown + * does not allow input control, an {@code AWTException} will be thrown * when trying to construct Robot objects. For example, X-Window systems * will throw the exception if the XTEST 2.2 standard extension is not supported * (or not enabled) by the X server. @@ -80,7 +80,7 @@ public class Robot { * @throws AWTException if the platform configuration does not allow * low-level input control. This exception is always thrown when * GraphicsEnvironment.isHeadless() returns true - * @throws SecurityException if createRobot permission is not granted + * @throws SecurityException if {@code createRobot} permission is not granted * @see java.awt.GraphicsEnvironment#isHeadless * @see SecurityManager#checkPermission * @see AWTPermission @@ -113,9 +113,9 @@ public class Robot { * @throws AWTException if the platform configuration does not allow * low-level input control. This exception is always thrown when * GraphicsEnvironment.isHeadless() returns true. - * @throws IllegalArgumentException if screen is not a screen + * @throws IllegalArgumentException if {@code screen} is not a screen * GraphicsDevice. - * @throws SecurityException if createRobot permission is not granted + * @throws SecurityException if {@code createRobot} permission is not granted * @see java.awt.GraphicsEnvironment#isHeadless * @see GraphicsDevice * @see SecurityManager#checkPermission @@ -336,14 +336,14 @@ public class Robot { /** * Presses a given key. The key should be released using the - * keyRelease method. + * {@code keyRelease} method. *

      * Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. * - * @param keycode Key to press (e.g. KeyEvent.VK_A) - * @throws IllegalArgumentException if keycode is not + * @param keycode Key to press (e.g. {@code KeyEvent.VK_A}) + * @throws IllegalArgumentException if {@code keycode} is not * a valid key * @see #keyRelease(int) * @see java.awt.event.KeyEvent @@ -358,11 +358,11 @@ public class Robot { * Releases a given key. *

      * Key codes that have more than one physical key associated with them - * (e.g. KeyEvent.VK_SHIFT could mean either the + * (e.g. {@code KeyEvent.VK_SHIFT} could mean either the * left or right shift key) will map to the left key. * - * @param keycode Key to release (e.g. KeyEvent.VK_A) - * @throws IllegalArgumentException if keycode is not a + * @param keycode Key to release (e.g. {@code KeyEvent.VK_A}) + * @throws IllegalArgumentException if {@code keycode} is not a * valid key * @see #keyPress(int) * @see java.awt.event.KeyEvent @@ -399,8 +399,8 @@ public class Robot { * not include the mouse cursor. * @param screenRect Rect to capture in screen coordinates * @return The captured image - * @throws IllegalArgumentException if screenRect width and height are not greater than zero - * @throws SecurityException if readDisplayPixels permission is not granted + * @throws IllegalArgumentException if {@code screenRect} width and height are not greater than zero + * @throws SecurityException if {@code readDisplayPixels} permission is not granted * @see SecurityManager#checkPermission * @see AWTPermission */ @@ -470,18 +470,18 @@ public class Robot { } /** - * Returns whether this Robot automatically invokes waitForIdle + * Returns whether this Robot automatically invokes {@code waitForIdle} * after generating an event. - * @return Whether waitForIdle is automatically called + * @return Whether {@code waitForIdle} is automatically called */ public synchronized boolean isAutoWaitForIdle() { return isAutoWaitForIdle; } /** - * Sets whether this Robot automatically invokes waitForIdle + * Sets whether this Robot automatically invokes {@code waitForIdle} * after generating an event. - * @param isOn Whether waitForIdle is automatically invoked + * @param isOn Whether {@code waitForIdle} is automatically invoked */ public synchronized void setAutoWaitForIdle(boolean isOn) { isAutoWaitForIdle = isOn; @@ -526,8 +526,8 @@ public class Robot { /** * Sleeps for the specified time. - * To catch any InterruptedExceptions that occur, - * Thread.sleep() may be used instead. + * To catch any {@code InterruptedException}s that occur, + * {@code Thread.sleep()} may be used instead. * * @param ms time to sleep in milliseconds * @throws IllegalArgumentException if {@code ms} diff --git a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java index 65eaed68924..8ae391daa89 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ScrollPane.java @@ -47,8 +47,8 @@ import java.io.IOException; * *

      * The state of the horizontal and vertical scrollbars is represented - * by two ScrollPaneAdjustable objects (one for each - * dimension) which implement the Adjustable interface. + * by two {@code ScrollPaneAdjustable} objects (one for each + * dimension) which implement the {@code Adjustable} interface. * The API provides methods to access those objects such that the * attributes on the Adjustable object (such as unitIncrement, value, * etc.) can be manipulated. @@ -71,7 +71,7 @@ import java.io.IOException; * be reset using setSize(). *

      * Scrolling with the wheel on a wheel-equipped mouse is enabled by default. - * This can be disabled using setWheelScrollingEnabled. + * This can be disabled using {@code setWheelScrollingEnabled}. * Wheel scrolling can be customized by setting the block and * unit increment of the horizontal and vertical Adjustables. * For information on how mouse wheel events are dispatched, see @@ -136,9 +136,9 @@ public class ScrollPane extends Container implements Accessible { /** * An adjustable vertical scrollbar. * It is important to note that you must NOT call 3 - * Adjustable methods, namely: - * setMinimum(), setMaximum(), - * setVisibleAmount(). + * {@code Adjustable} methods, namely: + * {@code setMinimum()}, {@code setMaximum()}, + * {@code setVisibleAmount()}. * * @serial * @see #getVAdjustable @@ -148,9 +148,9 @@ public class ScrollPane extends Container implements Accessible { /** * An adjustable horizontal scrollbar. * It is important to note that you must NOT call 3 - * Adjustable methods, namely: - * setMinimum(), setMaximum(), - * setVisibleAmount(). + * {@code Adjustable} methods, namely: + * {@code setMinimum()}, {@code setMaximum()}, + * {@code setVisibleAmount()}. * * @serial * @see #getHAdjustable @@ -318,10 +318,10 @@ public class ScrollPane extends Container implements Accessible { } /** - * Returns the ScrollPaneAdjustable object which + * Returns the {@code ScrollPaneAdjustable} object which * represents the state of the vertical scrollbar. * The declared return type of this method is - * Adjustable to maintain backward compatibility. + * {@code Adjustable} to maintain backward compatibility. * * @see java.awt.ScrollPaneAdjustable * @return the vertical scrollbar state @@ -331,10 +331,10 @@ public class ScrollPane extends Container implements Accessible { } /** - * Returns the ScrollPaneAdjustable object which + * Returns the {@code ScrollPaneAdjustable} object which * represents the state of the horizontal scrollbar. * The declared return type of this method is - * Adjustable to maintain backward compatibility. + * {@code Adjustable} to maintain backward compatibility. * * @see java.awt.ScrollPaneAdjustable * @return the horizontal scrollbar state @@ -488,7 +488,7 @@ public class ScrollPane extends Container implements Accessible { /** * @deprecated As of JDK version 1.1, - * replaced by doLayout(). + * replaced by {@code doLayout()}. */ @Deprecated public void layout() { @@ -573,11 +573,11 @@ public class ScrollPane extends Container implements Accessible { /** * Returns a string representing the state of this - * ScrollPane. This + * {@code ScrollPane}. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this scroll pane */ @@ -610,8 +610,8 @@ public class ScrollPane extends Container implements Accessible { /** * Process mouse wheel events that are delivered to this - * ScrollPane by scrolling an appropriate amount. - *

      Note that if the event parameter is null + * {@code ScrollPane} by scrolling an appropriate amount. + *

      Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -643,9 +643,9 @@ public class ScrollPane extends Container implements Accessible { * Enables/disables scrolling in response to movement of the mouse wheel. * Wheel scrolling is enabled by default. * - * @param handleWheel true if scrolling should be done + * @param handleWheel {@code true} if scrolling should be done * automatically for a MouseWheelEvent, - * false otherwise. + * {@code false} otherwise. * @see #isWheelScrollingEnabled * @see java.awt.event.MouseWheelEvent * @see java.awt.event.MouseWheelListener @@ -683,8 +683,8 @@ public class ScrollPane extends Container implements Accessible { /** * Reads default serializable fields to stream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ private void readObject(ObjectInputStream s) @@ -779,7 +779,7 @@ public class ScrollPane extends Container implements Accessible { /** * This class implements accessibility support for the - * ScrollPane class. It provides an implementation of the + * {@code ScrollPane} class. It provides an implementation of the * Java Accessibility API appropriate to scroll pane user-interface * elements. * @since 1.3 diff --git a/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java b/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java index 6d3a6d01bf9..657c7d7e6d1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java +++ b/jdk/src/java.desktop/share/classes/java/awt/ScrollPaneAdjustable.java @@ -34,15 +34,15 @@ import java.io.Serializable; /** * This class represents the state of a horizontal or vertical - * scrollbar of a ScrollPane. Objects of this class are - * returned by ScrollPane methods. + * scrollbar of a {@code ScrollPane}. Objects of this class are + * returned by {@code ScrollPane} methods. * * @since 1.4 */ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** - * The ScrollPane this object is a scrollbar of. + * The {@code ScrollPane} this object is a scrollbar of. * @serial */ private ScrollPane sp; @@ -59,8 +59,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The value of this scrollbar. - * value should be greater than minimum - * and less than maximum + * {@code value} should be greater than {@code minimum} + * and less than {@code maximum} * * @serial * @see #getValue @@ -70,14 +70,14 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The minimum value of this scrollbar. - * This value can only be set by the ScrollPane. + * This value can only be set by the {@code ScrollPane}. *

      * ATTN: In current implementation - * minimum is always 0. This field can - * only be altered via setSpan method and - * ScrollPane always calls that method with - * 0 for the minimum. getMinimum method - * always returns 0 without checking this field. + * {@code minimum} is always {@code 0}. This field can + * only be altered via {@code setSpan} method and + * {@code ScrollPane} always calls that method with + * {@code 0} for the minimum. {@code getMinimum} method + * always returns {@code 0} without checking this field. * * @serial * @see #getMinimum @@ -87,7 +87,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The maximum value of this scrollbar. - * This value can only be set by the ScrollPane. + * This value can only be set by the {@code ScrollPane}. * * @serial * @see #getMaximum @@ -97,7 +97,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * The size of the visible portion of this scrollbar. - * This value can only be set by the ScrollPane. + * This value can only be set by the {@code ScrollPane}. * * @serial * @see #getVisibleAmount @@ -106,7 +106,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { private int visibleAmount; /** - * The adjusting status of the Scrollbar. + * The adjusting status of the {@code Scrollbar}. * True if the value is in the process of changing as a result of * actions being taken by the user. * @@ -141,7 +141,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { private AdjustmentListener adjustmentListener; /** - * Error message for AWTError reported when one of + * Error message for {@code AWTError} reported when one of * the public but unsupported methods is called. */ private static final String SCROLLPANE_ONLY = @@ -174,13 +174,13 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Constructs a new object to represent specified scrollabar - * of the specified ScrollPane. + * of the specified {@code ScrollPane}. * Only ScrollPane creates instances of this class. - * @param sp ScrollPane - * @param l AdjustmentListener to add upon creation. + * @param sp {@code ScrollPane} + * @param l {@code AdjustmentListener} to add upon creation. * @param orientation specifies which scrollbar this object represents, - * can be either Adjustable.HORIZONTAL - * or Adjustable.VERTICAL. + * can be either {@code Adjustable.HORIZONTAL} + * or {@code Adjustable.VERTICAL}. */ ScrollPaneAdjustable(ScrollPane sp, AdjustmentListener l, int orientation) { this.sp = sp; @@ -190,8 +190,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This is called by the scrollpane itself to update the - * minimum, maximum and - * visible values. The scrollpane is the only one + * {@code minimum}, {@code maximum} and + * {@code visible} values. The scrollpane is the only one * that should be changing these since it is the source of these * values. */ @@ -208,8 +208,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Returns the orientation of this scrollbar. * @return the orientation of this scrollbar, either - * Adjustable.HORIZONTAL or - * Adjustable.VERTICAL + * {@code Adjustable.HORIZONTAL} or + * {@code Adjustable.VERTICAL} */ public int getOrientation() { return orientation; @@ -218,7 +218,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This method should NOT be called by user code. * This method is public for this class to properly implement - * Adjustable interface. + * {@code Adjustable} interface. * * @throws AWTError Always throws an error when called. */ @@ -235,7 +235,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This method should NOT be called by user code. * This method is public for this class to properly implement - * Adjustable interface. + * {@code Adjustable} interface. * * @throws AWTError Always throws an error when called. */ @@ -272,7 +272,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * This method should NOT be called by user code. * This method is public for this class to properly implement - * Adjustable interface. + * {@code Adjustable} interface. * * @throws AWTError Always throws an error when called. */ @@ -286,7 +286,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** - * Sets the valueIsAdjusting property. + * Sets the {@code valueIsAdjusting} property. * * @param b new adjustment-in-progress status * @see #getValueIsAdjusting @@ -307,7 +307,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * Returns true if the value is in the process of changing as a * result of actions being taken by the user. * - * @return the value of the valueIsAdjusting property + * @return the value of the {@code valueIsAdjusting} property * @see #setValueIsAdjusting */ public boolean getValueIsAdjusting() { @@ -361,8 +361,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Adds the specified adjustment listener to receive adjustment - * events from this ScrollPaneAdjustable. - * If l is null, no exception is thrown + * events from this {@code ScrollPaneAdjustable}. + * If {@code l} is {@code null}, no exception is thrown * and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -382,8 +382,8 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Removes the specified adjustment listener so that it no longer - * receives adjustment events from this ScrollPaneAdjustable. - * If l is null, no exception is thrown + * receives adjustment events from this {@code ScrollPaneAdjustable}. + * If {@code l} is {@code null}, no exception is thrown * and no action is performed. *

      Refer to AWT Threading Issues for details on AWT's threading model. @@ -404,10 +404,10 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { /** * Returns an array of all the adjustment listeners - * registered on this ScrollPaneAdjustable. + * registered on this {@code ScrollPaneAdjustable}. * - * @return all of this ScrollPaneAdjustable's - * AdjustmentListeners + * @return all of this {@code ScrollPaneAdjustable}'s + * {@code AdjustmentListener}s * or an empty array if no adjustment * listeners are currently registered * @@ -435,7 +435,7 @@ public class ScrollPaneAdjustable implements Adjustable, Serializable { * This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary * between implementations. The returned string may be empty but - * may not be null. + * may not be {@code null}. * * @return the parameter string of this scrollbar. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java b/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java index ae2cb0e7d41..7bec1ef7956 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Scrollbar.java @@ -34,7 +34,7 @@ import javax.accessibility.*; /** - * The Scrollbar class embodies a scroll bar, a + * The {@code Scrollbar} class embodies a scroll bar, a * familiar user-interface object. A scroll bar provides a * convenient means for allowing a user to select from a * range of values. The following three vertical @@ -72,9 +72,9 @@ import javax.accessibility.*; *


      *

      * Note that the actual maximum value of the scroll bar is the - * maximum minus the visible amount. - * In the previous example, because the maximum is - * 300 and the visible amount is 60, the actual maximum + * {@code maximum} minus the {@code visible amount}. + * In the previous example, because the {@code maximum} is + * 300 and the {@code visible amount} is 60, the actual maximum * value is 240. The range of the scrollbar track is 0 - 300. * The left side of the bubble indicates the value of the * scroll bar. @@ -89,39 +89,39 @@ import javax.accessibility.*; * increment and block decrement areas. *

      * When the user changes the value of the scroll bar, the scroll bar - * receives an instance of AdjustmentEvent. + * receives an instance of {@code AdjustmentEvent}. * The scroll bar processes this event, passing it along to * any registered listeners. *

      * Any object that wishes to be notified of changes to the * scroll bar's value should implement - * AdjustmentListener, an interface defined in - * the package java.awt.event. + * {@code AdjustmentListener}, an interface defined in + * the package {@code java.awt.event}. * Listeners can be added and removed dynamically by calling - * the methods addAdjustmentListener and - * removeAdjustmentListener. + * the methods {@code addAdjustmentListener} and + * {@code removeAdjustmentListener}. *

      - * The AdjustmentEvent class defines five types + * The {@code AdjustmentEvent} class defines five types * of adjustment event, listed here: * *

        - *
      • AdjustmentEvent.TRACK is sent out when the + *
      • {@code AdjustmentEvent.TRACK} is sent out when the * user drags the scroll bar's bubble. - *
      • AdjustmentEvent.UNIT_INCREMENT is sent out + *
      • {@code AdjustmentEvent.UNIT_INCREMENT} is sent out * when the user clicks in the left arrow of a horizontal scroll * bar, or the top arrow of a vertical scroll bar, or makes the * equivalent gesture from the keyboard. - *
      • AdjustmentEvent.UNIT_DECREMENT is sent out + *
      • {@code AdjustmentEvent.UNIT_DECREMENT} is sent out * when the user clicks in the right arrow of a horizontal scroll * bar, or the bottom arrow of a vertical scroll bar, or makes the * equivalent gesture from the keyboard. - *
      • AdjustmentEvent.BLOCK_INCREMENT is sent out + *
      • {@code AdjustmentEvent.BLOCK_INCREMENT} is sent out * when the user clicks in the track, to the left of the bubble * on a horizontal scroll bar, or above the bubble on a vertical * scroll bar. By convention, the Page Up * key is equivalent, if the user is using a keyboard that * defines a Page Up key. - *
      • AdjustmentEvent.BLOCK_DECREMENT is sent out + *
      • {@code AdjustmentEvent.BLOCK_DECREMENT} is sent out * when the user clicks in the track, to the right of the bubble * on a horizontal scroll bar, or below the bubble on a vertical * scroll bar. By convention, the Page Down @@ -138,23 +138,23 @@ import javax.accessibility.*; * and the corresponding JDK 1.0 event type it replaces. * *
          - *
        • AdjustmentEvent.TRACK replaces - * Event.SCROLL_ABSOLUTE - *
        • AdjustmentEvent.UNIT_INCREMENT replaces - * Event.SCROLL_LINE_UP - *
        • AdjustmentEvent.UNIT_DECREMENT replaces - * Event.SCROLL_LINE_DOWN - *
        • AdjustmentEvent.BLOCK_INCREMENT replaces - * Event.SCROLL_PAGE_UP - *
        • AdjustmentEvent.BLOCK_DECREMENT replaces - * Event.SCROLL_PAGE_DOWN + *
        • {@code AdjustmentEvent.TRACK} replaces + * {@code Event.SCROLL_ABSOLUTE} + *
        • {@code AdjustmentEvent.UNIT_INCREMENT} replaces + * {@code Event.SCROLL_LINE_UP} + *
        • {@code AdjustmentEvent.UNIT_DECREMENT} replaces + * {@code Event.SCROLL_LINE_DOWN} + *
        • {@code AdjustmentEvent.BLOCK_INCREMENT} replaces + * {@code Event.SCROLL_PAGE_UP} + *
        • {@code AdjustmentEvent.BLOCK_DECREMENT} replaces + * {@code Event.SCROLL_PAGE_DOWN} *
        *

        - * Note: We recommend using a Scrollbar + * Note: We recommend using a {@code Scrollbar} * for value selection only. If you want to implement * a scrollable component inside a container, we recommend you use * a {@link ScrollPane ScrollPane}. If you use a - * Scrollbar for this purpose, you are likely to + * {@code Scrollbar} for this purpose, you are likely to * encounter issues with painting, key handling, sizing and * positioning. * @@ -176,10 +176,10 @@ public class Scrollbar extends Component implements Adjustable, Accessible { public static final int VERTICAL = 1; /** - * The value of the Scrollbar. - * This property must be greater than or equal to minimum + * The value of the {@code Scrollbar}. + * This property must be greater than or equal to {@code minimum} * and less than or equal to - * maximum - visibleAmount + * {@code maximum - visibleAmount} * * @serial * @see #getValue @@ -188,8 +188,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int value; /** - * The maximum value of the Scrollbar. - * This value must be greater than the minimum + * The maximum value of the {@code Scrollbar}. + * This value must be greater than the {@code minimum} * value.
        * * @serial @@ -199,8 +199,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int maximum; /** - * The minimum value of the Scrollbar. - * This value must be less than the maximum + * The minimum value of the {@code Scrollbar}. + * This value must be less than the {@code maximum} * value.
        * * @serial @@ -210,7 +210,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int minimum; /** - * The size of the Scrollbar's bubble. + * The size of the {@code Scrollbar}'s bubble. * When a scroll bar is used to select a range of values, * the visibleAmount represents the size of this range. * Depending on platform, this may be visually indicated @@ -223,11 +223,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int visibleAmount; /** - * The Scrollbar's orientation--being either horizontal + * The {@code Scrollbar}'s orientation--being either horizontal * or vertical. * This value should be specified when the scrollbar is created.
        - * orientation can be either : VERTICAL or - * HORIZONTAL only. + * orientation can be either : {@code VERTICAL} or + * {@code HORIZONTAL} only. * * @serial * @see #getOrientation @@ -258,7 +258,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { int pageIncrement = 10; /** - * The adjusting status of the Scrollbar. + * The adjusting status of the {@code Scrollbar}. * True if the value is in the process of changing as a result of * actions being taken by the user. * @@ -306,7 +306,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * orientation * indicates whether the scroll bar is vertical *
        or horizontal - * Scrollbar.VERTICAL + * {@code Scrollbar.VERTICAL} * * * value @@ -360,14 +360,14 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Constructs a new scroll bar with the specified orientation. *

        - * The orientation argument must take one of the two - * values Scrollbar.HORIZONTAL, - * or Scrollbar.VERTICAL, + * The {@code orientation} argument must take one of the two + * values {@code Scrollbar.HORIZONTAL}, + * or {@code Scrollbar.VERTICAL}, * indicating a horizontal or vertical scroll bar, respectively. * * @param orientation indicates the orientation of the scroll bar * @exception IllegalArgumentException when an illegal value for - * the orientation argument is supplied + * the {@code orientation} argument is supplied * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -380,9 +380,9 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Constructs a new scroll bar with the specified orientation, * initial value, visible amount, and minimum and maximum values. *

        - * The orientation argument must take one of the two - * values Scrollbar.HORIZONTAL, - * or Scrollbar.VERTICAL, + * The {@code orientation} argument must take one of the two + * values {@code Scrollbar.HORIZONTAL}, + * or {@code Scrollbar.VERTICAL}, * indicating a horizontal or vertical scroll bar, respectively. *

        * The parameters supplied to this constructor are subject to the @@ -395,7 +395,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * @param minimum the minimum value of the scroll bar * @param maximum the maximum value of the scroll bar * @exception IllegalArgumentException when an illegal value for - * the orientation argument is supplied + * the {@code orientation} argument is supplied * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see #setValues @@ -416,8 +416,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Constructs a name for this component. Called by getName - * when the name is null. + * Constructs a name for this component. Called by {@code getName} + * when the name is {@code null}. */ String constructComponentName() { synchronized (Scrollbar.class) { @@ -426,8 +426,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Creates the Scrollbar's peer. The peer allows you to modify - * the appearance of the Scrollbar without changing any of its + * Creates the {@code Scrollbar}'s peer. The peer allows you to modify + * the appearance of the {@code Scrollbar} without changing any of its * functionality. */ public void addNotify() { @@ -442,8 +442,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Returns the orientation of this scroll bar. * * @return the orientation of this scroll bar, either - * Scrollbar.HORIZONTAL or - * Scrollbar.VERTICAL + * {@code Scrollbar.HORIZONTAL} or + * {@code Scrollbar.VERTICAL} * @see java.awt.Scrollbar#setOrientation */ public int getOrientation() { @@ -454,11 +454,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Sets the orientation for this scroll bar. * * @param orientation the orientation of this scroll bar, either - * Scrollbar.HORIZONTAL or - * Scrollbar.VERTICAL + * {@code Scrollbar.HORIZONTAL} or + * {@code Scrollbar.VERTICAL} * @see java.awt.Scrollbar#getOrientation * @exception IllegalArgumentException if the value supplied - * for orientation is not a + * for {@code orientation} is not a * legal value * @since 1.1 */ @@ -506,20 +506,20 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the value of this scroll bar to the specified value. *

        - * If the value supplied is less than the current minimum - * or greater than the current maximum - visibleAmount, - * then either minimum or maximum - visibleAmount + * If the value supplied is less than the current {@code minimum} + * or greater than the current {@code maximum - visibleAmount}, + * then either {@code minimum} or {@code maximum - visibleAmount} * is substituted, as appropriate. *

        * Normally, a program should change a scroll bar's - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. *

        * Calling this method does not fire an - * AdjustmentEvent. + * {@code AdjustmentEvent}. * * @param newValue the new value of the scroll bar * @see java.awt.Scrollbar#setValues @@ -547,21 +547,21 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the minimum value of this scroll bar. *

        - * When setMinimum is called, the minimum value + * When {@code setMinimum} is called, the minimum value * is changed, and other values (including the maximum, the * visible amount, and the current scroll bar value) * are changed to be consistent with the new minimum. *

        * Normally, a program should change a scroll bar's minimum - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. *

        - * Note that setting the minimum value to Integer.MAX_VALUE + * Note that setting the minimum value to {@code Integer.MAX_VALUE} * will result in the new minimum value being set to - * Integer.MAX_VALUE - 1. + * {@code Integer.MAX_VALUE - 1}. * * @param newMinimum the new minimum value for this scroll bar * @see java.awt.Scrollbar#setValues @@ -591,21 +591,21 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the maximum value of this scroll bar. *

        - * When setMaximum is called, the maximum value + * When {@code setMaximum} is called, the maximum value * is changed, and other values (including the minimum, the * visible amount, and the current scroll bar value) * are changed to be consistent with the new maximum. *

        * Normally, a program should change a scroll bar's maximum - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. *

        - * Note that setting the maximum value to Integer.MIN_VALUE + * Note that setting the maximum value to {@code Integer.MIN_VALUE} * will result in the new maximum value being set to - * Integer.MIN_VALUE + 1. + * {@code Integer.MIN_VALUE + 1}. * * @param newMaximum the new maximum value * for this scroll bar @@ -645,7 +645,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * moveable (e.g. when it takes up the entire length of the * scroll bar's track, or when the scroll bar is disabled). * Whether the bubble is displayed or not will not affect - * the value returned by getVisibleAmount. + * the value returned by {@code getVisibleAmount}. * * @return the visible amount of this scroll bar * @see java.awt.Scrollbar#setVisibleAmount @@ -660,7 +660,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @return the visible amount of this scroll bar * @deprecated As of JDK version 1.1, - * replaced by getVisibleAmount(). + * replaced by {@code getVisibleAmount()}. */ @Deprecated public int getVisible() { @@ -683,16 +683,16 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * moveable (e.g. when it takes up the entire length of the * scroll bar's track, or when the scroll bar is disabled). * Whether the bubble is displayed or not will not affect - * the value returned by getVisibleAmount. + * the value returned by {@code getVisibleAmount}. *

        - * If the visible amount supplied is less than one - * or greater than the current maximum - minimum, - * then either one or maximum - minimum + * If the visible amount supplied is less than {@code one} + * or greater than the current {@code maximum - minimum}, + * then either {@code one} or {@code maximum - minimum} * is substituted, as appropriate. *

        * Normally, a program should change a scroll bar's - * value only by calling setValues. - * The setValues method simultaneously + * value only by calling {@code setValues}. + * The {@code setValues} method simultaneously * and synchronously sets the minimum, maximum, visible amount, * and value properties of a scroll bar, so that they are * mutually consistent. @@ -737,7 +737,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * @param v the increment value * * @deprecated As of JDK version 1.1, - * replaced by setUnitIncrement(int). + * replaced by {@code setUnitIncrement(int)}. */ @Deprecated public synchronized void setLineIncrement(int v) { @@ -779,7 +779,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @return the unit increment for this scrollbar * @deprecated As of JDK version 1.1, - * replaced by getUnitIncrement(). + * replaced by {@code getUnitIncrement()}. */ @Deprecated public int getLineIncrement() { @@ -811,7 +811,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @param v the block increment * @deprecated As of JDK version 1.1, - * replaced by setBlockIncrement(). + * replaced by {@code setBlockIncrement()}. */ @Deprecated public synchronized void setPageIncrement(int v) { @@ -851,7 +851,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * @return the block increment of this scroll bar * * @deprecated As of JDK version 1.1, - * replaced by getBlockIncrement(). + * replaced by {@code getBlockIncrement()}. */ @Deprecated public int getPageIncrement() { @@ -860,8 +860,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Sets the values of four properties for this scroll bar: - * value, visibleAmount, - * minimum, and maximum. + * {@code value}, {@code visibleAmount}, + * {@code minimum}, and {@code maximum}. * If the values supplied for these properties are inconsistent * or incorrect, they will be changed to ensure consistency. *

        @@ -869,18 +869,18 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * of four scroll bar properties, assuring that the values of * these properties are mutually consistent. It enforces the * following constraints: - * maximum must be greater than minimum, - * maximum - minimum must not be greater - * than Integer.MAX_VALUE, - * visibleAmount must be greater than zero. - * visibleAmount must not be greater than - * maximum - minimum, - * value must not be less than minimum, - * and value must not be greater than - * maximum - visibleAmount + * {@code maximum} must be greater than {@code minimum}, + * {@code maximum - minimum} must not be greater + * than {@code Integer.MAX_VALUE}, + * {@code visibleAmount} must be greater than zero. + * {@code visibleAmount} must not be greater than + * {@code maximum - minimum}, + * {@code value} must not be less than {@code minimum}, + * and {@code value} must not be greater than + * {@code maximum - visibleAmount} *

        * Calling this method does not fire an - * AdjustmentEvent. + * {@code AdjustmentEvent}. * * @param value is the position in the current window * @param visible is the visible amount of the scroll bar @@ -943,7 +943,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Returns true if the value is in the process of changing as a * result of actions being taken by the user. * - * @return the value of the valueIsAdjusting property + * @return the value of the {@code valueIsAdjusting} property * @see #setValueIsAdjusting * @since 1.4 */ @@ -952,7 +952,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Sets the valueIsAdjusting property. + * Sets the {@code valueIsAdjusting} property. * * @param b new adjustment-in-progress status * @see #getValueIsAdjusting @@ -978,8 +978,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Adds the specified adjustment listener to receive instances of - * AdjustmentEvent from this scroll bar. - * If l is null, no exception is thrown and no + * {@code AdjustmentEvent} from this scroll bar. + * If l is {@code null}, no exception is thrown and no * action is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -1001,8 +1001,8 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Removes the specified adjustment listener so that it no longer - * receives instances of AdjustmentEvent from this scroll bar. - * If l is null, no exception is thrown and no action + * receives instances of {@code AdjustmentEvent} from this scroll bar. + * If l is {@code null}, no exception is thrown and no action * is performed. *

        Refer to AWT Threading Issues for details on AWT's threading model. @@ -1025,7 +1025,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * Returns an array of all the adjustment listeners * registered on this scrollbar. * - * @return all of this scrollbar's AdjustmentListeners + * @return all of this scrollbar's {@code AdjustmentListener}s * or an empty array if no adjustment * listeners are currently registered * @see #addAdjustmentListener @@ -1041,15 +1041,15 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this Scrollbar. + * upon this {@code Scrollbar}. * FooListeners are registered using the * addFooListener method. *

        - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * Scrollbar c + * {@code Scrollbar c} * for its mouse listeners with the following code: * *

        MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));
        @@ -1058,13 +1058,13 @@ public class Scrollbar extends Component implements Adjustable, Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this component, * or an empty array if no such listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @since 1.3 */ @@ -1092,11 +1092,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Processes events on this scroll bar. If the event is an - * instance of AdjustmentEvent, it invokes the - * processAdjustmentEvent method. + * instance of {@code AdjustmentEvent}, it invokes the + * {@code processAdjustmentEvent} method. * Otherwise, it invokes its superclass's - * processEvent method. - *

        Note that if the event parameter is null + * {@code processEvent} method. + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1116,17 +1116,17 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Processes adjustment events occurring on this * scrollbar by dispatching them to any registered - * AdjustmentListener objects. + * {@code AdjustmentListener} objects. *

        * This method is not called unless adjustment events are * enabled for this component. Adjustment events are enabled * when one of the following occurs: *

          - *
        • An AdjustmentListener object is registered - * via addAdjustmentListener. - *
        • Adjustment events are enabled via enableEvents. + *
        • An {@code AdjustmentListener} object is registered + * via {@code addAdjustmentListener}. + *
        • Adjustment events are enabled via {@code enableEvents}. *
        - *

        Note that if the event parameter is null + *

        Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -1145,11 +1145,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Returns a string representing the state of this Scrollbar. + * Returns a string representing the state of this {@code Scrollbar}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this scroll bar */ @@ -1176,17 +1176,17 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Writes default serializable fields to stream. Writes - * a list of serializable AdjustmentListeners + * a list of serializable {@code AdjustmentListeners} * as optional data. The non-serializable listeners are * detected and no attempt is made to serialize them. * - * @param s the ObjectOutputStream to write - * @serialData null terminated sequence of 0 - * or more pairs; the pair consists of a String - * and an Object; the String indicates + * @param s the {@code ObjectOutputStream} to write + * @serialData {@code null} terminated sequence of 0 + * or more pairs; the pair consists of a {@code String} + * and an {@code Object}; the {@code String} indicates * the type of object and is one of the following: - * adjustmentListenerK indicating an - * AdjustmentListener object + * {@code adjustmentListenerK} indicating an + * {@code AdjustmentListener} object * * @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener) * @see java.awt.Component#adjustmentListenerK @@ -1202,16 +1202,16 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Reads the ObjectInputStream and if - * it isn't null adds a listener to + * Reads the {@code ObjectInputStream} and if + * it isn't {@code null} adds a listener to * receive adjustment events fired by the - * Scrollbar. + * {@code Scrollbar}. * Unrecognized keys or values will be ignored. * - * @param s the ObjectInputStream to read + * @param s the {@code ObjectInputStream} to read * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns - * true + * {@code GraphicsEnvironment.isHeadless} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless * @see #writeObject(ObjectOutputStream) */ @@ -1239,14 +1239,14 @@ public class Scrollbar extends Component implements Adjustable, Accessible { //////////////// /** - * Gets the AccessibleContext associated with this - * Scrollbar. For scrollbars, the - * AccessibleContext takes the form of an - * AccessibleAWTScrollBar. A new - * AccessibleAWTScrollBar instance is created if necessary. + * Gets the {@code AccessibleContext} associated with this + * {@code Scrollbar}. For scrollbars, the + * {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTScrollBar}. A new + * {@code AccessibleAWTScrollBar} instance is created if necessary. * - * @return an AccessibleAWTScrollBar that serves as the - * AccessibleContext of this ScrollBar + * @return an {@code AccessibleAWTScrollBar} that serves as the + * {@code AccessibleContext} of this {@code ScrollBar} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -1258,7 +1258,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * This class implements accessibility support for the - * Scrollbar class. It provides an implementation of + * {@code Scrollbar} class. It provides an implementation of * the Java Accessibility API appropriate to scrollbar * user-interface elements. * @since 1.3 @@ -1274,7 +1274,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Get the state set of this object. * - * @return an instance of AccessibleState + * @return an instance of {@code AccessibleState} * containing the current state of the object * @see AccessibleState */ @@ -1294,7 +1294,7 @@ public class Scrollbar extends Component implements Adjustable, Accessible { /** * Get the role of this object. * - * @return an instance of AccessibleRole + * @return an instance of {@code AccessibleRole} * describing the role of the object */ public AccessibleRole getAccessibleRole() { @@ -1302,11 +1302,11 @@ public class Scrollbar extends Component implements Adjustable, Accessible { } /** - * Get the AccessibleValue associated with this + * Get the {@code AccessibleValue} associated with this * object. In the implementation of the Java Accessibility * API for this class, return this object, which is * responsible for implementing the - * AccessibleValue interface on behalf of itself. + * {@code AccessibleValue} interface on behalf of itself. * * @return this object */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Shape.java b/jdk/src/java.desktop/share/classes/java/awt/Shape.java index 0ff0fbbc09e..209063c46a2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Shape.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Shape.java @@ -31,36 +31,36 @@ import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; /** - * The Shape interface provides definitions for objects - * that represent some form of geometric shape. The Shape + * The {@code Shape} interface provides definitions for objects + * that represent some form of geometric shape. The {@code Shape} * is described by a {@link PathIterator} object, which can express the - * outline of the Shape as well as a rule for determining + * outline of the {@code Shape} as well as a rule for determining * how the outline divides the 2D plane into interior and exterior - * points. Each Shape object provides callbacks to get the + * points. Each {@code Shape} object provides callbacks to get the * bounding box of the geometry, determine whether points or * rectangles lie partly or entirely within the interior - * of the Shape, and retrieve a PathIterator - * object that describes the trajectory path of the Shape + * of the {@code Shape}, and retrieve a {@code PathIterator} + * object that describes the trajectory path of the {@code Shape} * outline. *

        * Definition of insideness: * A point is considered to lie inside a - * Shape if and only if: + * {@code Shape} if and only if: *

          *
        • it lies completely - * inside theShape boundary or + * inside the {@code Shape} boundary or *
        • - * it lies exactly on the Shape boundary and the + * it lies exactly on the {@code Shape} boundary and the * space immediately adjacent to the - * point in the increasing X direction is + * point in the increasing {@code X} direction is * entirely inside the boundary or *
        • * it lies exactly on a horizontal boundary segment and the * space immediately adjacent to the point in the - * increasing Y direction is inside the boundary. + * increasing {@code Y} direction is inside the boundary. *
        - *

        The contains and intersects methods - * consider the interior of a Shape to be the area it + *

        The {@code contains} and {@code intersects} methods + * consider the interior of a {@code Shape} to be the area it * encloses as if it were filled. This means that these methods * consider * unclosed shapes to be implicitly closed for the purpose of @@ -78,14 +78,14 @@ import java.awt.geom.Rectangle2D; public interface Shape { /** * Returns an integer {@link Rectangle} that completely encloses the - * Shape. Note that there is no guarantee that the - * returned Rectangle is the smallest bounding box that - * encloses the Shape, only that the Shape - * lies entirely within the indicated Rectangle. The - * returned Rectangle might also fail to completely - * enclose the Shape if the Shape overflows + * {@code Shape}. Note that there is no guarantee that the + * returned {@code Rectangle} is the smallest bounding box that + * encloses the {@code Shape}, only that the {@code Shape} + * lies entirely within the indicated {@code Rectangle}. The + * returned {@code Rectangle} might also fail to completely + * enclose the {@code Shape} if the {@code Shape} overflows * the limited range of the integer data type. The - * getBounds2D method generally returns a + * {@code getBounds2D} method generally returns a * tighter bounding box due to its greater flexibility in * representation. * @@ -114,8 +114,8 @@ public interface Shape { *

        * {@code bounds.contains(x,y)} does not imply {@code shape.contains(x,y)} *

        - * @return an integer Rectangle that completely encloses - * the Shape. + * @return an integer {@code Rectangle} that completely encloses + * the {@code Shape}. * @see #getBounds2D * @since 1.2 */ @@ -123,15 +123,15 @@ public interface Shape { /** * Returns a high precision and more accurate bounding box of - * the Shape than the getBounds method. + * the {@code Shape} than the {@code getBounds} method. * Note that there is no guarantee that the returned * {@link Rectangle2D} is the smallest bounding box that encloses - * the Shape, only that the Shape lies - * entirely within the indicated Rectangle2D. The + * the {@code Shape}, only that the {@code Shape} lies + * entirely within the indicated {@code Rectangle2D}. The * bounding box returned by this method is usually tighter than that - * returned by the getBounds method and never fails due + * returned by the {@code getBounds} method and never fails due * to overflow problems since the return value can be an instance of - * the Rectangle2D that uses double precision values to + * the {@code Rectangle2D} that uses double precision values to * store the dimensions. * *

        @@ -159,8 +159,8 @@ public interface Shape { *

        * {@code bounds.contains(p)} does not imply {@code shape.contains(p)} *

        - * @return an instance of Rectangle2D that is a - * high-precision bounding box of the Shape. + * @return an instance of {@code Rectangle2D} that is a + * high-precision bounding box of the {@code Shape}. * @see #getBounds * @since 1.2 */ @@ -168,13 +168,13 @@ public interface Shape { /** * Tests if the specified coordinates are inside the boundary of the - * Shape, as described by the + * {@code Shape}, as described by the * * definition of insideness. * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested - * @return true if the specified coordinates are inside - * the Shape boundary; false + * @return {@code true} if the specified coordinates are inside + * the {@code Shape} boundary; {@code false} * otherwise. * @since 1.2 */ @@ -182,30 +182,30 @@ public interface Shape { /** * Tests if a specified {@link Point2D} is inside the boundary - * of the Shape, as described by the + * of the {@code Shape}, as described by the * * definition of insideness. - * @param p the specified Point2D to be tested - * @return true if the specified Point2D is - * inside the boundary of the Shape; - * false otherwise. + * @param p the specified {@code Point2D} to be tested + * @return {@code true} if the specified {@code Point2D} is + * inside the boundary of the {@code Shape}; + * {@code false} otherwise. * @since 1.2 */ public boolean contains(Point2D p); /** - * Tests if the interior of the Shape intersects the + * Tests if the interior of the {@code Shape} intersects the * interior of a specified rectangular area. - * The rectangular area is considered to intersect the Shape + * The rectangular area is considered to intersect the {@code Shape} * if any point is contained in both the interior of the - * Shape and the specified rectangular area. + * {@code Shape} and the specified rectangular area. *

        * The {@code Shape.intersects()} method allows a {@code Shape} * implementation to conservatively return {@code true} when: *

          *
        • * there is a high probability that the rectangular area and the - * Shape intersect, but + * {@code Shape} intersect, but *
        • * the calculations to accurately determine this intersection * are prohibitively expensive. @@ -224,24 +224,24 @@ public interface Shape { * of the specified rectangular area * @param w the width of the specified rectangular area * @param h the height of the specified rectangular area - * @return true if the interior of the Shape and + * @return {@code true} if the interior of the {@code Shape} and * the interior of the rectangular area intersect, or are * both highly likely to intersect and intersection calculations - * would be too expensive to perform; false otherwise. + * would be too expensive to perform; {@code false} otherwise. * @see java.awt.geom.Area * @since 1.2 */ public boolean intersects(double x, double y, double w, double h); /** - * Tests if the interior of the Shape intersects the - * interior of a specified Rectangle2D. + * Tests if the interior of the {@code Shape} intersects the + * interior of a specified {@code Rectangle2D}. * The {@code Shape.intersects()} method allows a {@code Shape} * implementation to conservatively return {@code true} when: *
            *
          • - * there is a high probability that the Rectangle2D and the - * Shape intersect, but + * there is a high probability that the {@code Rectangle2D} and the + * {@code Shape} intersect, but *
          • * the calculations to accurately determine this intersection * are prohibitively expensive. @@ -254,11 +254,11 @@ public interface Shape { * {@code Shape} objects and therefore can be used if a more precise * answer is required. * - * @param r the specified Rectangle2D - * @return true if the interior of the Shape and - * the interior of the specified Rectangle2D + * @param r the specified {@code Rectangle2D} + * @return {@code true} if the interior of the {@code Shape} and + * the interior of the specified {@code Rectangle2D} * intersect, or are both highly likely to intersect and intersection - * calculations would be too expensive to perform; false + * calculations would be too expensive to perform; {@code false} * otherwise. * @see #intersects(double, double, double, double) * @since 1.2 @@ -266,20 +266,20 @@ public interface Shape { public boolean intersects(Rectangle2D r); /** - * Tests if the interior of the Shape entirely contains + * Tests if the interior of the {@code Shape} entirely contains * the specified rectangular area. All coordinates that lie inside - * the rectangular area must lie within the Shape for the + * the rectangular area must lie within the {@code Shape} for the * entire rectangular area to be considered contained within the - * Shape. + * {@code Shape}. *

            * The {@code Shape.contains()} method allows a {@code Shape} * implementation to conservatively return {@code false} when: *

              *
            • - * the intersect method returns true and + * the {@code intersect} method returns {@code true} and *
            • * the calculations to determine whether or not the - * Shape entirely contains the rectangular area are + * {@code Shape} entirely contains the rectangular area are * prohibitively expensive. *
            * This means that for some {@code Shapes} this method might @@ -296,11 +296,11 @@ public interface Shape { * of the specified rectangular area * @param w the width of the specified rectangular area * @param h the height of the specified rectangular area - * @return true if the interior of the Shape + * @return {@code true} if the interior of the {@code Shape} * entirely contains the specified rectangular area; - * false otherwise or, if the Shape + * {@code false} otherwise or, if the {@code Shape} * contains the rectangular area and the - * intersects method returns true + * {@code intersects} method returns {@code true} * and the containment calculations would be too expensive to * perform. * @see java.awt.geom.Area @@ -310,16 +310,16 @@ public interface Shape { public boolean contains(double x, double y, double w, double h); /** - * Tests if the interior of the Shape entirely contains the - * specified Rectangle2D. + * Tests if the interior of the {@code Shape} entirely contains the + * specified {@code Rectangle2D}. * The {@code Shape.contains()} method allows a {@code Shape} * implementation to conservatively return {@code false} when: *
              *
            • - * the intersect method returns true and + * the {@code intersect} method returns {@code true} and *
            • * the calculations to determine whether or not the - * Shape entirely contains the Rectangle2D + * {@code Shape} entirely contains the {@code Rectangle2D} * are prohibitively expensive. *
            * This means that for some {@code Shapes} this method might @@ -330,12 +330,12 @@ public interface Shape { * {@code Shape} objects and therefore can be used if a more precise * answer is required. * - * @param r The specified Rectangle2D - * @return true if the interior of the Shape - * entirely contains the Rectangle2D; - * false otherwise or, if the Shape - * contains the Rectangle2D and the - * intersects method returns true + * @param r The specified {@code Rectangle2D} + * @return {@code true} if the interior of the {@code Shape} + * entirely contains the {@code Rectangle2D}; + * {@code false} otherwise or, if the {@code Shape} + * contains the {@code Rectangle2D} and the + * {@code intersects} method returns {@code true} * and the containment calculations would be too expensive to * perform. * @see #contains(double, double, double, double) @@ -345,44 +345,44 @@ public interface Shape { /** * Returns an iterator object that iterates along the - * Shape boundary and provides access to the geometry of the - * Shape outline. If an optional {@link AffineTransform} + * {@code Shape} boundary and provides access to the geometry of the + * {@code Shape} outline. If an optional {@link AffineTransform} * is specified, the coordinates returned in the iteration are * transformed accordingly. *

            - * Each call to this method returns a fresh PathIterator - * object that traverses the geometry of the Shape object - * independently from any other PathIterator objects in use + * Each call to this method returns a fresh {@code PathIterator} + * object that traverses the geometry of the {@code Shape} object + * independently from any other {@code PathIterator} objects in use * at the same time. *

            * It is recommended, but not guaranteed, that objects - * implementing the Shape interface isolate iterations + * implementing the {@code Shape} interface isolate iterations * that are in process from any changes that might occur to the original * object's geometry during such iterations. * - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired - * @return a new PathIterator object, which independently - * traverses the geometry of the Shape. + * {@code null} if untransformed coordinates are desired + * @return a new {@code PathIterator} object, which independently + * traverses the geometry of the {@code Shape}. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at); /** - * Returns an iterator object that iterates along the Shape + * Returns an iterator object that iterates along the {@code Shape} * boundary and provides access to a flattened view of the - * Shape outline geometry. + * {@code Shape} outline geometry. *

            * Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are * returned by the iterator. *

            - * If an optional AffineTransform is specified, + * If an optional {@code AffineTransform} is specified, * the coordinates returned in the iteration are transformed * accordingly. *

            * The amount of subdivision of the curved segments is controlled - * by the flatness parameter, which specifies the + * by the {@code flatness} parameter, which specifies the * maximum distance that any point on the unflattened transformed * curve can deviate from the returned flattened path segments. * Note that a limit on the accuracy of the flattened path might be @@ -390,24 +390,24 @@ public interface Shape { * treated as larger values. This limit, if there is one, is * defined by the particular implementation that is used. *

            - * Each call to this method returns a fresh PathIterator - * object that traverses the Shape object geometry - * independently from any other PathIterator objects in use at + * Each call to this method returns a fresh {@code PathIterator} + * object that traverses the {@code Shape} object geometry + * independently from any other {@code PathIterator} objects in use at * the same time. *

            * It is recommended, but not guaranteed, that objects - * implementing the Shape interface isolate iterations + * implementing the {@code Shape} interface isolate iterations * that are in process from any changes that might occur to the original * object's geometry during such iterations. * - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired * @param flatness the maximum distance that the line segments used to * approximate the curved segments are allowed to deviate * from any point on the original curve - * @return a new PathIterator that independently traverses - * a flattened view of the geometry of the Shape. + * @return a new {@code PathIterator} that independently traverses + * a flattened view of the geometry of the {@code Shape}. * @since 1.2 */ public PathIterator getPathIterator(AffineTransform at, double flatness); diff --git a/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java b/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java index 3cf8ac0a6cd..4b6fab00428 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SplashScreen.java @@ -48,7 +48,7 @@ import sun.awt.image.SunWritableRaster; * Place the image in the jar archive and specify the path in the option. * The path should not have a leading slash. *
            - * For example, in the manifest.mf file: + * For example, in the {@code manifest.mf} file: *

              * Manifest-Version: 1.0
              * Main-Class: Test
            @@ -89,7 +89,7 @@ import sun.awt.image.SunWritableRaster;
              * can exist, and it may be obtained by using the {@link #getSplashScreen()}
              * static method. In case the splash screen has not been created at
              * application startup via the command line or manifest file option,
            - * the getSplashScreen method returns null.
            + * the {@code getSplashScreen} method returns {@code null}.
              *
              * @author Oleg Semenov
              * @since 1.6
            @@ -108,7 +108,7 @@ public final class SplashScreen {
                  *         supported by the current toolkit
                  * @throws HeadlessException if {@code GraphicsEnvironment.isHeadless()}
                  *         returns true
            -     * @return the {@link SplashScreen} instance, or null if there is
            +     * @return the {@link SplashScreen} instance, or {@code null} if there is
                  *         none or it has already been closed
                  */
                 public static  SplashScreen getSplashScreen() {
            @@ -142,9 +142,9 @@ public final class SplashScreen {
                  * The splash screen window is resized according to the size of
                  * the image and is centered on the screen.
                  *
            -     * @param imageURL the non-null URL for the new
            +     * @param imageURL the non-{@code null} URL for the new
                  *        splash screen image
            -     * @throws NullPointerException if {@code imageURL} is null
            +     * @throws NullPointerException if {@code imageURL} is {@code null}
                  * @throws IOException if there was an error while loading the image
                  * @throws IllegalStateException if the splash screen has already been
                  *         closed
            @@ -282,7 +282,7 @@ public final class SplashScreen {
                  * displayed over the main image using alpha blending. Also note that drawing
                  * on the overlay image does not necessarily update the contents of splash
                  * screen window. You should call {@code update()} on the
            -     * SplashScreen when you want the splash screen to be
            +     * {@code SplashScreen} when you want the splash screen to be
                  * updated immediately.
                  * 

            * The pixel (0, 0) in the coordinate space of the graphics context @@ -402,7 +402,7 @@ public final class SplashScreen { /** * The instance reference for the singleton. - * (null if no instance exists yet.) + * ({@code null} if no instance exists yet.) * * @see #getSplashScreen * @see #close diff --git a/jdk/src/java.desktop/share/classes/java/awt/Stroke.java b/jdk/src/java.desktop/share/classes/java/awt/Stroke.java index 93ff2e8b32d..291c3857362 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Stroke.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Stroke.java @@ -26,43 +26,43 @@ package java.awt; /** - * The Stroke interface allows a + * The {@code Stroke} interface allows a * {@link Graphics2D} object to obtain a {@link Shape} that is the * decorated outline, or stylistic representation of the outline, - * of the specified Shape. - * Stroking a Shape is like tracing its outline with a + * of the specified {@code Shape}. + * Stroking a {@code Shape} is like tracing its outline with a * marking pen of the appropriate size and shape. * The area where the pen would place ink is the area enclosed by the - * outline Shape. + * outline {@code Shape}. *

            - * The methods of the Graphics2D interface that use the - * outline Shape returned by a Stroke object - * include draw and any other methods that are + * The methods of the {@code Graphics2D} interface that use the + * outline {@code Shape} returned by a {@code Stroke} object + * include {@code draw} and any other methods that are * implemented in terms of that method, such as - * drawLine, drawRect, - * drawRoundRect, drawOval, - * drawArc, drawPolyline, - * and drawPolygon. + * {@code drawLine}, {@code drawRect}, + * {@code drawRoundRect}, {@code drawOval}, + * {@code drawArc}, {@code drawPolyline}, + * and {@code drawPolygon}. *

            - * The objects of the classes implementing Stroke - * must be read-only because Graphics2D does not + * The objects of the classes implementing {@code Stroke} + * must be read-only because {@code Graphics2D} does not * clone these objects either when they are set as an attribute - * with the setStroke method or when the - * Graphics2D object is itself cloned. - * If a Stroke object is modified after it is set in - * the Graphics2D context then the behavior + * with the {@code setStroke} method or when the + * {@code Graphics2D} object is itself cloned. + * If a {@code Stroke} object is modified after it is set in + * the {@code Graphics2D} context then the behavior * of subsequent rendering would be undefined. * @see BasicStroke * @see Graphics2D#setStroke */ public interface Stroke { /** - * Returns an outline Shape which encloses the area that - * should be painted when the Shape is stroked according + * Returns an outline {@code Shape} which encloses the area that + * should be painted when the {@code Shape} is stroked according * to the rules defined by the - * object implementing the Stroke interface. - * @param p a Shape to be stroked - * @return the stroked outline Shape. + * object implementing the {@code Stroke} interface. + * @param p a {@code Shape} to be stroked + * @return the stroked outline {@code Shape}. */ Shape createStrokedShape (Shape p); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java b/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java index 38a173f339a..75b3e58d6af 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SystemColor.java @@ -36,15 +36,15 @@ import java.lang.annotation.Native; * update of the system colors (when the user changes the colors) * the actual RGB values of these symbolic colors will also change * dynamically. In order to compare the "current" RGB value of a - * SystemColor object with a non-symbolic Color object, - * getRGB should be used rather than equals. + * {@code SystemColor} object with a non-symbolic Color object, + * {@code getRGB} should be used rather than {@code equals}. *

            * Note that the way in which these system colors are applied to GUI objects * may vary slightly from platform to platform since GUI objects may be * rendered differently on each platform. *

            - * System color values may also be available through the getDesktopProperty - * method on java.awt.Toolkit. + * System color values may also be available through the {@code getDesktopProperty} + * method on {@code java.awt.Toolkit}. * * @see Toolkit#getDesktopProperty * @@ -380,28 +380,28 @@ public final class SystemColor extends Color implements java.io.Serializable { /** * The color rendered for light areas of 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlHighlight = new SystemColor((byte)CONTROL_HIGHLIGHT); /** * The color rendered for highlight areas of 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlLtHighlight = new SystemColor((byte)CONTROL_LT_HIGHLIGHT); /** * The color rendered for shadow areas of 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlShadow = new SystemColor((byte)CONTROL_SHADOW); /** * The color rendered for dark shadow areas on 3D control objects, such as pushbuttons. - * This color is typically derived from the control background color + * This color is typically derived from the {@code control} background color * to provide a 3D effect. */ public static final SystemColor controlDkShadow = new SystemColor((byte)CONTROL_DK_SHADOW); @@ -487,13 +487,13 @@ public final class SystemColor extends Color implements java.io.Serializable { } /** - * Returns a string representation of this Color's values. + * Returns a string representation of this {@code Color}'s values. * This method is intended to be used only for debugging purposes, * and the content and format of the returned string may vary between * implementations. - * The returned string may be empty but may not be null. + * The returned string may be empty but may not be {@code null}. * - * @return a string representation of this Color + * @return a string representation of this {@code Color} */ public String toString() { return getClass().getName() + "[i=" + (index) + "]"; diff --git a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java index e61716ee537..46ed1ff807c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java +++ b/jdk/src/java.desktop/share/classes/java/awt/SystemTray.java @@ -36,7 +36,7 @@ import sun.awt.AWTAccessor; import sun.awt.AWTPermissions; /** - * The SystemTray class represents the system tray for a + * The {@code SystemTray} class represents the system tray for a * desktop. On Microsoft Windows it is referred to as the "Taskbar * Status Area", on Gnome it is referred to as the "Notification * Area", on KDE it is referred to as the "System Tray". The system @@ -47,19 +47,19 @@ import sun.awt.AWTPermissions; * throws {@link UnsupportedOperationException}. To detect whether the * system tray is supported, use {@link SystemTray#isSupported}. * - *

            The SystemTray may contain one or more {@link + *

            The {@code SystemTray} may contain one or more {@link * TrayIcon TrayIcons}, which are added to the tray using the {@link * #add} method, and removed when no longer needed, using the - * {@link #remove}. TrayIcon consists of an + * {@link #remove}. {@code TrayIcon} consists of an * image, a popup menu and a set of associated listeners. Please see * the {@link TrayIcon} class for details. * - *

            Every Java application has a single SystemTray + *

            Every Java application has a single {@code SystemTray} * instance that allows the app to interface with the system tray of - * the desktop while the app is running. The SystemTray + * the desktop while the app is running. The {@code SystemTray} * instance can be obtained from the {@link #getSystemTray} method. * An application may not create its own instance of - * SystemTray. + * {@code SystemTray}. * *

            The following code snippet demonstrates how to access * and customize the system tray: @@ -141,7 +141,7 @@ public class SystemTray { } /** - * Private SystemTray constructor. + * Private {@code SystemTray} constructor. * */ private SystemTray() { @@ -149,7 +149,7 @@ public class SystemTray { } /** - * Gets the SystemTray instance that represents the + * Gets the {@code SystemTray} instance that represents the * desktop's tray area. This always returns the same instance per * application. On some platforms the system tray may not be * supported. You may use the {@link #isSupported} method to @@ -160,12 +160,12 @@ public class SystemTray { * {@code SystemTray} instance. Otherwise this method will throw a * SecurityException. * - * @return the SystemTray instance that represents + * @return the {@code SystemTray} instance that represents * the desktop's tray area * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if - * GraphicsEnvironment.isHeadless() returns true + * {@code GraphicsEnvironment.isHeadless()} returns {@code true} * @throws SecurityException if {@code accessSystemTray} permission * is not granted * @see #add(TrayIcon) @@ -203,15 +203,15 @@ public class SystemTray { * both the action listener and the popup menu. See the {@link * SystemTray example} for an example of how to do this. * - *

            Note: When implementing SystemTray and - * TrayIcon it is strongly recommended that + *

            Note: When implementing {@code SystemTray} and + * {@code TrayIcon} it is strongly recommended that * you assign different gestures to the popup menu and an action * event. Overloading a gesture for both purposes is confusing * and may prevent the user from accessing one or the other. * * @see #getSystemTray - * @return false if no system tray access is supported; this - * method returns true if the minimal system tray access is + * @return {@code false} if no system tray access is supported; this + * method returns {@code true} if the minimal system tray access is * supported but does not guarantee that all system tray * functionality is supported for the current platform */ @@ -231,20 +231,20 @@ public class SystemTray { } /** - * Adds a TrayIcon to the SystemTray. + * Adds a {@code TrayIcon} to the {@code SystemTray}. * The tray icon becomes visible in the system tray once it is * added. The order in which icons are displayed in a tray is not * specified - it is platform and implementation-dependent. * *

            All icons added by the application are automatically - * removed from the SystemTray upon application exit + * removed from the {@code SystemTray} upon application exit * and also when the desktop system tray becomes unavailable. * - * @param trayIcon the TrayIcon to be added - * @throws NullPointerException if trayIcon is - * null + * @param trayIcon the {@code TrayIcon} to be added + * @throws NullPointerException if {@code trayIcon} is + * {@code null} * @throws IllegalArgumentException if the same instance of - * a TrayIcon is added more than once + * a {@code TrayIcon} is added more than once * @throws AWTException if the desktop system tray is missing * @see #remove(TrayIcon) * @see #getSystemTray @@ -284,18 +284,18 @@ public class SystemTray { } /** - * Removes the specified TrayIcon from the - * SystemTray. + * Removes the specified {@code TrayIcon} from the + * {@code SystemTray}. * *

            All icons added by the application are automatically - * removed from the SystemTray upon application exit + * removed from the {@code SystemTray} upon application exit * and also when the desktop system tray becomes unavailable. * - *

            If trayIcon is null or was not + *

            If {@code trayIcon} is {@code null} or was not * added to the system tray, no exception is thrown and no action * is performed. * - * @param trayIcon the TrayIcon to be removed + * @param trayIcon the {@code TrayIcon} to be removed * @see #add(TrayIcon) * @see TrayIcon */ @@ -328,8 +328,8 @@ public class SystemTray { * *

            The returned array is a copy of the actual array and may be * modified in any way without affecting the system tray. To - * remove a TrayIcon from the - * SystemTray, use the {@link + * remove a {@code TrayIcon} from the + * {@code SystemTray}, use the {@link * #remove(TrayIcon)} method. * * @return an array of all tray icons added to this tray, or an @@ -351,7 +351,7 @@ public class SystemTray { * occupy in the system tray. Developers may use this methods to * acquire the preferred size for the image property of a tray icon * before it is created. For convenience, there is a similar - * method {@link TrayIcon#getSize} in the TrayIcon class. + * method {@link TrayIcon#getSize} in the {@code TrayIcon} class. * * @return the default size of a tray icon, in pixels * @see TrayIcon#setImageAutoSize(boolean) @@ -383,7 +383,7 @@ public class SystemTray { * * {@code systemTray} * This property contains {@code SystemTray} instance when the system tray - * is available or null otherwise.
            This property is changed + * is available or {@code null} otherwise.
            This property is changed * when the system tray becomes available or unavailable on the desktop.
            * The property is accessed by the {@link #getSystemTray} method. * diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextArea.java b/jdk/src/java.desktop/share/classes/java/awt/TextArea.java index eab879730de..a2f4246a33c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextArea.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextArea.java @@ -35,7 +35,7 @@ import javax.accessibility.AccessibleState; import javax.accessibility.AccessibleStateSet; /** - * A TextArea object is a multi-line region + * A {@code TextArea} object is a multi-line region * that displays text. It can be set to allow editing or * to be read-only. *

            @@ -56,7 +56,7 @@ import javax.accessibility.AccessibleStateSet; public class TextArea extends TextComponent { /** - * The number of rows in the TextArea. + * The number of rows in the {@code TextArea}. * This parameter will determine the text area's height. * Guaranteed to be non-negative. * @@ -67,7 +67,7 @@ public class TextArea extends TextComponent { int rows; /** - * The number of columns in the TextArea. + * The number of columns in the {@code TextArea}. * A column is an approximate average character * width that is platform-dependent. * This parameter will determine the text area's width. @@ -109,10 +109,10 @@ public class TextArea extends TextComponent { /** * Determines which scrollbars are created for the * text area. It can be one of four values : - * SCROLLBARS_BOTH = both scrollbars.
            - * SCROLLBARS_HORIZONTAL_ONLY = Horizontal bar only.
            - * SCROLLBARS_VERTICAL_ONLY = Vertical bar only.
            - * SCROLLBARS_NONE = No scrollbars.
            + * {@code SCROLLBARS_BOTH} = both scrollbars.
            + * {@code SCROLLBARS_HORIZONTAL_ONLY} = Horizontal bar only.
            + * {@code SCROLLBARS_VERTICAL_ONLY} = Vertical bar only.
            + * {@code SCROLLBARS_NONE} = No scrollbars.
            * * @serial * @see #getScrollbarVisibility() @@ -155,7 +155,7 @@ public class TextArea extends TextComponent { * {@link #SCROLLBARS_BOTH}, so both vertical and horizontal * scrollbars will be visible for this text area. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea() throws HeadlessException { @@ -168,10 +168,10 @@ public class TextArea extends TextComponent { * {@link #SCROLLBARS_BOTH}, so both vertical and horizontal * scrollbars will be visible for this text area. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(String text) throws HeadlessException { @@ -189,7 +189,7 @@ public class TextArea extends TextComponent { * @param rows the number of rows * @param columns the number of columns * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(int rows, int columns) throws HeadlessException { @@ -205,12 +205,12 @@ public class TextArea extends TextComponent { * vertical and horizontal scrollbars will be visible for this * text area. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @param rows the number of rows * @param columns the number of columns * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(String text, int rows, int columns) @@ -221,36 +221,36 @@ public class TextArea extends TextComponent { /** * Constructs a new text area with the specified text, * and with the rows, columns, and scroll bar visibility - * as specified. All TextArea constructors defer to + * as specified. All {@code TextArea} constructors defer to * this one. *

            - * The TextArea class defines several constants + * The {@code TextArea} class defines several constants * that can be supplied as values for the - * scrollbars argument: + * {@code scrollbars} argument: *

              - *
            • SCROLLBARS_BOTH, - *
            • SCROLLBARS_VERTICAL_ONLY, - *
            • SCROLLBARS_HORIZONTAL_ONLY, - *
            • SCROLLBARS_NONE. + *
            • {@code SCROLLBARS_BOTH}, + *
            • {@code SCROLLBARS_VERTICAL_ONLY}, + *
            • {@code SCROLLBARS_HORIZONTAL_ONLY}, + *
            • {@code SCROLLBARS_NONE}. *
            * Any other value for the - * scrollbars argument is invalid and will result in + * {@code scrollbars} argument is invalid and will result in * this text area being created with scrollbar visibility equal to * the default value of {@link #SCROLLBARS_BOTH}. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @param rows the number of rows; if - * rows is less than 0, - * rows is set to 0 + * {@code rows} is less than {@code 0}, + * {@code rows} is set to {@code 0} * @param columns the number of columns; if - * columns is less than 0, - * columns is set to 0 + * {@code columns} is less than {@code 0}, + * {@code columns} is set to {@code 0} * @param scrollbars a constant that determines what * scrollbars are created to view the text area * @since 1.1 * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless() */ public TextArea(String text, int rows, int columns, int scrollbars) @@ -273,8 +273,8 @@ public class TextArea extends TextComponent { } /** - * Construct a name for this component. Called by getName - * when the name is null. + * Construct a name for this component. Called by {@code getName} + * when the name is {@code null}. */ String constructComponentName() { synchronized (TextArea.class) { @@ -283,8 +283,8 @@ public class TextArea extends TextComponent { } /** - * Creates the TextArea's peer. The peer allows us to modify - * the appearance of the TextArea without changing any of its + * Creates the {@code TextArea}'s peer. The peer allows us to modify + * the appearance of the {@code TextArea} without changing any of its * functionality. */ public void addNotify() { @@ -298,11 +298,11 @@ public class TextArea extends TextComponent { /** * Inserts the specified text at the specified position * in this text area. - *

            Note that passing null or inconsistent + *

            Note that passing {@code null} or inconsistent * parameters is invalid and will result in unspecified * behavior. * - * @param str the non-null text to insert + * @param str the non-{@code null} text to insert * @param pos the position at which to insert * @see java.awt.TextComponent#setText * @see java.awt.TextArea#replaceRange @@ -320,7 +320,7 @@ public class TextArea extends TextComponent { * @param str the non-{@code null} text to insert * @param pos the position at which to insert * @deprecated As of JDK version 1.1, - * replaced by insert(String, int). + * replaced by {@code insert(String, int)}. */ @Deprecated public synchronized void insertText(String str, int pos) { @@ -333,11 +333,11 @@ public class TextArea extends TextComponent { /** * Appends the given text to the text area's current text. - *

            Note that passing null or inconsistent + *

            Note that passing {@code null} or inconsistent * parameters is invalid and will result in unspecified * behavior. * - * @param str the non-null text to append + * @param str the non-{@code null} text to append * @see java.awt.TextArea#insert * @since 1.1 */ @@ -350,7 +350,7 @@ public class TextArea extends TextComponent { * * @param str the text to append * @deprecated As of JDK version 1.1, - * replaced by append(String). + * replaced by {@code append(String)}. */ @Deprecated public synchronized void appendText(String str) { @@ -365,11 +365,11 @@ public class TextArea extends TextComponent { * same as the end position). * The text position is zero-based. The inserted substring may be * of a different length than the text it replaces. - *

            Note that passing null or inconsistent + *

            Note that passing {@code null} or inconsistent * parameters is invalid and will result in unspecified * behavior. * - * @param str the non-null text to use as + * @param str the non-{@code null} text to use as * the replacement * @param start the start position * @param end the end position @@ -391,7 +391,7 @@ public class TextArea extends TextComponent { * @param start the start position * @param end the end position * @deprecated As of JDK version 1.1, - * replaced by replaceRange(String, int, int). + * replaced by {@code replaceRange(String, int, int)}. */ @Deprecated public synchronized void replaceText(String str, int start, int end) { @@ -419,8 +419,8 @@ public class TextArea extends TextComponent { * @see #getRows() * @see #setColumns(int) * @exception IllegalArgumentException if the value - * supplied for rows - * is less than 0 + * supplied for {@code rows} + * is less than {@code 0} * @since 1.1 */ public void setRows(int rows) { @@ -450,8 +450,8 @@ public class TextArea extends TextComponent { * @see #getColumns() * @see #setRows(int) * @exception IllegalArgumentException if the value - * supplied for columns - * is less than 0 + * supplied for {@code columns} + * is less than {@code 0} * @since 1.1 */ public void setColumns(int columns) { @@ -469,9 +469,9 @@ public class TextArea extends TextComponent { * Returns an enumerated value that indicates which scroll bars * the text area uses. *

            - * The TextArea class defines four integer constants + * The {@code TextArea} class defines four integer constants * that are used to specify which scroll bars are available. - * TextArea has one constructor that gives the + * {@code TextArea} has one constructor that gives the * application discretion over scroll bars. * * @return an integer that indicates which scroll bars are used @@ -510,7 +510,7 @@ public class TextArea extends TextComponent { * @param columns the number of columns * @return the preferred dimensions needed for the text area * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(int, int). + * replaced by {@code getPreferredSize(int, int)}. */ @Deprecated public Dimension preferredSize(int rows, int columns) { @@ -534,7 +534,7 @@ public class TextArea extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -568,7 +568,7 @@ public class TextArea extends TextComponent { * @param columns the number of columns * @return the minimum size for the text area * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(int, int). + * replaced by {@code getMinimumSize(int, int)}. */ @Deprecated public Dimension minimumSize(int rows, int columns) { @@ -592,7 +592,7 @@ public class TextArea extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -604,11 +604,11 @@ public class TextArea extends TextComponent { } /** - * Returns a string representing the state of this TextArea. + * Returns a string representing the state of this {@code TextArea}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this text area */ @@ -650,8 +650,8 @@ public class TextArea extends TextComponent { /** * Read the ObjectInputStream. * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see java.awt.GraphicsEnvironment#isHeadless */ private void readObject(ObjectInputStream s) @@ -689,14 +689,14 @@ public class TextArea extends TextComponent { /** - * Returns the AccessibleContext associated with - * this TextArea. For text areas, the - * AccessibleContext takes the form of an - * AccessibleAWTTextArea. - * A new AccessibleAWTTextArea instance is created if necessary. + * Returns the {@code AccessibleContext} associated with + * this {@code TextArea}. For text areas, the + * {@code AccessibleContext} takes the form of an + * {@code AccessibleAWTTextArea}. + * A new {@code AccessibleAWTTextArea} instance is created if necessary. * - * @return an AccessibleAWTTextArea that serves as the - * AccessibleContext of this TextArea + * @return an {@code AccessibleAWTTextArea} that serves as the + * {@code AccessibleContext} of this {@code TextArea} * @since 1.3 */ public AccessibleContext getAccessibleContext() { @@ -708,7 +708,7 @@ public class TextArea extends TextComponent { /** * This class implements accessibility support for the - * TextArea class. It provides an implementation of the + * {@code TextArea} class. It provides an implementation of the * Java Accessibility API appropriate to text area user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java b/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java index 191412a30b7..29e0bb1ecba 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextComponent.java @@ -38,11 +38,11 @@ import sun.awt.AWTPermissions; import sun.awt.InputMethodSupport; /** - * The TextComponent class is the superclass of + * The {@code TextComponent} class is the superclass of * any component that allows the editing of some text. *

            * A text component embodies a string of text. The - * TextComponent class defines a set of methods + * {@code TextComponent} class defines a set of methods * that determine whether or not this text is editable. If the * component is editable, it defines another set of methods * that supports a text insertion caret. @@ -61,7 +61,7 @@ public class TextComponent extends Component implements Accessible { /** * The value of the text. - * A null value is the same as "". + * A {@code null} value is the same as "". * * @serial * @see #setText(String) @@ -71,9 +71,9 @@ public class TextComponent extends Component implements Accessible { /** * A boolean indicating whether or not this - * TextComponent is editable. - * It will be true if the text component - * is editable and false if not. + * {@code TextComponent} is editable. + * It will be {@code true} if the text component + * is editable and {@code false} if not. * * @serial * @see #isEditable() @@ -82,7 +82,7 @@ public class TextComponent extends Component implements Accessible { /** * The selection refers to the selected text, and the - * selectionStart is the start position + * {@code selectionStart} is the start position * of the selected text. * * @serial @@ -93,7 +93,7 @@ public class TextComponent extends Component implements Accessible { /** * The selection refers to the selected text, and the - * selectionEnd + * {@code selectionEnd} * is the end position of the selected text. * * @serial @@ -120,12 +120,12 @@ public class TextComponent extends Component implements Accessible { /** * Constructs a new text component initialized with the * specified text. Sets the value of the cursor to - * Cursor.TEXT_CURSOR. + * {@code Cursor.TEXT_CURSOR}. * @param text the text to be displayed; if - * text is null, the empty - * string "" will be displayed + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed * @exception HeadlessException if - * GraphicsEnvironment.isHeadless + * {@code GraphicsEnvironment.isHeadless} * returns true * @see java.awt.GraphicsEnvironment#isHeadless * @see java.awt.Cursor @@ -203,9 +203,9 @@ public class TextComponent extends Component implements Accessible { } /** - * Removes the TextComponent's peer. + * Removes the {@code TextComponent}'s peer. * The peer allows us to modify the appearance of the - * TextComponent without changing its + * {@code TextComponent} without changing its * functionality. */ public void removeNotify() { @@ -224,7 +224,7 @@ public class TextComponent extends Component implements Accessible { * Sets the text that is presented by this * text component to be the specified text. * @param t the new text; - * if this parameter is null then + * if this parameter is {@code null} then * the text is set to the empty string "" * @see java.awt.TextComponent#getText */ @@ -251,7 +251,7 @@ public class TextComponent extends Component implements Accessible { * Returns the text that is presented by this text component. * By default, this is an empty string. * - * @return the value of this TextComponent + * @return the value of this {@code TextComponent} * @see java.awt.TextComponent#setText */ public synchronized String getText() { @@ -274,8 +274,8 @@ public class TextComponent extends Component implements Accessible { /** * Indicates whether or not this text component is editable. - * @return true if this text component is - * editable; false otherwise. + * @return {@code true} if this text component is + * editable; {@code false} otherwise. * @see java.awt.TextComponent#setEditable * @since 1.0 */ @@ -287,8 +287,8 @@ public class TextComponent extends Component implements Accessible { * Sets the flag that determines whether or not this * text component is editable. *

            - * If the flag is set to true, this text component - * becomes user editable. If the flag is set to false, + * If the flag is set to {@code true}, this text component + * becomes user editable. If the flag is set to {@code false}, * the user cannot change the text of this text component. * By default, non-editable text components have a background color * of SystemColor.control. This default can be overridden by @@ -367,7 +367,7 @@ public class TextComponent extends Component implements Accessible { * to be at or before the current selection end. It also * cannot be set to less than zero, the beginning of the * component's text. - * If the caller supplies a value for selectionStart + * If the caller supplies a value for {@code selectionStart} * that is out of bounds, the method enforces these constraints * silently, and without failure. * @param selectionStart the start position of the @@ -403,7 +403,7 @@ public class TextComponent extends Component implements Accessible { * the specified position. The new end point is constrained * to be at or after the current selection start. It also * cannot be set beyond the end of the component's text. - * If the caller supplies a value for selectionEnd + * If the caller supplies a value for {@code selectionEnd} * that is out of bounds, the method enforces these constraints * silently, and without failure. * @param selectionEnd the end position of the @@ -429,8 +429,8 @@ public class TextComponent extends Component implements Accessible { * equal to the length of the text component's text. The * character positions are indexed starting with zero. * The length of the selection is - * endPosition - startPosition, so the - * character at endPosition is not selected. + * {@code endPosition} - {@code startPosition}, so the + * character at {@code endPosition} is not selected. * If the start and end positions of the selected text are equal, * all text is deselected. *

            @@ -443,10 +443,10 @@ public class TextComponent extends Component implements Accessible { * start position, it is reset to the start position. * * @param selectionStart the zero-based index of the first - character (char value) to be selected + * character ({@code char} value) to be selected * @param selectionEnd the zero-based end position of the - text to be selected; the character (char value) at - selectionEnd is not selected + * text to be selected; the character ({@code char} value) at + * {@code selectionEnd} is not selected * @see java.awt.TextComponent#setSelectionStart * @see java.awt.TextComponent#setSelectionEnd * @see java.awt.TextComponent#selectAll @@ -495,13 +495,13 @@ public class TextComponent extends Component implements Accessible { * and the last character of the text, inclusive. * If the passed-in value is greater than this range, * the value is set to the last character (or 0 if - * the TextComponent contains no text) + * the {@code TextComponent} contains no text) * and no error is returned. If the passed-in value is - * less than 0, an IllegalArgumentException + * less than 0, an {@code IllegalArgumentException} * is thrown. * * @param position the position of the text insertion caret - * @exception IllegalArgumentException if position + * @exception IllegalArgumentException if {@code position} * is less than zero * @since 1.1 */ @@ -553,7 +553,7 @@ public class TextComponent extends Component implements Accessible { /** * Adds the specified text event listener to receive text events * from this text component. - * If l is null, no exception is + * If {@code l} is {@code null}, no exception is * thrown and no action is performed. *

            Refer to AWT Threading Issues for details on AWT's threading model. @@ -574,7 +574,7 @@ public class TextComponent extends Component implements Accessible { /** * Removes the specified text event listener so that it no longer * receives text events from this text component - * If l is null, no exception is + * If {@code l} is {@code null}, no exception is * thrown and no action is performed. *

            Refer to AWT Threading Issues for details on AWT's threading model. @@ -596,7 +596,7 @@ public class TextComponent extends Component implements Accessible { * Returns an array of all the text listeners * registered on this text component. * - * @return all of this text component's TextListeners + * @return all of this text component's {@code TextListener}s * or an empty array if no text * listeners are currently registered * @@ -612,16 +612,16 @@ public class TextComponent extends Component implements Accessible { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this TextComponent. + * upon this {@code TextComponent}. * FooListeners are registered using the * addFooListener method. * *

            - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * TextComponent t + * {@code TextComponent t} * for its text listeners with the following code: * *

            TextListener[] tls = (TextListener[])(t.getListeners(TextListener.class));
            @@ -630,14 +630,14 @@ public class TextComponent extends Component implements Accessible { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this text component, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getTextListeners * @since 1.3 @@ -666,9 +666,9 @@ public class TextComponent extends Component implements Accessible { /** * Processes events on this text component. If the event is a - * TextEvent, it invokes the processTextEvent - * method else it invokes its superclass's processEvent. - *

            Note that if the event parameter is null + * {@code TextEvent}, it invokes the {@code processTextEvent} + * method else it invokes its superclass's {@code processEvent}. + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -684,17 +684,17 @@ public class TextComponent extends Component implements Accessible { /** * Processes text events occurring on this text component by - * dispatching them to any registered TextListener objects. + * dispatching them to any registered {@code TextListener} objects. *

            * NOTE: This method will not be called unless text events * are enabled for this component. This happens when one of the * following occurs: *

              - *
            • A TextListener object is registered - * via addTextListener - *
            • Text events are enabled via enableEvents + *
            • A {@code TextListener} object is registered + * via {@code addTextListener} + *
            • Text events are enabled via {@code enableEvents} *
            - *

            Note that if the event parameter is null + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -715,11 +715,11 @@ public class TextComponent extends Component implements Accessible { /** * Returns a string representing the state of this - * TextComponent. This + * {@code TextComponent}. This * method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this text component */ @@ -795,8 +795,8 @@ public class TextComponent extends Component implements Accessible { * ignored. * * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see #removeTextListener * @see #addTextListener * @see java.awt.GraphicsEnvironment#isHeadless @@ -850,7 +850,7 @@ public class TextComponent extends Component implements Accessible { /** * This class implements accessibility support for the - * TextComponent class. It provides an implementation of the + * {@code TextComponent} class. It provides an implementation of the * Java Accessibility API appropriate to text component user-interface * elements. * @since 1.3 diff --git a/jdk/src/java.desktop/share/classes/java/awt/TextField.java b/jdk/src/java.desktop/share/classes/java/awt/TextField.java index 7c5563088c3..effdfd43d24 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TextField.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TextField.java @@ -34,12 +34,12 @@ import javax.accessibility.*; /** - * A TextField object is a text component + * A {@code TextField} object is a text component * that allows for the editing of a single line of text. *

            * For example, the following image depicts a frame with four * text fields of varying widths. Two of these text fields - * display the predefined text "Hello". + * display the predefined text {@code "Hello"}. *

            * The preceding text describes this image. @@ -59,27 +59,27 @@ import javax.accessibility.*; *


            *

            * Every time the user types a key in the text field, one or - * more key events are sent to the text field. A KeyEvent + * more key events are sent to the text field. A {@code KeyEvent} * may be one of three types: keyPressed, keyReleased, or keyTyped. * The properties of a key event indicate which of these types * it is, as well as additional information about the event, * such as what modifiers are applied to the key event and the * time at which the event occurred. *

            - * The key event is passed to every KeyListener - * or KeyAdapter object which registered to receive such - * events using the component's addKeyListener method. - * (KeyAdapter objects implement the - * KeyListener interface.) + * The key event is passed to every {@code KeyListener} + * or {@code KeyAdapter} object which registered to receive such + * events using the component's {@code addKeyListener} method. + * ({@code KeyAdapter} objects implement the + * {@code KeyListener} interface.) *

            - * It is also possible to fire an ActionEvent. + * It is also possible to fire an {@code ActionEvent}. * If action events are enabled for the text field, they may - * be fired by pressing the Return key. + * be fired by pressing the {@code Return} key. *

            - * The TextField class's processEvent + * The {@code TextField} class's {@code processEvent} * method examines the action event and passes it along to - * processActionEvent. The latter method redirects the - * event to any ActionListener objects that have + * {@code processActionEvent}. The latter method redirects the + * event to any {@code ActionListener} objects that have * registered to receive action events generated by this * text field. * @@ -112,7 +112,7 @@ public class TextField extends TextComponent { * The echo character, which is used when * the user wishes to disguise the characters * typed into the text field. - * The disguises are removed if echoChar = 0. + * The disguises are removed if echoChar = {@code 0}. * * @serial * @see #getEchoChar() @@ -157,8 +157,8 @@ public class TextField extends TextComponent { /** * Constructs a new text field initialized with the specified text. * @param text the text to be displayed. If - * text is null, the empty - * string "" will be displayed. + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -172,8 +172,8 @@ public class TextField extends TextComponent { * of columns. A column is an approximate average character * width that is platform-dependent. * @param columns the number of columns. If - * columns is less than 0, - * columns is set to 0. + * {@code columns} is less than {@code 0}, + * {@code columns} is set to {@code 0}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -188,11 +188,11 @@ public class TextField extends TextComponent { * number of columns. A column is an approximate average character * width that is platform-dependent. * @param text the text to be displayed. If - * text is null, the empty - * string "" will be displayed. + * {@code text} is {@code null}, the empty + * string {@code ""} will be displayed. * @param columns the number of columns. If - * columns is less than 0, - * columns is set to 0. + * {@code columns} is less than {@code 0}, + * {@code columns} is set to {@code 0}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true. * @see java.awt.GraphicsEnvironment#isHeadless @@ -230,7 +230,7 @@ public class TextField extends TextComponent { * An echo character is useful for text fields where * user input should not be echoed to the screen, as in * the case of a text field for entering a password. - * If echoChar = 0, user + * If {@code echoChar} = {@code 0}, user * input is echoed to the screen unchanged. *

            * A Java platform implementation may support only a limited, @@ -252,7 +252,7 @@ public class TextField extends TextComponent { * An echo character is useful for text fields where * user input should not be echoed to the screen, as in * the case of a text field for entering a password. - * Setting echoChar = 0 allows + * Setting {@code echoChar} = {@code 0} allows * user input to be echoed to the screen again. *

            * A Java platform implementation may support only a limited, @@ -277,7 +277,7 @@ public class TextField extends TextComponent { * @param c the echo character for this text field * * @deprecated As of JDK version 1.1, - * replaced by setEchoChar(char). + * replaced by {@code setEchoChar(char)}. */ @Deprecated public synchronized void setEchoCharacter(char c) { @@ -329,9 +329,9 @@ public class TextField extends TextComponent { * An echo character is useful for text fields where * user input should not be echoed to the screen, as in * the case of a text field for entering a password. - * @return true if this text field has + * @return {@code true} if this text field has * a character set for echoing; - * false otherwise. + * {@code false} otherwise. * @see java.awt.TextField#setEchoChar * @see java.awt.TextField#getEchoChar */ @@ -356,8 +356,8 @@ public class TextField extends TextComponent { * @param columns the number of columns. * @see java.awt.TextField#getColumns * @exception IllegalArgumentException if the value - * supplied for columns - * is less than 0. + * supplied for {@code columns} + * is less than {@code 0}. * @since 1.1 */ public void setColumns(int columns) { @@ -398,7 +398,7 @@ public class TextField extends TextComponent { * @return the preferred size for the text field * * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(int). + * replaced by {@code getPreferredSize(int)}. */ @Deprecated public Dimension preferredSize(int columns) { @@ -422,7 +422,7 @@ public class TextField extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getPreferredSize(). + * replaced by {@code getPreferredSize()}. */ @Deprecated public Dimension preferredSize() { @@ -452,7 +452,7 @@ public class TextField extends TextComponent { * @param columns the number of columns * @return the minimum size for this text field * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(int). + * replaced by {@code getMinimumSize(int)}. */ @Deprecated public Dimension minimumSize(int columns) { @@ -476,7 +476,7 @@ public class TextField extends TextComponent { /** * @deprecated As of JDK version 1.1, - * replaced by getMinimumSize(). + * replaced by {@code getMinimumSize()}. */ @Deprecated public Dimension minimumSize() { @@ -532,7 +532,7 @@ public class TextField extends TextComponent { * Returns an array of all the action listeners * registered on this textfield. * - * @return all of this textfield's ActionListeners + * @return all of this textfield's {@code ActionListener}s * or an empty array if no action * listeners are currently registered * @@ -548,16 +548,16 @@ public class TextField extends TextComponent { /** * Returns an array of all the objects currently registered * as FooListeners - * upon this TextField. + * upon this {@code TextField}. * FooListeners are registered using the * addFooListener method. * *

            - * You can specify the listenerType argument + * You can specify the {@code listenerType} argument * with a class literal, such as * FooListener.class. * For example, you can query a - * TextField t + * {@code TextField t} * for its action listeners with the following code: * *

            ActionListener[] als = (ActionListener[])(t.getListeners(ActionListener.class));
            @@ -566,14 +566,14 @@ public class TextField extends TextComponent { * * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this textfield, * or an empty array if no such * listeners have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getActionListeners * @since 1.3 @@ -602,11 +602,11 @@ public class TextField extends TextComponent { /** * Processes events on this text field. If the event - * is an instance of ActionEvent, - * it invokes the processActionEvent - * method. Otherwise, it invokes processEvent + * is an instance of {@code ActionEvent}, + * it invokes the {@code processActionEvent} + * method. Otherwise, it invokes {@code processEvent} * on the superclass. - *

            Note that if the event parameter is null + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -626,17 +626,17 @@ public class TextField extends TextComponent { /** * Processes action events occurring on this text field by * dispatching them to any registered - * ActionListener objects. + * {@code ActionListener} objects. *

            * This method is not called unless action events are * enabled for this component. Action events are enabled * when one of the following occurs: *

              - *
            • An ActionListener object is registered - * via addActionListener. - *
            • Action events are enabled via enableEvents. + *
            • An {@code ActionListener} object is registered + * via {@code addActionListener}. + *
            • Action events are enabled via {@code enableEvents}. *
            - *

            Note that if the event parameter is null + *

            Note that if the event parameter is {@code null} * the behavior is unspecified and may result in an * exception. * @@ -654,11 +654,11 @@ public class TextField extends TextComponent { } /** - * Returns a string representing the state of this TextField. + * Returns a string representing the state of this {@code TextField}. * This method is intended to be used only for debugging purposes, and the * content and format of the returned string may vary between * implementations. The returned string may be empty but may not be - * null. + * {@code null}. * * @return the parameter string of this text field */ @@ -712,8 +712,8 @@ public class TextField extends TextComponent { * ignored. * * @exception HeadlessException if - * GraphicsEnvironment.isHeadless() returns - * true + * {@code GraphicsEnvironment.isHeadless()} returns + * {@code true} * @see #removeActionListener(ActionListener) * @see #addActionListener(ActionListener) * @see java.awt.GraphicsEnvironment#isHeadless @@ -769,7 +769,7 @@ public class TextField extends TextComponent { /** * This class implements accessibility support for the - * TextField class. It provides an implementation of the + * {@code TextField} class. It provides an implementation of the * Java Accessibility API appropriate to text field user-interface elements. * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java b/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java index 8333965b114..387e5612984 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TexturePaint.java @@ -31,18 +31,18 @@ import java.awt.image.BufferedImage; import java.awt.image.ColorModel; /** - * The TexturePaint class provides a way to fill a + * The {@code TexturePaint} class provides a way to fill a * {@link Shape} with a texture that is specified as - * a {@link BufferedImage}. The size of the BufferedImage - * object should be small because the BufferedImage data - * is copied by the TexturePaint object. + * a {@link BufferedImage}. The size of the {@code BufferedImage} + * object should be small because the {@code BufferedImage} data + * is copied by the {@code TexturePaint} object. * At construction time, the texture is anchored to the upper * left corner of a {@link Rectangle2D} that is * specified in user space. Texture is computed for * locations in the device space by conceptually replicating the - * specified Rectangle2D infinitely in all directions - * in user space and mapping the BufferedImage to each - * replicated Rectangle2D. + * specified {@code Rectangle2D} infinitely in all directions + * in user space and mapping the {@code BufferedImage} to each + * replicated {@code Rectangle2D}. * @see Paint * @see Graphics2D#setPaint * @version 1.48, 06/05/07 @@ -57,10 +57,10 @@ public class TexturePaint implements Paint { double sy; /** - * Constructs a TexturePaint object. - * @param txtr the BufferedImage object with the texture + * Constructs a {@code TexturePaint} object. + * @param txtr the {@code BufferedImage} object with the texture * used for painting - * @param anchor the Rectangle2D in user space used to + * @param anchor the {@code Rectangle2D} in user space used to * anchor and replicate the texture */ public TexturePaint(BufferedImage txtr, @@ -73,9 +73,9 @@ public class TexturePaint implements Paint { } /** - * Returns the BufferedImage texture used to + * Returns the {@code BufferedImage} texture used to * fill the shapes. - * @return a BufferedImage. + * @return a {@code BufferedImage}. */ public BufferedImage getImage() { return bufImg; @@ -84,8 +84,8 @@ public class TexturePaint implements Paint { /** * Returns a copy of the anchor rectangle which positions and * sizes the textured image. - * @return the Rectangle2D used to anchor and - * size this TexturePaint. + * @return the {@code Rectangle2D} used to anchor and + * size this {@code TexturePaint}. */ public Rectangle2D getAnchorRect() { return new Rectangle2D.Double(tx, ty, @@ -139,8 +139,8 @@ public class TexturePaint implements Paint { } /** - * Returns the transparency mode for this TexturePaint. - * @return the transparency mode for this TexturePaint + * Returns the transparency mode for this {@code TexturePaint}. + * @return the transparency mode for this {@code TexturePaint} * as an integer value. * @see Transparency */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java index ee020270f19..663a6c72a1b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Toolkit.java @@ -69,7 +69,7 @@ import javax.accessibility.AccessibilityProvider; /** * This class is the abstract superclass of all actual * implementations of the Abstract Window Toolkit. Subclasses of - * the Toolkit class are used to bind the various components + * the {@code Toolkit} class are used to bind the various components * to particular native toolkit implementations. *

            * Many GUI events may be delivered to user @@ -82,8 +82,8 @@ import javax.accessibility.AccessibilityProvider; * limited to: *

              *
            • Scrolling to a specified position. - *
              For example, calling ScrollPane.setScrollPosition - * and then getScrollPosition may return an incorrect + *
              For example, calling {@code ScrollPane.setScrollPosition} + * and then {@code getScrollPosition} may return an incorrect * value if the original request has not yet been processed. * *
            • Moving the focus from one component to another. @@ -94,25 +94,25 @@ import javax.accessibility.AccessibilityProvider; * Tutorial. * *
            • Making a top-level container visible. - *
              Calling setVisible(true) on a Window, - * Frame or Dialog may occur + *
              Calling {@code setVisible(true)} on a {@code Window}, + * {@code Frame} or {@code Dialog} may occur * asynchronously. * *
            • Setting the size or location of a top-level container. - *
              Calls to setSize, setBounds or - * setLocation on a Window, - * Frame or Dialog are forwarded + *
              Calls to {@code setSize}, {@code setBounds} or + * {@code setLocation} on a {@code Window}, + * {@code Frame} or {@code Dialog} are forwarded * to the underlying window management system and may be * ignored or modified. See {@link java.awt.Window} for * more information. *
            *

            * Most applications should not call any of the methods in this - * class directly. The methods defined by Toolkit are + * class directly. The methods defined by {@code Toolkit} are * the "glue" that joins the platform-independent classes in the - * java.awt package with their counterparts in - * java.awt.peer. Some methods defined by - * Toolkit query the native operating system directly. + * {@code java.awt} package with their counterparts in + * {@code java.awt.peer}. Some methods defined by + * {@code Toolkit} query the native operating system directly. * * @author Sami Shaio * @author Arthur van Hoff @@ -247,8 +247,8 @@ public abstract class Toolkit { /** * Gets the size of the screen. On systems with multiple displays, the * primary display is used. Multi-screen aware display dimensions are - * available from GraphicsConfiguration and - * GraphicsDevice. + * available from {@code GraphicsConfiguration} and + * {@code GraphicsDevice}. * @return the size of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -271,7 +271,7 @@ public abstract class Toolkit { /** * Gets the insets of the screen. - * @param gc a GraphicsConfiguration + * @param gc a {@code GraphicsConfiguration} * @return the insets of this toolkit's screen, in pixels. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -291,14 +291,14 @@ public abstract class Toolkit { /** * Determines the color model of this toolkit's screen. *

            - * ColorModel is an abstract class that + * {@code ColorModel} is an abstract class that * encapsulates the ability to translate between the * pixel values of an image and its red, green, blue, * and alpha components. *

            * This toolkit method is called by the - * getColorModel method - * of the Component class. + * {@code getColorModel} method + * of the {@code Component} class. * @return the color model of this toolkit's screen. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -332,8 +332,8 @@ public abstract class Toolkit { * Gets the screen device metrics for rendering of the font. * @param font a font * @return the screen metrics of the specified font in this toolkit - * @deprecated As of JDK version 1.2, replaced by the Font - * method getLineMetrics. + * @deprecated As of JDK version 1.2, replaced by the {@code Font} + * method {@code getLineMetrics}. * @see java.awt.font.LineMetrics * @see java.awt.Font#getLineMetrics * @see java.awt.GraphicsEnvironment#getScreenDevices @@ -606,22 +606,22 @@ public abstract class Toolkit { * with the same filename to the same returned Image. *

            * Since the mechanism required to facilitate this sharing of - * Image objects may continue to hold onto images + * {@code Image} objects may continue to hold onto images * that are no longer in use for an indefinite period of time, * developers are encouraged to implement their own caching of * images by using the {@link #createImage(java.lang.String) createImage} * variant wherever available. * If the image data contained in the specified file changes, - * the Image object returned from this method may + * the {@code Image} object returned from this method may * still contain stale information which was loaded from the * file after a prior call. * Previously loaded image data can be manually discarded by * calling the {@link Image#flush flush} method on the - * returned Image. + * returned {@code Image}. *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkRead method with the file specified to ensure + * {@code checkRead} method with the file specified to ensure * that the access to the image is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. @@ -641,27 +641,27 @@ public abstract class Toolkit { * with the same URL to the same returned Image. *

            * Since the mechanism required to facilitate this sharing of - * Image objects may continue to hold onto images + * {@code Image} objects may continue to hold onto images * that are no longer in use for an indefinite period of time, * developers are encouraged to implement their own caching of * images by using the {@link #createImage(java.net.URL) createImage} * variant wherever available. * If the image data stored at the specified URL changes, - * the Image object returned from this method may + * the {@code Image} object returned from this method may * still contain stale information which was fetched from the * URL after a prior call. * Previously loaded image data can be manually discarded by * calling the {@link Image#flush flush} method on the - * returned Image. + * returned {@code Image}. *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkPermission method with the + * {@code checkPermission} method with the * url.openConnection().getPermission() permission to ensure * that the access to the image is allowed. For compatibility * with pre-1.2 security managers, if the access is denied with - * FilePermission or SocketPermission, - * the method throws the SecurityException + * {@code FilePermission} or {@code SocketPermission}, + * the method throws the {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. @@ -681,7 +681,7 @@ public abstract class Toolkit { *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkRead method with the specified file to ensure + * {@code checkRead} method with the specified file to ensure * that the image creation is allowed. * @param filename the name of a file containing pixel data * in a recognized file format. @@ -700,12 +700,12 @@ public abstract class Toolkit { *

            * This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * checkPermission method with the + * {@code checkPermission} method with the * url.openConnection().getPermission() permission to ensure * that the image creation is allowed. For compatibility * with pre-1.2 security managers, if the access is denied with - * FilePermission or SocketPermission, - * the method throws SecurityException + * {@code FilePermission} or {@code SocketPermission}, + * the method throws {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. * @param url the URL to use in fetching the pixel data. @@ -722,7 +722,7 @@ public abstract class Toolkit { * Prepares an image for rendering. *

            * If the values of the width and height arguments are both - * -1, this method prepares the image for rendering + * {@code -1}, this method prepares the image for rendering * on the default screen; otherwise, this method prepares an image * for rendering on the default screen at the specified width and height. *

            @@ -730,23 +730,23 @@ public abstract class Toolkit { * and an appropriately scaled screen representation of the image is * generated. *

            - * This method is called by components prepareImage + * This method is called by components {@code prepareImage} * methods. *

            * Information on the flags returned by this method can be found - * with the definition of the ImageObserver interface. + * with the definition of the {@code ImageObserver} interface. * @param image the image for which to prepare a * screen representation. * @param width the width of the desired screen - * representation, or -1. + * representation, or {@code -1}. * @param height the height of the desired screen - * representation, or -1. - * @param observer the ImageObserver + * representation, or {@code -1}. + * @param observer the {@code ImageObserver} * object to be notified as the * image is being prepared. - * @return true if the image has already been - * fully prepared; false otherwise. + * @return {@code true} if the image has already been + * fully prepared; {@code false} otherwise. * @see java.awt.Component#prepareImage(java.awt.Image, * java.awt.image.ImageObserver) * @see java.awt.Component#prepareImage(java.awt.Image, @@ -761,30 +761,30 @@ public abstract class Toolkit { * being prepared for display. *

            * If the values of the width and height arguments are both - * -1, this method returns the construction status of + * {@code -1}, this method returns the construction status of * a screen representation of the specified image in this toolkit. * Otherwise, this method returns the construction status of a * scaled representation of the image at the specified width * and height. *

            * This method does not cause the image to begin loading. - * An application must call prepareImage to force + * An application must call {@code prepareImage} to force * the loading of an image. *

            - * This method is called by the component's checkImage + * This method is called by the component's {@code checkImage} * methods. *

            * Information on the flags returned by this method can be found - * with the definition of the ImageObserver interface. + * with the definition of the {@code ImageObserver} interface. * @param image the image whose status is being checked. * @param width the width of the scaled version whose status is - * being checked, or -1. + * being checked, or {@code -1}. * @param height the height of the scaled version whose status - * is being checked, or -1. - * @param observer the ImageObserver object to be + * is being checked, or {@code -1}. + * @param observer the {@code ImageObserver} object to be * notified as the image is being prepared. * @return the bitwise inclusive OR of the - * ImageObserver flags for the + * {@code ImageObserver} flags for the * image data that is currently available. * @see java.awt.Toolkit#prepareImage(java.awt.Image, * int, int, java.awt.image.ImageObserver) @@ -840,17 +840,17 @@ public abstract class Toolkit { int imagelength); /** - * Gets a PrintJob object which is the result of initiating + * Gets a {@code PrintJob} object which is the result of initiating * a print operation on the toolkit's platform. *

            * Each actual implementation of this method should first check if there * is a security manager installed. If there is, the method should call - * the security manager's checkPrintJobAccess method to + * the security manager's {@code checkPrintJobAccess} method to * ensure initiation of a print operation is allowed. If the default - * implementation of checkPrintJobAccess is used (that is, + * implementation of {@code checkPrintJobAccess} is used (that is, * that method is not overriden), then this results in a call to the - * security manager's checkPermission method with a - * RuntimePermission("queuePrintJob") permission. + * security manager's {@code checkPermission} method with a + * {@code RuntimePermission("queuePrintJob")} permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent @@ -862,7 +862,7 @@ public abstract class Toolkit { * takes JobAttributes and PageAttributes objects. This object * may be updated to reflect the user's job choices on exit. May * be null. - * @return a PrintJob object, or null if the + * @return a {@code PrintJob} object, or {@code null} if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws SecurityException if this thread is not allowed to initiate a @@ -876,17 +876,17 @@ public abstract class Toolkit { Properties props); /** - * Gets a PrintJob object which is the result of initiating + * Gets a {@code PrintJob} object which is the result of initiating * a print operation on the toolkit's platform. *

            * Each actual implementation of this method should first check if there * is a security manager installed. If there is, the method should call - * the security manager's checkPrintJobAccess method to + * the security manager's {@code checkPrintJobAccess} method to * ensure initiation of a print operation is allowed. If the default - * implementation of checkPrintJobAccess is used (that is, + * implementation of {@code checkPrintJobAccess} is used (that is, * that method is not overriden), then this results in a call to the - * security manager's checkPermission method with a - * RuntimePermission("queuePrintJob") permission. + * security manager's {@code checkPermission} method with a + * {@code RuntimePermission("queuePrintJob")} permission. * * @param frame the parent of the print dialog. May not be null. * @param jobtitle the title of the PrintJob. A null title is equivalent @@ -900,7 +900,7 @@ public abstract class Toolkit { * job. The attributes will be updated to reflect the user's * choices as outlined in the PageAttributes documentation. May be * null. - * @return a PrintJob object, or null if the + * @return a {@code PrintJob} object, or {@code null} if the * user cancelled the print job. * @throws NullPointerException if frame is null * @throws IllegalArgumentException if pageAttributes specifies differing @@ -952,20 +952,20 @@ public abstract class Toolkit { * applications which use native clipboard facilities. *

            * In addition to any and all default formats text returned by the system - * Clipboard's getTransferData() method is available in the + * Clipboard's {@code getTransferData()} method is available in the * following flavors: *

              *
            • DataFlavor.stringFlavor
            • *
            • DataFlavor.plainTextFlavor (deprecated)
            • *
            - * As with java.awt.datatransfer.StringSelection, if the - * requested flavor is DataFlavor.plainTextFlavor, or an + * As with {@code java.awt.datatransfer.StringSelection}, if the + * requested flavor is {@code DataFlavor.plainTextFlavor}, or an * equivalent flavor, a Reader is returned. Note: The behavior of - * the system Clipboard's getTransferData() method for - * DataFlavor.plainTextFlavor, and equivalent DataFlavors, is - * inconsistent with the definition of DataFlavor.plainTextFlavor - * . Because of this, support for - * DataFlavor.plainTextFlavor, and equivalent flavors, is + * the system Clipboard's {@code getTransferData()} method for + * {@code DataFlavor.plainTextFlavor}, and equivalent DataFlavors, is + * inconsistent with the definition of {@code DataFlavor.plainTextFlavor}. + * Because of this, support for + * {@code DataFlavor.plainTextFlavor}, and equivalent flavors, is * deprecated. *

            * Each actual implementation of this method should first check if there @@ -990,37 +990,37 @@ public abstract class Toolkit { /** * Gets the singleton instance of the system selection as a - * Clipboard object. This allows an application to read and + * {@code Clipboard} object. This allows an application to read and * modify the current, system-wide selection. *

            * An application is responsible for updating the system selection whenever * the user selects text, using either the mouse or the keyboard. * Typically, this is implemented by installing a - * FocusListener on all Components which support - * text selection, and, between FOCUS_GAINED and - * FOCUS_LOST events delivered to that Component, - * updating the system selection Clipboard when the selection - * changes inside the Component. Properly updating the system + * {@code FocusListener} on all {@code Component}s which support + * text selection, and, between {@code FOCUS_GAINED} and + * {@code FOCUS_LOST} events delivered to that {@code Component}, + * updating the system selection {@code Clipboard} when the selection + * changes inside the {@code Component}. Properly updating the system * selection ensures that a Java application will interact correctly with * native applications and other Java applications running simultaneously - * on the system. Note that java.awt.TextComponent and - * javax.swing.text.JTextComponent already adhere to this + * on the system. Note that {@code java.awt.TextComponent} and + * {@code javax.swing.text.JTextComponent} already adhere to this * policy. When using these classes, and their subclasses, developers need * not write any additional code. *

            - * Some platforms do not support a system selection Clipboard. - * On those platforms, this method will return null. In such a + * Some platforms do not support a system selection {@code Clipboard}. + * On those platforms, this method will return {@code null}. In such a * case, an application is absolved from its responsibility to update the - * system selection Clipboard as described above. + * system selection {@code Clipboard} as described above. *

            * Each actual implementation of this method should first check if there * is a security manager installed. If there is, the method should call * the security manager's {@link SecurityManager#checkPermission * checkPermission} method to check {@code AWTPermission("accessClipboard")}. * - * @return the system selection as a Clipboard, or - * null if the native platform does not support a - * system selection Clipboard + * @return the system selection as a {@code Clipboard}, or + * {@code null} if the native platform does not support a + * system selection {@code Clipboard} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @@ -1050,13 +1050,13 @@ public abstract class Toolkit { * key for menu shortcuts. *

            * Menu shortcuts, which are embodied in the - * MenuShortcut class, are handled by the - * MenuBar class. + * {@code MenuShortcut} class, are handled by the + * {@code MenuBar} class. *

            - * By default, this method returns Event.CTRL_MASK. + * By default, this method returns {@code Event.CTRL_MASK}. * Toolkit implementations should override this method if the * Control key isn't the correct key for accelerators. - * @return the modifier mask on the Event class + * @return the modifier mask on the {@code Event} class * that is used for menu shortcuts on this toolkit. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -1083,7 +1083,7 @@ public abstract class Toolkit { * @param keyCode the key code * @return {@code true} if the given key is currently in its "on" state; * otherwise {@code false} - * @exception java.lang.IllegalArgumentException if keyCode + * @exception java.lang.IllegalArgumentException if {@code keyCode} * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow getting the state of this key programmatically, or if the keyboard @@ -1119,7 +1119,7 @@ public abstract class Toolkit { * * @param keyCode the key code * @param on the state of the key - * @exception java.lang.IllegalArgumentException if keyCode + * @exception java.lang.IllegalArgumentException if {@code keyCode} * is not one of the valid key codes * @exception java.lang.UnsupportedOperationException if the host system doesn't * allow setting the state of this key programmatically, or if the keyboard @@ -1163,7 +1163,7 @@ public abstract class Toolkit { * @param cursor the image to display when the cursor is activated * @param hotSpot the X and Y of the large cursor's hot spot; the * hotSpot values must be less than the Dimension returned by - * getBestCursorSize + * {@code getBestCursorSize} * @param name a localized description of the cursor, for Java Accessibility use * @exception IndexOutOfBoundsException if the hotSpot values are outside * the bounds of the cursor @@ -1252,10 +1252,10 @@ public abstract class Toolkit { /** * Returns whether Toolkit supports this state for - * Frames. This method tells whether the UI + * {@code Frame}s. This method tells whether the UI * concept of, say, maximization or iconification is * supported. It will always return false for "compound" states - * like Frame.ICONIFIED|Frame.MAXIMIZED_VERT. + * like {@code Frame.ICONIFIED|Frame.MAXIMIZED_VERT}. * In other words, the rule of thumb is that only queries with a * single frame state constant as an argument are meaningful. *

            Note that supporting a given concept is a platform- @@ -1280,11 +1280,11 @@ public abstract class Toolkit { *

          * * @param state one of named frame state constants. - * @return true is this frame state is supported by - * this Toolkit implementation, false otherwise. + * @return {@code true} is this frame state is supported by + * this Toolkit implementation, {@code false} otherwise. * @exception HeadlessException - * if GraphicsEnvironment.isHeadless() - * returns true. + * if {@code GraphicsEnvironment.isHeadless()} + * returns {@code true}. * @see java.awt.Window#addWindowStateListener * @since 1.4 */ @@ -1431,7 +1431,7 @@ public abstract class Toolkit { * {@link SecurityManager#checkPermission checkPermission} method * is called to check {@code AWTPermission("accessEventQueue")}. * - * @return the EventQueue object + * @return the {@code EventQueue} object * @throws SecurityException * if a security manager is set and it denies access to * the {@code EventQueue} @@ -1446,10 +1446,10 @@ public abstract class Toolkit { } /** - * Gets the application's or applet's EventQueue + * Gets the application's or applet's {@code EventQueue} * instance, without checking access. For security reasons, - * this can only be called from a Toolkit subclass. - * @return the EventQueue object + * this can only be called from a {@code Toolkit} subclass. + * @return the {@code EventQueue} object */ protected abstract EventQueue getSystemEventQueueImpl(); @@ -1664,8 +1664,8 @@ public abstract class Toolkit { * Returns whether the always-on-top mode is supported by this toolkit. * To detect whether the always-on-top mode is supported for a * particular Window, use {@link Window#isAlwaysOnTopSupported}. - * @return true, if current toolkit supports the always-on-top mode, - * otherwise returns false + * @return {@code true}, if current toolkit supports the always-on-top mode, + * otherwise returns {@code false} * @see Window#isAlwaysOnTopSupported * @see Window#setAlwaysOnTop(boolean) * @since 1.6 @@ -1677,12 +1677,12 @@ public abstract class Toolkit { /** * Returns whether the given modality type is supported by this toolkit. If * a dialog with unsupported modality type is created, then - * Dialog.ModalityType.MODELESS is used instead. + * {@code Dialog.ModalityType.MODELESS} is used instead. * * @param modalityType modality type to be checked for support by this toolkit * - * @return true, if current toolkit supports given modality - * type, false otherwise + * @return {@code true}, if current toolkit supports given modality + * type, {@code false} otherwise * * @see java.awt.Dialog.ModalityType * @see java.awt.Dialog#getModalityType @@ -1695,12 +1695,12 @@ public abstract class Toolkit { /** * Returns whether the given modal exclusion type is supported by this * toolkit. If an unsupported modal exclusion type property is set on a window, - * then Dialog.ModalExclusionType.NO_EXCLUDE is used instead. + * then {@code Dialog.ModalExclusionType.NO_EXCLUDE} is used instead. * * @param modalExclusionType modal exclusion type to be checked for support by this toolkit * - * @return true, if current toolkit supports given modal exclusion - * type, false otherwise + * @return {@code true}, if current toolkit supports given modal exclusion + * type, {@code false} otherwise * * @see java.awt.Dialog.ModalExclusionType * @see java.awt.Window#getModalExclusionType @@ -1739,16 +1739,16 @@ public abstract class Toolkit { /** * Adds an AWTEventListener to receive all AWTEvents dispatched - * system-wide that conform to the given eventMask. + * system-wide that conform to the given {@code eventMask}. *

          - * First, if there is a security manager, its checkPermission + * First, if there is a security manager, its {@code checkPermission} * method is called with an - * AWTPermission("listenToAllAWTEvents") permission. + * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. *

          - * eventMask is a bitmask of event types to receive. + * {@code eventMask} is a bitmask of event types to receive. * It is constructed by bitwise OR-ing together the event masks - * defined in AWTEvent. + * defined in {@code AWTEvent}. *

          * Note: event listener use is not recommended for normal * application use, but are intended solely to support special @@ -1761,7 +1761,7 @@ public abstract class Toolkit { * @param eventMask the bitmask of event types to receive * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #removeAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission @@ -1815,9 +1815,9 @@ public abstract class Toolkit { /** * Removes an AWTEventListener from receiving dispatched AWTEvents. *

          - * First, if there is a security manager, its checkPermission + * First, if there is a security manager, its {@code checkPermission} * method is called with an - * AWTPermission("listenToAllAWTEvents") permission. + * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. *

          * Note: event listener use is not recommended for normal @@ -1830,7 +1830,7 @@ public abstract class Toolkit { * @param listener the event listener. * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #getAWTEventListeners * @see SecurityManager#checkPermission @@ -1884,23 +1884,23 @@ public abstract class Toolkit { return calls[ci]; } /** - * Returns an array of all the AWTEventListeners + * Returns an array of all the {@code AWTEventListener}s * registered on this toolkit. * If there is a security manager, its {@code checkPermission} * method is called with an * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned - * within AWTEventListenerProxy objects, which also contain + * within {@code AWTEventListenerProxy} objects, which also contain * the event mask for the given listener. * Note that listener objects * added multiple times appear only once in the returned array. * - * @return all of the AWTEventListeners or an empty + * @return all of the {@code AWTEventListener}s or an empty * array if no listeners are currently registered * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission @@ -1932,7 +1932,7 @@ public abstract class Toolkit { } /** - * Returns an array of all the AWTEventListeners + * Returns an array of all the {@code AWTEventListener}s * registered on this toolkit which listen to all of the event * types specified in the {@code eventMask} argument. * If there is a security manager, its {@code checkPermission} @@ -1940,19 +1940,19 @@ public abstract class Toolkit { * {@code AWTPermission("listenToAllAWTEvents")} permission. * This may result in a SecurityException. * Listeners can be returned - * within AWTEventListenerProxy objects, which also contain + * within {@code AWTEventListenerProxy} objects, which also contain * the event mask for the given listener. * Note that listener objects * added multiple times appear only once in the returned array. * * @param eventMask the bitmask of event types to listen for - * @return all of the AWTEventListeners registered + * @return all of the {@code AWTEventListener}s registered * on this toolkit for the specified * event types, or an empty array if no such listeners * are currently registered * @throws SecurityException * if a security manager exists and its - * checkPermission method doesn't allow the operation. + * {@code checkPermission} method doesn't allow the operation. * @see #addAWTEventListener * @see #removeAWTEventListener * @see SecurityManager#checkPermission @@ -2167,9 +2167,9 @@ public abstract class Toolkit { * The style field of the input method highlight is ignored. The map * returned is unmodifiable. * @param highlight input method highlight - * @return style attribute map, or null + * @return style attribute map, or {@code null} * @exception HeadlessException if - * GraphicsEnvironment.isHeadless returns true + * {@code GraphicsEnvironment.isHeadless} returns true * @see java.awt.GraphicsEnvironment#isHeadless * @since 1.3 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/Transparency.java b/jdk/src/java.desktop/share/classes/java/awt/Transparency.java index 42b87caa4c5..6cdeb111ecc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Transparency.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Transparency.java @@ -28,7 +28,7 @@ package java.awt; import java.lang.annotation.Native; /** - * The Transparency interface defines the common transparency + * The {@code Transparency} interface defines the common transparency * modes for implementing classes. */ public interface Transparency { @@ -53,8 +53,8 @@ public interface Transparency { @Native public static final int TRANSLUCENT = 3; /** - * Returns the type of this Transparency. - * @return the field type of this Transparency, which is + * Returns the type of this {@code Transparency}. + * @return the field type of this {@code Transparency}, which is * either OPAQUE, BITMASK or TRANSLUCENT. */ public int getTransparency(); diff --git a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java index 3c7182afcfa..08ad08d8820 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java +++ b/jdk/src/java.desktop/share/classes/java/awt/TrayIcon.java @@ -36,32 +36,32 @@ import java.security.AccessControlContext; import java.security.AccessController; /** - * A TrayIcon object represents a tray icon that can be + * A {@code TrayIcon} object represents a tray icon that can be * added to the {@link SystemTray system tray}. A - * TrayIcon can have a tooltip (text), an image, a popup + * {@code TrayIcon} can have a tooltip (text), an image, a popup * menu, and a set of listeners associated with it. * - *

          A TrayIcon can generate various {@link MouseEvent + *

          A {@code TrayIcon} can generate various {@link MouseEvent * MouseEvents} and supports adding corresponding listeners to receive - * notification of these events. TrayIcon processes some + * notification of these events. {@code TrayIcon} processes some * of the events by itself. For example, by default, when the - * right-mouse click is performed on the TrayIcon it + * right-mouse click is performed on the {@code TrayIcon} it * displays the specified popup menu. When the mouse hovers - * over the TrayIcon the tooltip is displayed. + * over the {@code TrayIcon} the tooltip is displayed. * - *

          Note: When the MouseEvent is - * dispatched to its registered listeners its component - * property will be set to null. (See {@link + *

          Note: When the {@code MouseEvent} is + * dispatched to its registered listeners its {@code component} + * property will be set to {@code null}. (See {@link * java.awt.event.ComponentEvent#getComponent}) The - * source property will be set to this - * TrayIcon. (See {@link + * {@code source} property will be set to this + * {@code TrayIcon}. (See {@link * java.util.EventObject#getSource}) * *

          Note: A well-behaved {@link TrayIcon} implementation * will assign different gestures to showing a popup menu and * selecting a tray icon. * - *

          A TrayIcon can generate an {@link ActionEvent + *

          A {@code TrayIcon} can generate an {@link ActionEvent * ActionEvent}. On some platforms, this occurs when the user selects * the tray icon using either the mouse or keyboard. * @@ -71,7 +71,7 @@ import java.security.AccessController; * SecurityException. * *

          See the {@link SystemTray} class overview for an example on how - * to use the TrayIcon API. + * to use the {@code TrayIcon} API. * * @since 1.6 * @see SystemTray#add @@ -147,11 +147,11 @@ public class TrayIcon { } /** - * Creates a TrayIcon with the specified image. + * Creates a {@code TrayIcon} with the specified image. * - * @param image the Image to be used - * @throws IllegalArgumentException if image is - * null + * @param image the {@code Image} to be used + * @throws IllegalArgumentException if {@code image} is + * {@code null} * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if @@ -173,14 +173,14 @@ public class TrayIcon { } /** - * Creates a TrayIcon with the specified image and + * Creates a {@code TrayIcon} with the specified image and * tooltip text. * - * @param image the Image to be used + * @param image the {@code Image} to be used * @param tooltip the string to be used as tooltip text; if the - * value is null no tooltip is shown - * @throws IllegalArgumentException if image is - * null + * value is {@code null} no tooltip is shown + * @throws IllegalArgumentException if {@code image} is + * {@code null} * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if @@ -199,15 +199,15 @@ public class TrayIcon { } /** - * Creates a TrayIcon with the specified image, + * Creates a {@code TrayIcon} with the specified image, * tooltip and popup menu. * - * @param image the Image to be used + * @param image the {@code Image} to be used * @param tooltip the string to be used as tooltip text; if the - * value is null no tooltip is shown + * value is {@code null} no tooltip is shown * @param popup the menu to be used for the tray icon's popup - * menu; if the value is null no popup menu is shown - * @throws IllegalArgumentException if image is null + * menu; if the value is {@code null} no popup menu is shown + * @throws IllegalArgumentException if {@code image} is {@code null} * @throws UnsupportedOperationException if the system tray isn't * supported by the current platform * @throws HeadlessException if @@ -229,7 +229,7 @@ public class TrayIcon { } /** - * Sets the image for this TrayIcon. The previous + * Sets the image for this {@code TrayIcon}. The previous * tray icon image is discarded without calling the {@link * java.awt.Image#flush} method — you will need to call it * manually. @@ -243,8 +243,8 @@ public class TrayIcon { *

          Calling this method with the same image that is currently * being used has no effect. * - * @throws NullPointerException if image is null - * @param image the non-null Image to be used + * @throws NullPointerException if {@code image} is {@code null} + * @param image the non-null {@code Image} to be used * @see #getImage * @see Image * @see SystemTray#add(TrayIcon) @@ -263,7 +263,7 @@ public class TrayIcon { } /** - * Returns the current image used for this TrayIcon. + * Returns the current image used for this {@code TrayIcon}. * * @return the image * @see #setImage(Image) @@ -274,13 +274,13 @@ public class TrayIcon { } /** - * Sets the popup menu for this TrayIcon. If - * popup is null, no popup menu will be - * associated with this TrayIcon. + * Sets the popup menu for this {@code TrayIcon}. If + * {@code popup} is {@code null}, no popup menu will be + * associated with this {@code TrayIcon}. * - *

          Note that this popup must not be added to any + *

          Note that this {@code popup} must not be added to any * parent before or after it is set on the tray icon. If you add - * it to some parent, the popup may be removed from + * it to some parent, the {@code popup} may be removed from * that parent. * *

          The {@code popup} can be set on one {@code TrayIcon} only. @@ -295,7 +295,7 @@ public class TrayIcon { * * @throws IllegalArgumentException if the {@code popup} is already * set for another {@code TrayIcon} - * @param popup a PopupMenu or null to + * @param popup a {@code PopupMenu} or {@code null} to * remove any popup menu * @see #getPopupMenu */ @@ -318,9 +318,9 @@ public class TrayIcon { } /** - * Returns the popup menu associated with this TrayIcon. + * Returns the popup menu associated with this {@code TrayIcon}. * - * @return the popup menu or null if none exists + * @return the popup menu or {@code null} if none exists * @see #setPopupMenu(PopupMenu) */ public PopupMenu getPopupMenu() { @@ -328,16 +328,16 @@ public class TrayIcon { } /** - * Sets the tooltip string for this TrayIcon. The + * Sets the tooltip string for this {@code TrayIcon}. The * tooltip is displayed automatically when the mouse hovers over - * the icon. Setting the tooltip to null removes any + * the icon. Setting the tooltip to {@code null} removes any * tooltip text. * * When displayed, the tooltip string may be truncated on some platforms; * the number of characters that may be displayed is platform-dependent. * * @param tooltip the string for the tooltip; if the value is - * null no tooltip is shown + * {@code null} no tooltip is shown * @see #getToolTip */ public void setToolTip(String tooltip) { @@ -351,9 +351,9 @@ public class TrayIcon { /** * Returns the tooltip string associated with this - * TrayIcon. + * {@code TrayIcon}. * - * @return the tooltip string or null if none exists + * @return the tooltip string or {@code null} if none exists * @see #setToolTip(String) */ public String getToolTip() { @@ -364,18 +364,18 @@ public class TrayIcon { * Sets the auto-size property. Auto-size determines whether the * tray image is automatically sized to fit the space allocated * for the image on the tray. By default, the auto-size property - * is set to false. + * is set to {@code false}. * - *

          If auto-size is false, and the image size + *

          If auto-size is {@code false}, and the image size * doesn't match the tray icon space, the image is painted as-is * inside that space — if larger than the allocated space, it will * be cropped. * - *

          If auto-size is true, the image is stretched or shrunk to + *

          If auto-size is {@code true}, the image is stretched or shrunk to * fit the tray icon space. * - * @param autosize true to auto-size the image, - * false otherwise + * @param autosize {@code true} to auto-size the image, + * {@code false} otherwise * @see #isImageAutoSize */ public void setImageAutoSize(boolean autosize) { @@ -390,8 +390,8 @@ public class TrayIcon { /** * Returns the value of the auto-size property. * - * @return true if the image will be auto-sized, - * false otherwise + * @return {@code true} if the image will be auto-sized, + * {@code false} otherwise * @see #setImageAutoSize(boolean) */ public boolean isImageAutoSize() { @@ -400,15 +400,15 @@ public class TrayIcon { /** * Adds the specified mouse listener to receive mouse events from - * this TrayIcon. Calling this method with a - * null value has no effect. + * this {@code TrayIcon}. Calling this method with a + * {@code null} value has no effect. * *

          Note: The {@code MouseEvent}'s coordinates (received * from the {@code TrayIcon}) are relative to the screen, not the * {@code TrayIcon}. * - *

          Note: The MOUSE_ENTERED and - * MOUSE_EXITED mouse events are not supported. + *

          Note: The {@code MOUSE_ENTERED} and + * {@code MOUSE_EXITED} mouse events are not supported. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -427,7 +427,7 @@ public class TrayIcon { /** * Removes the specified mouse listener. Calling this method with - * null or an invalid value has no effect. + * {@code null} or an invalid value has no effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -446,10 +446,10 @@ public class TrayIcon { /** * Returns an array of all the mouse listeners - * registered on this TrayIcon. + * registered on this {@code TrayIcon}. * - * @return all of the MouseListeners registered on - * this TrayIcon or an empty array if no mouse + * @return all of the {@code MouseListeners} registered on + * this {@code TrayIcon} or an empty array if no mouse * listeners are currently registered * * @see #addMouseListener(MouseListener) @@ -462,14 +462,14 @@ public class TrayIcon { /** * Adds the specified mouse listener to receive mouse-motion - * events from this TrayIcon. Calling this method - * with a null value has no effect. + * events from this {@code TrayIcon}. Calling this method + * with a {@code null} value has no effect. * *

          Note: The {@code MouseEvent}'s coordinates (received * from the {@code TrayIcon}) are relative to the screen, not the * {@code TrayIcon}. * - *

          Note: The MOUSE_DRAGGED mouse event is not supported. + *

          Note: The {@code MOUSE_DRAGGED} mouse event is not supported. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -488,7 +488,7 @@ public class TrayIcon { /** * Removes the specified mouse-motion listener. Calling this method with - * null or an invalid value has no effect. + * {@code null} or an invalid value has no effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -507,10 +507,10 @@ public class TrayIcon { /** * Returns an array of all the mouse-motion listeners - * registered on this TrayIcon. + * registered on this {@code TrayIcon}. * - * @return all of the MouseInputListeners registered on - * this TrayIcon or an empty array if no mouse + * @return all of the {@code MouseInputListeners} registered on + * this {@code TrayIcon} or an empty array if no mouse * listeners are currently registered * * @see #addMouseMotionListener(MouseMotionListener) @@ -524,7 +524,7 @@ public class TrayIcon { /** * Returns the command name of the action event fired by this tray icon. * - * @return the action command name, or null if none exists + * @return the action command name, or {@code null} if none exists * @see #addActionListener(ActionListener) * @see #setActionCommand(String) */ @@ -535,7 +535,7 @@ public class TrayIcon { /** * Sets the command name for the action event fired by this tray * icon. By default, this action command is set to - * null. + * {@code null}. * * @param command a string used to set the tray icon's * action command. @@ -549,12 +549,12 @@ public class TrayIcon { /** * Adds the specified action listener to receive - * ActionEvents from this TrayIcon. + * {@code ActionEvent}s from this {@code TrayIcon}. * Action events usually occur when a user selects the tray icon, * using either the mouse or keyboard. The conditions in which * action events are generated are platform-dependent. * - *

          Calling this method with a null value has no + *

          Calling this method with a {@code null} value has no * effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. @@ -574,7 +574,7 @@ public class TrayIcon { /** * Removes the specified action listener. Calling this method with - * null or an invalid value has no effect. + * {@code null} or an invalid value has no effect. *

          Refer to AWT Threading Issues for details on AWT's threading model. * @@ -594,10 +594,10 @@ public class TrayIcon { /** * Returns an array of all the action listeners - * registered on this TrayIcon. + * registered on this {@code TrayIcon}. * - * @return all of the ActionListeners registered on - * this TrayIcon or an empty array if no action + * @return all of the {@code ActionListeners} registered on + * this {@code TrayIcon} or an empty array if no action * listeners are currently registered * * @see #addActionListener(ActionListener) @@ -633,9 +633,9 @@ public class TrayIcon { * disappear after a time or if the user clicks on it. Clicking * on the message may trigger an {@code ActionEvent}. * - *

          Either the caption or the text may be null, but an - * NullPointerException is thrown if both are - * null. + *

          Either the caption or the text may be {@code null}, but an + * {@code NullPointerException} is thrown if both are + * {@code null}. * * When displayed, the caption or text strings may be truncated on * some platforms; the number of characters that may be displayed is @@ -645,12 +645,12 @@ public class TrayIcon { * showing a message. * * @param caption the caption displayed above the text, usually in - * bold; may be null + * bold; may be {@code null} * @param text the text displayed for the particular message; may be - * null + * {@code null} * @param messageType an enum indicating the message type - * @throws NullPointerException if both caption - * and text are null + * @throws NullPointerException if both {@code caption} + * and {@code text} are {@code null} */ public void displayMessage(String caption, String text, MessageType messageType) { if (caption == null && text == null) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/Window.java b/jdk/src/java.desktop/share/classes/java/awt/Window.java index 72fee8d1c9c..7ac8023acdd 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/Window.java +++ b/jdk/src/java.desktop/share/classes/java/awt/Window.java @@ -1926,7 +1926,7 @@ public class Window extends Container implements Accessible { * with a class literal, such as * FooListener.class. * For example, you can query a - * {@code Window} {@code w} + * {@code Window w} * for its window listeners with the following code: * *

          WindowListener[] wls = (WindowListener[])(w.getListeners(WindowListener.class));
          diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java b/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java index 08feedd844e..ca28f64be1a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ColorSpace.java @@ -268,7 +268,7 @@ public abstract class ColorSpace implements java.io.Serializable { /** * Constructs a ColorSpace object given a color space type * and the number of components. - * @param type one of the ColorSpace type constants + * @param type one of the {@code ColorSpace} type constants * @param numcomponents the number of components in the color space */ protected ColorSpace (int type, int numcomponents) { @@ -283,7 +283,7 @@ public abstract class ColorSpace implements java.io.Serializable { * @param colorspace a specific color space identified by one of * the predefined class constants (e.g. CS_sRGB, CS_LINEAR_RGB, * CS_CIEXYZ, CS_GRAY, or CS_PYCC) - * @return the requested ColorSpace object + * @return the requested {@code ColorSpace} object */ // NOTE: This method may be called by privileged threads. // DO NOT INVOKE CLIENT CODE ON THIS THREAD! @@ -366,8 +366,8 @@ public abstract class ColorSpace implements java.io.Serializable { /** * Returns true if the ColorSpace is CS_sRGB. - * @return true if this is a CS_sRGB color - * space, false if it is not + * @return {@code true} if this is a {@code CS_sRGB} color + * space, {@code false} if it is not */ public boolean isCS_sRGB () { /* REMIND - make sure we know sRGBspace exists already */ @@ -381,10 +381,10 @@ public abstract class ColorSpace implements java.io.Serializable { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of this color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of the CS_sRGB color space to + * {@code fromCIEXYZ} method of the CS_sRGB color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. @@ -405,10 +405,10 @@ public abstract class ColorSpace implements java.io.Serializable { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of the CS_sRGB color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of this color space to + * {@code fromCIEXYZ} method of this color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. @@ -438,7 +438,7 @@ public abstract class ColorSpace implements java.io.Serializable { * A further transformation is necessary to compute the XYZ values * that would be measured using current CIE recommended practices. * See the {@link ICC_ColorSpace#toCIEXYZ(float[]) toCIEXYZ} method of - * ICC_ColorSpace for further information. + * {@code ICC_ColorSpace} for further information. * * @param colorvalue a float array with length of at least the number * of components in this ColorSpace @@ -466,7 +466,7 @@ public abstract class ColorSpace implements java.io.Serializable { * current CIE recommended practices, they must be converted to D50 * relative values before being passed to this method. * See the {@link ICC_ColorSpace#fromCIEXYZ(float[]) fromCIEXYZ} method of - * ICC_ColorSpace for further information. + * {@code ICC_ColorSpace} for further information. * * @param colorvalue a float array with length of at least 3 * @return a float array with length equal to the number of @@ -486,7 +486,7 @@ public abstract class ColorSpace implements java.io.Serializable { * primaries. * * @return the type constant that represents the type of this - * ColorSpace + * {@code ColorSpace} */ public int getType() { return type; @@ -494,7 +494,7 @@ public abstract class ColorSpace implements java.io.Serializable { /** * Returns the number of components of this ColorSpace. - * @return The number of components in this ColorSpace. + * @return The number of components in this {@code ColorSpace}. */ public int getNumComponents() { return numComponents; @@ -505,7 +505,7 @@ public abstract class ColorSpace implements java.io.Serializable { * * @param idx the component index * @return the name of the component at the specified index - * @throws IllegalArgumentException if idx is + * @throws IllegalArgumentException if {@code idx} is * less than 0 or greater than numComponents - 1 */ public String getName (int idx) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java index e80054c767f..cf6f640f1eb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ColorSpace.java @@ -142,10 +142,10 @@ public class ICC_ColorSpace extends ColorSpace { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of this color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of the CS_sRGB color space to + * {@code fromCIEXYZ} method of the CS_sRGB color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. @@ -194,10 +194,10 @@ public class ICC_ColorSpace extends ColorSpace { * This method transforms color values using algorithms designed * to produce the best perceptual match between input and output * colors. In order to do colorimetric conversion of color values, - * you should use the toCIEXYZ + * you should use the {@code toCIEXYZ} * method of the CS_sRGB color space to first convert from the input * color space to the CS_CIEXYZ color space, and then use the - * fromCIEXYZ method of this color space to + * {@code fromCIEXYZ} method of this color space to * convert from CS_CIEXYZ to the output color space. * See {@link #toCIEXYZ(float[]) toCIEXYZ} and * {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information. diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java index 90f87280a7f..3adc80fa59f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java @@ -766,8 +766,8 @@ public class ICC_Profile implements Serializable { * a byte array. Throws an IllegalArgumentException if the data * does not correspond to a valid ICC Profile. * @param data the specified ICC Profile data - * @return an ICC_Profile object corresponding to - * the data in the specified data array. + * @return an {@code ICC_Profile} object corresponding to + * the data in the specified {@code data} array. */ public static ICC_Profile getInstance(byte[] data) { ICC_Profile thisProfile; @@ -821,11 +821,11 @@ public class ICC_Profile implements Serializable { * * @param cspace the type of color space to create a profile for. * The specified type is one of the color - * space constants defined in the ColorSpace class. + * space constants defined in the {@code ColorSpace} class. * - * @return an ICC_Profile object corresponding to - * the specified ColorSpace type. - * @exception IllegalArgumentException If cspace is not + * @return an {@code ICC_Profile} object corresponding to + * the specified {@code ColorSpace} type. + * @exception IllegalArgumentException If {@code cspace} is not * one of the predefined color space types. */ public static ICC_Profile getInstance (int cspace) { @@ -956,7 +956,7 @@ public class ICC_Profile implements Serializable { * Profile data. * @param fileName The file that contains the data for the profile. * - * @return an ICC_Profile object corresponding to + * @return an {@code ICC_Profile} object corresponding to * the data in the specified file. * @exception IOException If the specified file cannot be opened or * an I/O error occurs while reading the file. @@ -997,8 +997,8 @@ public class ICC_Profile implements Serializable { * error occurs while reading the stream. * @param s The input stream from which to read the profile data. * - * @return an ICC_Profile object corresponding to the - * data in the specified InputStream. + * @return an {@code ICC_Profile} object corresponding to the + * data in the specified {@code InputStream}. * * @exception IOException If an I/O error occurs while reading the stream. * @@ -1213,7 +1213,7 @@ public class ICC_Profile implements Serializable { * characteristics of the space, e.g. the chromaticities of the * primaries. * @return One of the color space type constants defined in the - * ColorSpace class. + * {@code ColorSpace} class. */ public int getColorSpaceType() { if (deferralInfo != null) { @@ -1245,7 +1245,7 @@ public class ICC_Profile implements Serializable { * color space defined in the ICC specification. For a device * link profile, this could be any of the color space type constants. * @return One of the color space type constants defined in the - * ColorSpace class. + * {@code ColorSpace} class. */ public int getPCSType() { if (ProfileDeferralMgr.deferring) { @@ -1342,7 +1342,7 @@ public class ICC_Profile implements Serializable { * want to get. * * @return A byte array that contains the tagged data element. Returns - * null if the specified tag doesn't exist. + * {@code null} if the specified tag doesn't exist. * @see #setData(int, byte[]) */ public byte[] getData(int tagSignature) { @@ -1929,7 +1929,7 @@ public class ICC_Profile implements Serializable { /** * Version of the format of additional serialized data in the - * stream. Version 1 corresponds to Java 2 + * stream. Version {@code 1} corresponds to Java 2 * Platform, v1.3. * @since 1.3 * @serial @@ -1943,17 +1943,17 @@ public class ICC_Profile implements Serializable { * * @param s stream used for serialization. * @throws IOException - * thrown by ObjectInputStream. + * thrown by {@code ObjectInputStream}. * @serialData - * The String is the name of one of + * The {@code String} is the name of one of * CS_* constants defined in the * {@link ColorSpace} class if the profile object is a profile * for a predefined color space (for example - * "CS_sRGB"). The string is null + * {@code "CS_sRGB"}). The string is {@code null} * otherwise. *

          - * The byte[] array is the profile data for the - * profile. For predefined color spaces null is + * The {@code byte[]} array is the profile data for the + * profile. For predefined color spaces {@code null} is * written instead of the profile data. If in the future * versions of Java API new predefined color spaces will be * added, future versions of this class may choose to write @@ -2003,19 +2003,19 @@ public class ICC_Profile implements Serializable { * * @param s stream used for deserialization. * @throws IOException - * thrown by ObjectInputStream. + * thrown by {@code ObjectInputStream}. * @throws ClassNotFoundException - * thrown by ObjectInputStream. + * thrown by {@code ObjectInputStream}. * @serialData - * The String is the name of one of + * The {@code String} is the name of one of * CS_* constants defined in the * {@link ColorSpace} class if the profile object is a profile * for a predefined color space (for example - * "CS_sRGB"). The string is null + * {@code "CS_sRGB"}). The string is {@code null} * otherwise. *

          - * The byte[] array is the profile data for the - * profile. It will usually be null for the + * The {@code byte[]} array is the profile data for the + * profile. It will usually be {@code null} for the * predefined profiles. *

          * If the string is recognized as a constant name for diff --git a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java index 4929e8a7190..39a243adb43 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java +++ b/jdk/src/java.desktop/share/classes/java/awt/color/ICC_ProfileRGB.java @@ -45,13 +45,13 @@ import sun.java2d.cmm.ProfileDeferralInfo; * that represents profiles which meet the following criteria: *

            *
          • The profile's color space type is RGB.
          • - *
          • The profile includes the redColorantTag, - * greenColorantTag, blueColorantTag, - * redTRCTag, greenTRCTag, - * blueTRCTag, and mediaWhitePointTag tags.
          • + *
          • The profile includes the {@code redColorantTag}, + * {@code greenColorantTag}, {@code blueColorantTag}, + * {@code redTRCTag}, {@code greenTRCTag}, + * {@code blueTRCTag}, and {@code mediaWhitePointTag} tags.
          • *
          - * The ICC_Profile getInstance method will - * return an ICC_ProfileRGB object when these conditions are met. + * The {@code ICC_Profile getInstance} method will + * return an {@code ICC_ProfileRGB} object when these conditions are met. * Three-component, matrix-based input profiles and RGB display profiles are * examples of this type of profile. *

          @@ -109,7 +109,7 @@ extends ICC_Profile { /** - * Constructs an new ICC_ProfileRGB from a CMM ID. + * Constructs an new {@code ICC_ProfileRGB} from a CMM ID. * * @param p The CMM ID for the profile. * @@ -119,7 +119,7 @@ extends ICC_Profile { } /** - * Constructs a new ICC_ProfileRGB from a + * Constructs a new {@code ICC_ProfileRGB} from a * ProfileDeferralInfo object. * * @param pdi @@ -131,10 +131,10 @@ extends ICC_Profile { /** * Returns an array that contains the components of the profile's - * mediaWhitePointTag. + * {@code mediaWhitePointTag}. * - * @return A 3-element float array containing the x, y, - * and z components of the profile's mediaWhitePointTag. + * @return A 3-element {@code float} array containing the x, y, + * and z components of the profile's {@code mediaWhitePointTag}. */ public float[] getMediaWhitePoint() { return super.getMediaWhitePoint(); @@ -142,17 +142,17 @@ extends ICC_Profile { /** - * Returns a 3x3 float matrix constructed from the - * X, Y, and Z components of the profile's redColorantTag, - * greenColorantTag, and blueColorantTag. + * Returns a 3x3 {@code float} matrix constructed from the + * X, Y, and Z components of the profile's {@code redColorantTag}, + * {@code greenColorantTag}, and {@code blueColorantTag}. *

          * This matrix can be used for color transforms in the forward * direction of the profile--from the profile color space * to the CIEXYZ PCS. * - * @return A 3x3 float array that contains the x, y, and z - * components of the profile's redColorantTag, - * greenColorantTag, and blueColorantTag. + * @return A 3x3 {@code float} array that contains the x, y, and z + * components of the profile's {@code redColorantTag}, + * {@code greenColorantTag}, and {@code blueColorantTag}. */ public float[][] getMatrix() { float[][] theMatrix = new float[3][3]; @@ -191,7 +191,7 @@ extends ICC_Profile { *   linearComponent = deviceComponent * * - * @param component The ICC_ProfileRGB constant that + * @param component The {@code ICC_ProfileRGB} constant that * represents the component whose TRC you want to retrieve * @return the gamma value as a float. * @exception ProfileDataException if the profile does not specify @@ -225,8 +225,8 @@ extends ICC_Profile { /** * Returns the TRC for a particular component as an array. - * Component must be REDCOMPONENT, - * GREENCOMPONENT, or BLUECOMPONENT. + * Component must be {@code REDCOMPONENT}, + * {@code GREENCOMPONENT}, or {@code BLUECOMPONENT}. * Otherwise the returned array * represents a lookup table where the input component value * is conceptually in the range [0.0, 1.0]. Value 0.0 maps @@ -236,18 +236,18 @@ extends ICC_Profile { * array. Output values also map linearly to the range [0.0, 1.0]. * Value 0.0 is represented by an array value of 0x0000 and * value 1.0 by 0xFFFF. In other words, the values are really unsigned - * short values even though they are returned in a - * short array. + * {@code short} values even though they are returned in a + * {@code short} array. * * If the profile has specified the corresponding TRC * as linear (gamma = 1.0) or as a simple gamma value, this method * throws an exception. In this case, the {@link #getGamma(int)} * method should be used to get the gamma value. * - * @param component The ICC_ProfileRGB constant that + * @param component The {@code ICC_ProfileRGB} constant that * represents the component whose TRC you want to retrieve: - * REDCOMPONENT, GREENCOMPONENT, or - * BLUECOMPONENT. + * {@code REDCOMPONENT}, {@code GREENCOMPONENT}, or + * {@code BLUECOMPONENT}. * * @return a short array representing the TRC. * @exception ProfileDataException if the profile does not specify diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java index 0e3f0fb459a..b144a6b8d47 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/Autoscroll.java @@ -37,17 +37,17 @@ import java.awt.Point; * and institute a scroll operation in order to make obscured region(s) * visible to the user. This feature is known as autoscrolling. *

          - * If a GUI control is both an active DropTarget + * If a GUI control is both an active {@code DropTarget} * and is also scrollable, it * can receive notifications of autoscrolling gestures by the user from * the DnD system by implementing this interface. *

          * An autoscrolling gesture is initiated by the user by keeping the drag - * cursor motionless with a border region of the Component, + * cursor motionless with a border region of the {@code Component}, * referred to as * the "autoscrolling region", for a predefined period of time, this will - * result in repeated scroll requests to the Component - * until the drag Cursor resumes its motion. + * result in repeated scroll requests to the {@code Component} + * until the drag {@code Cursor} resumes its motion. * * @since 1.2 */ @@ -55,13 +55,13 @@ import java.awt.Point; public interface Autoscroll { /** - * This method returns the Insets describing + * This method returns the {@code Insets} describing * the autoscrolling region or border relative * to the geometry of the implementing Component. *

          - * This value is read once by the DropTarget - * upon entry of the drag Cursor - * into the associated Component. + * This value is read once by the {@code DropTarget} + * upon entry of the drag {@code Cursor} + * into the associated {@code Component}. * * @return the Insets */ @@ -69,9 +69,9 @@ public interface Autoscroll { public Insets getAutoscrollInsets(); /** - * notify the Component to autoscroll + * notify the {@code Component} to autoscroll * - * @param cursorLocn A Point indicating the + * @param cursorLocn A {@code Point} indicating the * location of the cursor that triggered this operation. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java index e4c5fb42206..88b70fc9900 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDConstants.java @@ -37,28 +37,28 @@ public final class DnDConstants { private DnDConstants() {} // define null private constructor. /** - * An int representing no action. + * An {@code int} representing no action. */ @Native public static final int ACTION_NONE = 0x0; /** - * An int representing a "copy" action. + * An {@code int} representing a "copy" action. */ @Native public static final int ACTION_COPY = 0x1; /** - * An int representing a "move" action. + * An {@code int} representing a "move" action. */ @Native public static final int ACTION_MOVE = 0x2; /** - * An int representing a "copy" or - * "move" action. + * An {@code int} representing a "copy" or + * "move" action. */ @Native public static final int ACTION_COPY_OR_MOVE = ACTION_COPY | ACTION_MOVE; /** - * An int representing a "link" action. + * An {@code int} representing a "link" action. * * The link verb is found in many, if not all native DnD platforms, and the * actual interpretation of LINK semantics is both platform @@ -76,7 +76,7 @@ public final class DnDConstants { @Native public static final int ACTION_LINK = 0x40000000; /** - * An int representing a "reference" + * An {@code int} representing a "reference" * action (synonym for ACTION_LINK). */ @Native public static final int ACTION_REFERENCE = ACTION_LINK; diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java index f4e059f9e00..dc7fc7f2138 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DnDEventMulticaster.java @@ -31,7 +31,7 @@ import java.util.EventListener; /** - * A class extends AWTEventMulticaster to implement efficient and + * A class extends {@code AWTEventMulticaster} to implement efficient and * thread-safe multi-cast event dispatching for the drag-and-drop events defined * in the java.awt.dnd package. * @@ -44,9 +44,9 @@ class DnDEventMulticaster extends AWTEventMulticaster /** * Creates an event multicaster instance which chains listener-a - * with listener-b. Input parameters a and b - * should not be null, though implementations may vary in - * choosing whether or not to throw NullPointerException + * with listener-b. Input parameters {@code a} and {@code b} + * should not be {@code null}, though implementations may vary in + * choosing whether or not to throw {@code NullPointerException} * in that case. * * @param a listener-a @@ -57,10 +57,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dragEnter on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dragEnter} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragEnter(DragSourceDragEvent dsde) { ((DragSourceListener)a).dragEnter(dsde); @@ -68,10 +68,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dragOver on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dragOver} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragOver(DragSourceDragEvent dsde) { ((DragSourceListener)a).dragOver(dsde); @@ -79,10 +79,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dropActionChanged on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dropActionChanged} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dropActionChanged(DragSourceDragEvent dsde) { ((DragSourceListener)a).dropActionChanged(dsde); @@ -90,10 +90,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceEvent by invoking - * dragExit on listener-a and listener-b. + * Handles the {@code DragSourceEvent} by invoking + * {@code dragExit} on listener-a and listener-b. * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ public void dragExit(DragSourceEvent dse) { ((DragSourceListener)a).dragExit(dse); @@ -101,10 +101,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDropEvent by invoking - * dragDropEnd on listener-a and listener-b. + * Handles the {@code DragSourceDropEvent} by invoking + * {@code dragDropEnd} on listener-a and listener-b. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ public void dragDropEnd(DragSourceDropEvent dsde) { ((DragSourceListener)a).dragDropEnd(dsde); @@ -112,10 +112,10 @@ class DnDEventMulticaster extends AWTEventMulticaster } /** - * Handles the DragSourceDragEvent by invoking - * dragMouseMoved on listener-a and listener-b. + * Handles the {@code DragSourceDragEvent} by invoking + * {@code dragMouseMoved} on listener-a and listener-b. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragMouseMoved(DragSourceDragEvent dsde) { ((DragSourceMotionListener)a).dragMouseMoved(dsde); diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java index 3dff336a794..b87b709feb2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureEvent.java @@ -49,12 +49,12 @@ import java.io.ObjectOutputStream; /** - * A DragGestureEvent is passed - * to DragGestureListener's + * A {@code DragGestureEvent} is passed + * to {@code DragGestureListener}'s * dragGestureRecognized() method - * when a particular DragGestureRecognizer detects that a + * when a particular {@code DragGestureRecognizer} detects that a * platform dependent drag initiating gesture has occurred - * on the Component that it is tracking. + * on the {@code Component} that it is tracking. * * The {@code action} field of any {@code DragGestureEvent} instance should take one of the following * values: @@ -76,19 +76,19 @@ public class DragGestureEvent extends EventObject { private static final long serialVersionUID = 9080172649166731306L; /** - * Constructs a DragGestureEvent object given by the - * DragGestureRecognizer instance firing this event, + * Constructs a {@code DragGestureEvent} object given by the + * {@code DragGestureRecognizer} instance firing this event, * an {@code act} parameter representing * the user's preferred action, an {@code ori} parameter * indicating the origin of the drag, and a {@code List} of * events that comprise the gesture({@code evs} parameter). * - * @param dgr The DragGestureRecognizer firing this event + * @param dgr The {@code DragGestureRecognizer} firing this event * @param act The user's preferred action. * For information on allowable values, see * the class description for {@link DragGestureEvent} * @param ori The origin of the drag - * @param evs The List of events that comprise the gesture + * @param evs The {@code List} of events that comprise the gesture * * @throws IllegalArgumentException if any parameter equals {@code null} * @throws IllegalArgumentException if the act parameter does not comply with @@ -123,9 +123,9 @@ public class DragGestureEvent extends EventObject { } /** - * Returns the source as a DragGestureRecognizer. + * Returns the source as a {@code DragGestureRecognizer}. * - * @return the source as a DragGestureRecognizer + * @return the source as a {@code DragGestureRecognizer} */ public DragGestureRecognizer getSourceAsDragGestureRecognizer() { @@ -133,8 +133,8 @@ public class DragGestureEvent extends EventObject { } /** - * Returns the Component associated - * with this DragGestureEvent. + * Returns the {@code Component} associated + * with this {@code DragGestureEvent}. * * @return the Component */ @@ -142,16 +142,16 @@ public class DragGestureEvent extends EventObject { public Component getComponent() { return component; } /** - * Returns the DragSource. + * Returns the {@code DragSource}. * - * @return the DragSource + * @return the {@code DragSource} */ public DragSource getDragSource() { return dragSource; } /** - * Returns a Point in the coordinates - * of the Component over which the drag originated. + * Returns a {@code Point} in the coordinates + * of the {@code Component} over which the drag originated. * * @return the Point where the drag originated in Component coords. */ @@ -161,7 +161,7 @@ public class DragGestureEvent extends EventObject { } /** - * Returns an Iterator for the events + * Returns an {@code Iterator} for the events * comprising the gesture. * * @return an Iterator for the events comprising the gesture @@ -170,7 +170,7 @@ public class DragGestureEvent extends EventObject { public Iterator iterator() { return events.iterator(); } /** - * Returns an Object array of the + * Returns an {@code Object} array of the * events comprising the drag gesture. * * @return an array of the events comprising the gesture @@ -181,7 +181,7 @@ public class DragGestureEvent extends EventObject { /** * Returns an array of the events comprising the drag gesture. * - * @param array the array of EventObject sub(types) + * @param array the array of {@code EventObject} sub(types) * * @return an array of the events comprising the gesture */ @@ -189,7 +189,7 @@ public class DragGestureEvent extends EventObject { public Object[] toArray(Object[] array) { return events.toArray(array); } /** - * Returns an int representing the + * Returns an {@code int} representing the * action selected by the user. * * @return the action selected by the user @@ -208,22 +208,22 @@ public class DragGestureEvent extends EventObject { } /** - * Starts the drag operation given the Cursor for this drag - * operation and the Transferable representing the source data + * Starts the drag operation given the {@code Cursor} for this drag + * operation and the {@code Transferable} representing the source data * for this drag operation. *
          - * If a null Cursor is specified no exception will + * If a {@code null Cursor} is specified no exception will * be thrown and default drag cursors will be used instead. *
          - * If a null Transferable is specified - * NullPointerException will be thrown. + * If a {@code null Transferable} is specified + * {@code NullPointerException} will be thrown. * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see * DragSourceContext * for more details on the cursor handling mechanism * during drag and drop - * @param transferable The Transferable representing the source + * @param transferable The {@code Transferable} representing the source * data for this drag operation. * * @throws InvalidDnDOperationException if the Drag and Drop @@ -239,9 +239,9 @@ public class DragGestureEvent extends EventObject { } /** - * Starts the drag given the initial Cursor to display, - * the Transferable object, - * and the DragSourceListener to use. + * Starts the drag given the initial {@code Cursor} to display, + * the {@code Transferable} object, + * and the {@code DragSourceListener} to use. * * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; @@ -264,11 +264,11 @@ public class DragGestureEvent extends EventObject { } /** - * Start the drag given the initial Cursor to display, - * a drag Image, the offset of - * the Image, - * the Transferable object, and - * the DragSourceListener to use. + * Start the drag given the initial {@code Cursor} to display, + * a drag {@code Image}, the offset of + * the {@code Image}, + * the {@code Transferable} object, and + * the {@code DragSourceListener} to use. * * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; @@ -293,16 +293,16 @@ public class DragGestureEvent extends EventObject { } /** - * Serializes this DragGestureEvent. Performs default - * serialization and then writes out this object's List of - * gesture events if and only if the List can be serialized. - * If not, null is written instead. In this case, a - * DragGestureEvent created from the resulting deserialized - * stream will contain an empty List of gesture events. + * Serializes this {@code DragGestureEvent}. Performs default + * serialization and then writes out this object's {@code List} of + * gesture events if and only if the {@code List} can be serialized. + * If not, {@code null} is written instead. In this case, a + * {@code DragGestureEvent} created from the resulting deserialized + * stream will contain an empty {@code List} of gesture events. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a List instance, or - * null. + * followed by either a {@code List} instance, or + * {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -312,16 +312,16 @@ public class DragGestureEvent extends EventObject { } /** - * Deserializes this DragGestureEvent. This method first - * performs default deserialization for all non-transient + * Deserializes this {@code DragGestureEvent}. This method first + * performs default deserialization for all non-{@code transient} * fields. An attempt is then made to deserialize this object's - * List of gesture events as well. This is first attempted - * by deserializing the field events, because, in releases - * prior to 1.4, a non-transient field of this name stored the - * List of gesture events. If this fails, the next object in - * the stream is used instead. If the resulting List is - * null, this object's List of gesture events - * is set to an empty List. + * {@code List} of gesture events as well. This is first attempted + * by deserializing the field {@code events}, because, in releases + * prior to 1.4, a non-{@code transient} field of this name stored the + * {@code List} of gesture events. If this fails, the next object in + * the stream is used instead. If the resulting {@code List} is + * {@code null}, this object's {@code List} of gesture events + * is set to an empty {@code List}. * * @since 1.4 */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java index f3e600e6cd4..e04fbfa4bb5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureListener.java @@ -56,7 +56,7 @@ import java.util.EventListener; * * @see java.awt.dnd.DragGestureRecognizer * @see java.awt.dnd.DragGestureEvent - * @param dge the DragGestureEvent describing + * @param dge the {@code DragGestureEvent} describing * the gesture that has just occurred */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java index b3dbeb5f477..0a64aa5c62f 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragGestureRecognizer.java @@ -40,41 +40,41 @@ import java.io.ObjectOutputStream; import java.io.Serializable; /** - * The DragGestureRecognizer is an + * The {@code DragGestureRecognizer} is an * abstract base class for the specification * of a platform-dependent listener that can be associated with a particular - * Component in order to + * {@code Component} in order to * identify platform-dependent drag initiating gestures. *

          - * The appropriate DragGestureRecognizer + * The appropriate {@code DragGestureRecognizer} * subclass instance is obtained from the * {@link DragSource} associated with - * a particular Component, or from the Toolkit object via its + * a particular {@code Component}, or from the {@code Toolkit} object via its * {@link java.awt.Toolkit#createDragGestureRecognizer createDragGestureRecognizer()} * method. *

          - * Once the DragGestureRecognizer - * is associated with a particular Component + * Once the {@code DragGestureRecognizer} + * is associated with a particular {@code Component} * it will register the appropriate listener interfaces on that - * Component - * in order to track the input events delivered to the Component. + * {@code Component} + * in order to track the input events delivered to the {@code Component}. *

          - * Once the DragGestureRecognizer identifies a sequence of events - * on the Component as a drag initiating gesture, it will notify - * its unicast DragGestureListener by + * Once the {@code DragGestureRecognizer} identifies a sequence of events + * on the {@code Component} as a drag initiating gesture, it will notify + * its unicast {@code DragGestureListener} by * invoking its * {@link java.awt.dnd.DragGestureListener#dragGestureRecognized gestureRecognized()} * method. *

          - * When a concrete DragGestureRecognizer + * When a concrete {@code DragGestureRecognizer} * instance detects a drag initiating - * gesture on the Component it is associated with, + * gesture on the {@code Component} it is associated with, * it fires a {@link DragGestureEvent} to - * the DragGestureListener registered on - * its unicast event source for DragGestureListener - * events. This DragGestureListener is responsible + * the {@code DragGestureListener} registered on + * its unicast event source for {@code DragGestureListener} + * events. This {@code DragGestureListener} is responsible * for causing the associated - * DragSource to start the Drag and Drop operation (if + * {@code DragSource} to start the Drag and Drop operation (if * appropriate). * * @author Laurence P. G. Cable @@ -88,36 +88,36 @@ public abstract class DragGestureRecognizer implements Serializable { private static final long serialVersionUID = 8996673345831063337L; /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used - * in this Drag and Drop operation, the Component - * this DragGestureRecognizer should "observe" + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used + * in this Drag and Drop operation, the {@code Component} + * this {@code DragGestureRecognizer} should "observe" * for drag initiating gestures, the action(s) supported * for this Drag and Drop operation, and the - * DragGestureListener to notify + * {@code DragGestureListener} to notify * once a drag initiating gesture has been detected. * - * @param ds the DragSource this - * DragGestureRecognizer + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} * will use to process the Drag and Drop operation * - * @param c the Component - * this DragGestureRecognizer + * @param c the {@code Component} + * this {@code DragGestureRecognizer} * should "observe" the event stream to, * in order to detect a drag initiating gesture. - * If this value is null, the - * DragGestureRecognizer - * is not associated with any Component. + * If this value is {@code null}, the + * {@code DragGestureRecognizer} + * is not associated with any {@code Component}. * * @param sa the set (logical OR) of the - * DnDConstants + * {@code DnDConstants} * that this Drag and Drop operation will support * - * @param dgl the DragGestureRecognizer + * @param dgl the {@code DragGestureRecognizer} * to notify when a drag gesture is detected * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl) { @@ -137,30 +137,30 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used in this + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used in this * Drag and Drop - * operation, the Component this - * DragGestureRecognizer should "observe" + * operation, the {@code Component} this + * {@code DragGestureRecognizer} should "observe" * for drag initiating gestures, and the action(s) * supported for this Drag and Drop operation. * - * @param ds the DragSource this - * DragGestureRecognizer will use to + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} will use to * process the Drag and Drop operation * - * @param c the Component this - * DragGestureRecognizer should "observe" the event + * @param c the {@code Component} this + * {@code DragGestureRecognizer} should "observe" the event * stream to, in order to detect a drag initiating gesture. - * If this value is null, the - * DragGestureRecognizer - * is not associated with any Component. + * If this value is {@code null}, the + * {@code DragGestureRecognizer} + * is not associated with any {@code Component}. * - * @param sa the set (logical OR) of the DnDConstants + * @param sa the set (logical OR) of the {@code DnDConstants} * that this Drag and Drop operation will support * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds, Component c, int sa) { @@ -168,27 +168,27 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used * in this Drag and Drop operation, and - * the Component this - * DragGestureRecognizer + * the {@code Component} this + * {@code DragGestureRecognizer} * should "observe" for drag initiating gestures. * - * @param ds the DragSource this - * DragGestureRecognizer + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} * will use to process the Drag and Drop operation * - * @param c the Component - * this DragGestureRecognizer + * @param c the {@code Component} + * this {@code DragGestureRecognizer} * should "observe" the event stream to, * in order to detect a drag initiating gesture. - * If this value is null, - * the DragGestureRecognizer - * is not associated with any Component. + * If this value is {@code null}, + * the {@code DragGestureRecognizer} + * is not associated with any {@code Component}. * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds, Component c) { @@ -196,16 +196,16 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Construct a new DragGestureRecognizer - * given the DragSource to be used in this + * Construct a new {@code DragGestureRecognizer} + * given the {@code DragSource} to be used in this * Drag and Drop operation. * - * @param ds the DragSource this - * DragGestureRecognizer will + * @param ds the {@code DragSource} this + * {@code DragGestureRecognizer} will * use to process the Drag and Drop operation * * @throws IllegalArgumentException - * if ds is null. + * if ds is {@code null}. */ protected DragGestureRecognizer(DragSource ds) { @@ -229,8 +229,8 @@ public abstract class DragGestureRecognizer implements Serializable { protected abstract void unregisterListeners(); /** - * This method returns the DragSource - * this DragGestureRecognizer + * This method returns the {@code DragSource} + * this {@code DragGestureRecognizer} * will use in order to process the Drag and Drop * operation. * @@ -240,9 +240,9 @@ public abstract class DragGestureRecognizer implements Serializable { public DragSource getDragSource() { return dragSource; } /** - * This method returns the Component + * This method returns the {@code Component} * that is to be "observed" by the - * DragGestureRecognizer + * {@code DragGestureRecognizer} * for drag initiating gestures. * * @return The Component this DragGestureRecognizer @@ -257,7 +257,7 @@ public abstract class DragGestureRecognizer implements Serializable { * registerListeners() and unregisterListeners() are called as a side * effect as appropriate. * - * @param c The Component or null + * @param c The {@code Component} or {@code null} */ public synchronized void setComponent(Component c) { @@ -309,13 +309,13 @@ public abstract class DragGestureRecognizer implements Serializable { public void resetRecognizer() { events.clear(); } /** - * Register a new DragGestureListener. + * Register a new {@code DragGestureListener}. * - * @param dgl the DragGestureListener to register - * with this DragGestureRecognizer. + * @param dgl the {@code DragGestureListener} to register + * with this {@code DragGestureRecognizer}. * * @throws java.util.TooManyListenersException if a - * DragGestureListener has already been added. + * {@code DragGestureListener} has already been added. */ public synchronized void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException { @@ -331,11 +331,11 @@ public abstract class DragGestureRecognizer implements Serializable { /** * unregister the current DragGestureListener * - * @param dgl the DragGestureListener to unregister - * from this DragGestureRecognizer + * @param dgl the {@code DragGestureListener} to unregister + * from this {@code DragGestureRecognizer} * * @throws IllegalArgumentException if - * dgl is not (equal to) the currently registered DragGestureListener. + * dgl is not (equal to) the currently registered {@code DragGestureListener}. */ public synchronized void removeDragGestureListener(DragGestureListener dgl) { @@ -370,16 +370,16 @@ public abstract class DragGestureRecognizer implements Serializable { * all Events that are recognized as part of the series of Events that go * to comprise a Drag and Drop initiating gesture via this API. *

          - * This method is used by a DragGestureRecognizer - * implementation to add an InputEvent + * This method is used by a {@code DragGestureRecognizer} + * implementation to add an {@code InputEvent} * subclass (that it believes is one in a series * of events that comprise a Drag and Drop operation) * to the array of events that this - * DragGestureRecognizer maintains internally. + * {@code DragGestureRecognizer} maintains internally. * - * @param awtie the InputEvent - * to add to this DragGestureRecognizer's - * internal array of events. Note that null + * @param awtie the {@code InputEvent} + * to add to this {@code DragGestureRecognizer}'s + * internal array of events. Note that {@code null} * is not a valid value, and will be ignored. */ @@ -388,14 +388,14 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Serializes this DragGestureRecognizer. This method first + * Serializes this {@code DragGestureRecognizer}. This method first * performs default serialization. Then, this object's - * DragGestureListener is written out if and only if it can be - * serialized. If not, null is written instead. + * {@code DragGestureListener} is written out if and only if it can be + * serialized. If not, {@code null} is written instead. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a DragGestureListener, or - * null. + * followed by either a {@code DragGestureListener}, or + * {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -406,9 +406,9 @@ public abstract class DragGestureRecognizer implements Serializable { } /** - * Deserializes this DragGestureRecognizer. This method first - * performs default deserialization for all non-transient - * fields. This object's DragGestureListener is then + * Deserializes this {@code DragGestureRecognizer}. This method first + * performs default deserialization for all non-{@code transient} + * fields. This object's {@code DragGestureListener} is then * deserialized as well by using the next object in the stream. * * @since 1.4 @@ -437,30 +437,30 @@ public abstract class DragGestureRecognizer implements Serializable { */ /** - * The DragSource + * The {@code DragSource} * associated with this - * DragGestureRecognizer. + * {@code DragGestureRecognizer}. * * @serial */ protected DragSource dragSource; /** - * The Component - * associated with this DragGestureRecognizer. + * The {@code Component} + * associated with this {@code DragGestureRecognizer}. * * @serial */ protected Component component; /** - * The DragGestureListener - * associated with this DragGestureRecognizer. + * The {@code DragGestureListener} + * associated with this {@code DragGestureRecognizer}. */ protected transient DragGestureListener dragGestureListener; /** - * An int representing + * An {@code int} representing * the type(s) of action(s) used * in this Drag and Drop operation. * @@ -470,7 +470,7 @@ public abstract class DragGestureRecognizer implements Serializable { /** * The list of events (in order) that - * the DragGestureRecognizer + * the {@code DragGestureRecognizer} * "recognized" as a "gesture" that triggers a drag. * * @serial diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java index 073686e857e..cb028a399a8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSource.java @@ -49,7 +49,7 @@ import sun.security.action.GetIntegerAction; /** - * The DragSource is the entity responsible + * The {@code DragSource} is the entity responsible * for the initiation of the Drag * and Drop operation, and may be used in a number of scenarios: *

            @@ -57,49 +57,49 @@ import sun.security.action.GetIntegerAction; *
          • 1 instance per class of potential Drag Initiator object (e.g * TextField). [implementation dependent] *
          • 1 per instance of a particular - * Component, or application specific - * object associated with a Component + * {@code Component}, or application specific + * object associated with a {@code Component} * instance in the GUI. [implementation dependent] *
          • Some other arbitrary association. [implementation dependent] *
          * - * Once the DragSource is - * obtained, a DragGestureRecognizer should - * also be obtained to associate the DragSource + * Once the {@code DragSource} is + * obtained, a {@code DragGestureRecognizer} should + * also be obtained to associate the {@code DragSource} * with a particular - * Component. + * {@code Component}. *

          * The initial interpretation of the user's gesture, * and the subsequent starting of the drag operation * are the responsibility of the implementing - * Component, which is usually - * implemented by a DragGestureRecognizer. + * {@code Component}, which is usually + * implemented by a {@code DragGestureRecognizer}. *

          * When a drag gesture occurs, the - * DragSource's + * {@code DragSource}'s * startDrag() method shall be * invoked in order to cause processing * of the user's navigational * gestures and delivery of Drag and Drop * protocol notifications. A - * DragSource shall only + * {@code DragSource} shall only * permit a single Drag and Drop operation to be * current at any one time, and shall * reject any further startDrag() requests - * by throwing an IllegalDnDOperationException + * by throwing an {@code IllegalDnDOperationException} * until such time as the extant operation is complete. *

          * The startDrag() method invokes the * createDragSourceContext() method to * instantiate an appropriate - * DragSourceContext - * and associate the DragSourceContextPeer + * {@code DragSourceContext} + * and associate the {@code DragSourceContextPeer} * with that. *

          * If the Drag and Drop System is * unable to initiate a drag operation for * some reason, the startDrag() method throws - * a java.awt.dnd.InvalidDnDOperationException + * a {@code java.awt.dnd.InvalidDnDOperationException} * to signal such a condition. Typically this * exception is thrown when the underlying platform * system is either not in a state to @@ -111,7 +111,7 @@ import sun.security.action.GetIntegerAction; * until the operation is complete. * The operation(s) are constant for the * duration of the operation with respect to the - * DragSource. + * {@code DragSource}. * * @since 1.2 */ @@ -140,9 +140,9 @@ public class DragSource implements Serializable { /** - * The default Cursor to use with a copy operation indicating - * that a drop is currently allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a copy operation indicating + * that a drop is currently allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -150,9 +150,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.CopyDrop"); /** - * The default Cursor to use with a move operation indicating - * that a drop is currently allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a move operation indicating + * that a drop is currently allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -160,9 +160,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.MoveDrop"); /** - * The default Cursor to use with a link operation indicating - * that a drop is currently allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a link operation indicating + * that a drop is currently allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -170,9 +170,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.LinkDrop"); /** - * The default Cursor to use with a copy operation indicating - * that a drop is currently not allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a copy operation indicating + * that a drop is currently not allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -180,9 +180,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.CopyNoDrop"); /** - * The default Cursor to use with a move operation indicating - * that a drop is currently not allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a move operation indicating + * that a drop is currently not allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -190,9 +190,9 @@ public class DragSource implements Serializable { load("DnD.Cursor.MoveNoDrop"); /** - * The default Cursor to use with a link operation indicating - * that a drop is currently not allowed. null if - * GraphicsEnvironment.isHeadless() returns true. + * The default {@code Cursor} to use with a link operation indicating + * that a drop is currently not allowed. {@code null} if + * {@code GraphicsEnvironment.isHeadless()} returns {@code true}. * * @see java.awt.GraphicsEnvironment#isHeadless */ @@ -209,7 +209,7 @@ public class DragSource implements Serializable { static final String dragSourceMotionListenerK = "dragSourceMotionL"; /** - * Gets the DragSource object associated with + * Gets the {@code DragSource} object associated with * the underlying platform. * * @return the platform DragSource @@ -228,7 +228,7 @@ public class DragSource implements Serializable { /** * Reports * whether or not drag - * Image support + * {@code Image} support * is available on the underlying platform. * * @return if the Drag Image support is available on this platform @@ -249,7 +249,7 @@ public class DragSource implements Serializable { } /** - * Creates a new DragSource. + * Creates a new {@code DragSource}. * * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true @@ -262,28 +262,28 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent + * Start a drag, given the {@code DragGestureEvent} * that initiated the drag, the initial - * Cursor to use, - * the Image to drag, - * the offset of the Image origin - * from the hotspot of the Cursor at + * {@code Cursor} to use, + * the {@code Image} to drag, + * the offset of the {@code Image} origin + * from the hotspot of the {@code Cursor} at * the instant of the trigger, - * the Transferable subject data - * of the drag, the DragSourceListener, - * and the FlavorMap. + * the {@code Transferable} subject data + * of the drag, the {@code DragSourceListener}, + * and the {@code FlavorMap}. * - * @param trigger the DragGestureEvent that initiated the drag + * @param trigger the {@code DragGestureEvent} that initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext * for more details on the cursor handling mechanism during drag and drop * @param dragImage the image to drag or {@code null} - * @param imageOffset the offset of the Image origin from the hotspot - * of the Cursor at the instant of the trigger + * @param imageOffset the offset of the {@code Image} origin from the hotspot + * of the {@code Cursor} at the instant of the trigger * @param transferable the subject data of the drag - * @param dsl the DragSourceListener - * @param flavorMap the FlavorMap to use, or null + * @param dsl the {@code DragSourceListener} + * @param flavorMap the {@code FlavorMap} to use, or {@code null} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -322,22 +322,22 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent + * Start a drag, given the {@code DragGestureEvent} * that initiated the drag, the initial - * Cursor to use, - * the Transferable subject data - * of the drag, the DragSourceListener, - * and the FlavorMap. + * {@code Cursor} to use, + * the {@code Transferable} subject data + * of the drag, the {@code DragSourceListener}, + * and the {@code FlavorMap}. * - * @param trigger the DragGestureEvent that + * @param trigger the {@code DragGestureEvent} that * initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext * for more details on the cursor handling mechanism during drag and drop * @param transferable the subject data of the drag - * @param dsl the DragSourceListener - * @param flavorMap the FlavorMap to use or null + * @param dsl the {@code DragSourceListener} + * @param flavorMap the {@code FlavorMap} to use or {@code null} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -355,26 +355,26 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent - * that initiated the drag, the initial Cursor + * Start a drag, given the {@code DragGestureEvent} + * that initiated the drag, the initial {@code Cursor} * to use, - * the Image to drag, - * the offset of the Image origin - * from the hotspot of the Cursor + * the {@code Image} to drag, + * the offset of the {@code Image} origin + * from the hotspot of the {@code Cursor} * at the instant of the trigger, * the subject data of the drag, and - * the DragSourceListener. + * the {@code DragSourceListener}. * - * @param trigger the DragGestureEvent that initiated the drag + * @param trigger the {@code DragGestureEvent} that initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext * for more details on the cursor handling mechanism during drag and drop - * @param dragImage the Image to drag or null - * @param dragOffset the offset of the Image origin from the hotspot - * of the Cursor at the instant of the trigger + * @param dragImage the {@code Image} to drag or {@code null} + * @param dragOffset the offset of the {@code Image} origin from the hotspot + * of the {@code Cursor} at the instant of the trigger * @param transferable the subject data of the drag - * @param dsl the DragSourceListener + * @param dsl the {@code DragSourceListener} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -393,20 +393,20 @@ public class DragSource implements Serializable { } /** - * Start a drag, given the DragGestureEvent + * Start a drag, given the {@code DragGestureEvent} * that initiated the drag, the initial - * Cursor to + * {@code Cursor} to * use, - * the Transferable subject data - * of the drag, and the DragSourceListener. + * the {@code Transferable} subject data + * of the drag, and the {@code DragSourceListener}. * - * @param trigger the DragGestureEvent that initiated the drag + * @param trigger the {@code DragGestureEvent} that initiated the drag * @param dragCursor the initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext class * for more details on the cursor handling mechanism during drag and drop * @param transferable the subject data of the drag - * @param dsl the DragSourceListener + * @param dsl the {@code DragSourceListener} * * @throws java.awt.dnd.InvalidDnDOperationException * if the Drag and Drop @@ -426,46 +426,46 @@ public class DragSource implements Serializable { * Creates the {@code DragSourceContext} to handle the current drag * operation. *

          - * To incorporate a new DragSourceContext - * subclass, subclass DragSource and + * To incorporate a new {@code DragSourceContext} + * subclass, subclass {@code DragSource} and * override this method. *

          - * If dragImage is null, no image is used + * If {@code dragImage} is {@code null}, no image is used * to represent the drag over feedback for this drag operation, but - * NullPointerException is not thrown. + * {@code NullPointerException} is not thrown. *

          - * If dsl is null, no drag source listener - * is registered with the created DragSourceContext, - * but NullPointerException is not thrown. + * If {@code dsl} is {@code null}, no drag source listener + * is registered with the created {@code DragSourceContext}, + * but {@code NullPointerException} is not thrown. * - * @param dgl The DragGestureEvent that triggered the + * @param dgl The {@code DragGestureEvent} that triggered the * drag * @param dragCursor The initial {@code Cursor} for this drag operation * or {@code null} for the default cursor handling; * see DragSourceContext class * for more details on the cursor handling mechanism during drag and drop - * @param dragImage The Image to drag or null - * @param imageOffset The offset of the Image origin from the + * @param dragImage The {@code Image} to drag or {@code null} + * @param imageOffset The offset of the {@code Image} origin from the * hotspot of the cursor at the instant of the trigger * @param t The subject data of the drag - * @param dsl The DragSourceListener + * @param dsl The {@code DragSourceListener} * - * @return the DragSourceContext + * @return the {@code DragSourceContext} * - * @throws NullPointerException if dscp is null - * @throws NullPointerException if dgl is null - * @throws NullPointerException if dragImage is not - * null and imageOffset is null - * @throws NullPointerException if t is null - * @throws IllegalArgumentException if the Component - * associated with the trigger event is null. - * @throws IllegalArgumentException if the DragSource for the - * trigger event is null. + * @throws NullPointerException if {@code dscp} is {@code null} + * @throws NullPointerException if {@code dgl} is {@code null} + * @throws NullPointerException if {@code dragImage} is not + * {@code null} and {@code imageOffset} is {@code null} + * @throws NullPointerException if {@code t} is {@code null} + * @throws IllegalArgumentException if the {@code Component} + * associated with the trigger event is {@code null}. + * @throws IllegalArgumentException if the {@code DragSource} for the + * trigger event is {@code null}. * @throws IllegalArgumentException if the drag action for the - * trigger event is DnDConstants.ACTION_NONE. + * trigger event is {@code DnDConstants.ACTION_NONE}. * @throws IllegalArgumentException if the source actions for the - * DragGestureRecognizer associated with the trigger - * event are equal to DnDConstants.ACTION_NONE. + * {@code DragGestureRecognizer} associated with the trigger + * event are equal to {@code DnDConstants.ACTION_NONE}. */ protected DragSourceContext createDragSourceContext(DragGestureEvent dgl, @@ -479,33 +479,33 @@ public class DragSource implements Serializable { /** * This method returns the - * FlavorMap for this DragSource. + * {@code FlavorMap} for this {@code DragSource}. * - * @return the FlavorMap for this DragSource + * @return the {@code FlavorMap} for this {@code DragSource} */ public FlavorMap getFlavorMap() { return flavorMap; } /** - * Creates a new DragGestureRecognizer + * Creates a new {@code DragGestureRecognizer} * that implements the specified * abstract subclass of - * DragGestureRecognizer, and - * sets the specified Component - * and DragGestureListener on + * {@code DragGestureRecognizer}, and + * sets the specified {@code Component} + * and {@code DragGestureListener} on * the newly created object. * * @param the type of {@code DragGestureRecognizer} to create * @param recognizerAbstractClass the requested abstract type * @param actions the permitted source drag actions - * @param c the Component target - * @param dgl the DragGestureListener to notify + * @param c the {@code Component} target + * @param dgl the {@code DragGestureListener} to notify * - * @return the new DragGestureRecognizer or null - * if the Toolkit.createDragGestureRecognizer method + * @return the new {@code DragGestureRecognizer} or {@code null} + * if the {@code Toolkit.createDragGestureRecognizer} method * has no implementation available for - * the requested DragGestureRecognizer - * subclass and returns null + * the requested {@code DragGestureRecognizer} + * subclass and returns {@code null} */ public T @@ -518,26 +518,26 @@ public class DragSource implements Serializable { /** - * Creates a new DragGestureRecognizer + * Creates a new {@code DragGestureRecognizer} * that implements the default - * abstract subclass of DragGestureRecognizer - * for this DragSource, - * and sets the specified Component - * and DragGestureListener on the + * abstract subclass of {@code DragGestureRecognizer} + * for this {@code DragSource}, + * and sets the specified {@code Component} + * and {@code DragGestureListener} on the * newly created object. * - * For this DragSource - * the default is MouseDragGestureRecognizer. + * For this {@code DragSource} + * the default is {@code MouseDragGestureRecognizer}. * - * @param c the Component target for the recognizer + * @param c the {@code Component} target for the recognizer * @param actions the permitted source actions - * @param dgl the DragGestureListener to notify + * @param dgl the {@code DragGestureListener} to notify * - * @return the new DragGestureRecognizer or null - * if the Toolkit.createDragGestureRecognizer method + * @return the new {@code DragGestureRecognizer} or {@code null} + * if the {@code Toolkit.createDragGestureRecognizer} method * has no implementation available for - * the requested DragGestureRecognizer - * subclass and returns null + * the requested {@code DragGestureRecognizer} + * subclass and returns {@code null} */ public DragGestureRecognizer createDefaultDragGestureRecognizer(Component c, int actions, DragGestureListener dgl) { @@ -545,13 +545,13 @@ public class DragSource implements Serializable { } /** - * Adds the specified DragSourceListener to this - * DragSource to receive drag source events during drag - * operations initiated with this DragSource. - * If a null listener is specified, no action is taken and no + * Adds the specified {@code DragSourceListener} to this + * {@code DragSource} to receive drag source events during drag + * operations initiated with this {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * - * @param dsl the DragSourceListener to add + * @param dsl the {@code DragSourceListener} to add * * @see #removeDragSourceListener * @see #getDragSourceListeners @@ -566,15 +566,15 @@ public class DragSource implements Serializable { } /** - * Removes the specified DragSourceListener from this - * DragSource. - * If a null listener is specified, no action is taken and no + * Removes the specified {@code DragSourceListener} from this + * {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * If the listener specified by the argument was not previously added to - * this DragSource, no action is taken and no exception + * this {@code DragSource}, no action is taken and no exception * is thrown. * - * @param dsl the DragSourceListener to remove + * @param dsl the {@code DragSourceListener} to remove * * @see #addDragSourceListener * @see #getDragSourceListeners @@ -589,11 +589,11 @@ public class DragSource implements Serializable { } /** - * Gets all the DragSourceListeners - * registered with this DragSource. + * Gets all the {@code DragSourceListener}s + * registered with this {@code DragSource}. * - * @return all of this DragSource's - * DragSourceListeners or an empty array if no + * @return all of this {@code DragSource}'s + * {@code DragSourceListener}s or an empty array if no * such listeners are currently registered * * @see #addDragSourceListener @@ -605,13 +605,13 @@ public class DragSource implements Serializable { } /** - * Adds the specified DragSourceMotionListener to this - * DragSource to receive drag motion events during drag - * operations initiated with this DragSource. - * If a null listener is specified, no action is taken and no + * Adds the specified {@code DragSourceMotionListener} to this + * {@code DragSource} to receive drag motion events during drag + * operations initiated with this {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * - * @param dsml the DragSourceMotionListener to add + * @param dsml the {@code DragSourceMotionListener} to add * * @see #removeDragSourceMotionListener * @see #getDragSourceMotionListeners @@ -626,15 +626,15 @@ public class DragSource implements Serializable { } /** - * Removes the specified DragSourceMotionListener from this - * DragSource. - * If a null listener is specified, no action is taken and no + * Removes the specified {@code DragSourceMotionListener} from this + * {@code DragSource}. + * If a {@code null} listener is specified, no action is taken and no * exception is thrown. * If the listener specified by the argument was not previously added to - * this DragSource, no action is taken and no exception + * this {@code DragSource}, no action is taken and no exception * is thrown. * - * @param dsml the DragSourceMotionListener to remove + * @param dsml the {@code DragSourceMotionListener} to remove * * @see #addDragSourceMotionListener * @see #getDragSourceMotionListeners @@ -649,11 +649,11 @@ public class DragSource implements Serializable { } /** - * Gets all of the DragSourceMotionListeners - * registered with this DragSource. + * Gets all of the {@code DragSourceMotionListener}s + * registered with this {@code DragSource}. * - * @return all of this DragSource's - * DragSourceMotionListeners or an empty array if no + * @return all of this {@code DragSource}'s + * {@code DragSourceMotionListener}s or an empty array if no * such listeners are currently registered * * @see #addDragSourceMotionListener @@ -666,21 +666,21 @@ public class DragSource implements Serializable { /** * Gets all the objects currently registered as - * FooListeners upon this DragSource. + * FooListeners upon this {@code DragSource}. * FooListeners are registered using the * addFooListener method. * * @param the type of listener objects * @param listenerType the type of listeners requested; this parameter * should specify an interface that descends from - * java.util.EventListener + * {@code java.util.EventListener} * @return an array of all objects registered as * FooListeners on this - * DragSource, or an empty array if no such listeners + * {@code DragSource}, or an empty array if no such listeners * have been added - * @exception ClassCastException if listenerType + * @exception ClassCastException if {@code listenerType} * doesn't specify a class or interface that implements - * java.util.EventListener + * {@code java.util.EventListener} * * @see #getDragSourceListeners * @see #getDragSourceMotionListeners @@ -697,12 +697,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragEnter on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dragEnter} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void processDragEnter(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -712,12 +712,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragOver on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dragOver} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void processDragOver(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -727,12 +727,12 @@ public class DragSource implements Serializable { } /** - * This method calls dropActionChanged on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dropActionChanged} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void processDropActionChanged(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -742,12 +742,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragExit on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceEvent. + * This method calls {@code dragExit} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceEvent}. * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ void processDragExit(DragSourceEvent dse) { DragSourceListener dsl = listener; @@ -757,12 +757,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragDropEnd on the - * DragSourceListeners registered with this - * DragSource, and passes them the specified - * DragSourceDropEvent. + * This method calls {@code dragDropEnd} on the + * {@code DragSourceListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDropEvent}. * - * @param dsde the DragSourceEvent + * @param dsde the {@code DragSourceEvent} */ void processDragDropEnd(DragSourceDropEvent dsde) { DragSourceListener dsl = listener; @@ -772,12 +772,12 @@ public class DragSource implements Serializable { } /** - * This method calls dragMouseMoved on the - * DragSourceMotionListeners registered with this - * DragSource, and passes them the specified - * DragSourceDragEvent. + * This method calls {@code dragMouseMoved} on the + * {@code DragSourceMotionListener}s registered with this + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceEvent + * @param dsde the {@code DragSourceEvent} */ void processDragMouseMoved(DragSourceDragEvent dsde) { DragSourceMotionListener dsml = motionListener; @@ -787,33 +787,33 @@ public class DragSource implements Serializable { } /** - * Serializes this DragSource. This method first performs + * Serializes this {@code DragSource}. This method first performs * default serialization. Next, it writes out this object's - * FlavorMap if and only if it can be serialized. If not, - * null is written instead. Next, it writes out - * Serializable listeners registered with this - * object. Listeners are written in a null-terminated sequence - * of 0 or more pairs. The pair consists of a String and an - * Object; the String indicates the type of the - * Object and is one of the following: + * {@code FlavorMap} if and only if it can be serialized. If not, + * {@code null} is written instead. Next, it writes out + * {@code Serializable} listeners registered with this + * object. Listeners are written in a {@code null}-terminated sequence + * of 0 or more pairs. The pair consists of a {@code String} and an + * {@code Object}; the {@code String} indicates the type of the + * {@code Object} and is one of the following: *

            - *
          • dragSourceListenerK indicating a - * DragSourceListener object; - *
          • dragSourceMotionListenerK indicating a - * DragSourceMotionListener object. + *
          • {@code dragSourceListenerK} indicating a + * {@code DragSourceListener} object; + *
          • {@code dragSourceMotionListenerK} indicating a + * {@code DragSourceMotionListener} object. *
          * - * @serialData Either a FlavorMap instance, or - * null, followed by a null-terminated + * @serialData Either a {@code FlavorMap} instance, or + * {@code null}, followed by a {@code null}-terminated * sequence of 0 or more pairs; the pair consists of a - * String and an Object; the - * String indicates the type of the Object + * {@code String} and an {@code Object}; the + * {@code String} indicates the type of the {@code Object} * and is one of the following: *
            - *
          • dragSourceListenerK indicating a - * DragSourceListener object; - *
          • dragSourceMotionListenerK indicating a - * DragSourceMotionListener object. + *
          • {@code dragSourceListenerK} indicating a + * {@code DragSourceListener} object; + *
          • {@code dragSourceMotionListenerK} indicating a + * {@code DragSourceMotionListener} object. *
          . * @since 1.4 */ @@ -828,24 +828,24 @@ public class DragSource implements Serializable { } /** - * Deserializes this DragSource. This method first performs - * default deserialization. Next, this object's FlavorMap is + * Deserializes this {@code DragSource}. This method first performs + * default deserialization. Next, this object's {@code FlavorMap} is * deserialized by using the next object in the stream. - * If the resulting FlavorMap is null, this - * object's FlavorMap is set to the default FlavorMap for - * this thread's ClassLoader. + * If the resulting {@code FlavorMap} is {@code null}, this + * object's {@code FlavorMap} is set to the default FlavorMap for + * this thread's {@code ClassLoader}. * Next, this object's listeners are deserialized by reading a - * null-terminated sequence of 0 or more key/value pairs + * {@code null}-terminated sequence of 0 or more key/value pairs * from the stream: *
            - *
          • If a key object is a String equal to - * dragSourceListenerK, a DragSourceListener is + *
          • If a key object is a {@code String} equal to + * {@code dragSourceListenerK}, a {@code DragSourceListener} is * deserialized using the corresponding value object and added to this - * DragSource. - *
          • If a key object is a String equal to - * dragSourceMotionListenerK, a - * DragSourceMotionListener is deserialized using the - * corresponding value object and added to this DragSource. + * {@code DragSource}. + *
          • If a key object is a {@code String} equal to + * {@code dragSourceMotionListenerK}, a + * {@code DragSourceMotionListener} is deserialized using the + * corresponding value object and added to this {@code DragSource}. *
          • Otherwise, the key/value pair is skipped. *
          * @@ -884,13 +884,13 @@ public class DragSource implements Serializable { * Returns the drag gesture motion threshold. The drag gesture motion threshold * defines the recommended behavior for {@link MouseDragGestureRecognizer}s. *

          - * If the system property awt.dnd.drag.threshold is set to + * If the system property {@code awt.dnd.drag.threshold} is set to * a positive integer, this method returns the value of the system property; * otherwise if a pertinent desktop property is available and supported by * the implementation of the Java platform, this method returns the value of * that property; otherwise this method returns some default value. * The pertinent desktop property can be queried using - * java.awt.Toolkit.getDesktopProperty("DnD.gestureMotionThreshold"). + * {@code java.awt.Toolkit.getDesktopProperty("DnD.gestureMotionThreshold")}. * * @return the drag gesture motion threshold * @see MouseDragGestureRecognizer diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java index 1d406819074..9470c5990bc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.java @@ -30,22 +30,22 @@ package java.awt.dnd; * this class are empty. This class exists only as a convenience for creating * listener objects. *

          - * Extend this class to create a DragSourceEvent listener + * Extend this class to create a {@code DragSourceEvent} listener * and override the methods for the events of interest. (If you implement the - * DragSourceListener interface, you have to define all of + * {@code DragSourceListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you only have to define methods for events you care about.) *

          * Create a listener object using the extended class and then register it with - * a DragSource. When the drag enters, moves over, or exits + * a {@code DragSource}. When the drag enters, moves over, or exits * a drop site, when the drop action changes, and when the drag ends, the * relevant method in the listener object is invoked, and the - * DragSourceEvent is passed to it. + * {@code DragSourceEvent} is passed to it. *

          - * The drop site is associated with the previous dragEnter() - * invocation if the latest invocation of dragEnter() on this + * The drop site is associated with the previous {@code dragEnter()} + * invocation if the latest invocation of {@code dragEnter()} on this * adapter corresponds to that drop site and is not followed by a - * dragExit() invocation on this adapter. + * {@code dragExit()} invocation on this adapter. * * @see DragSourceEvent * @see DragSourceListener @@ -67,7 +67,7 @@ public abstract class DragSourceAdapter *

        • The drop site accepts the drag. *
        * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragEnter(DragSourceDragEvent dsde) {} @@ -82,14 +82,14 @@ public abstract class DragSourceAdapter *
      • The drop site accepts the drag. *
      * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragOver(DragSourceDragEvent dsde) {} /** * Called whenever the mouse is moved during a drag operation. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragMouseMoved(DragSourceDragEvent dsde) {} @@ -100,7 +100,7 @@ public abstract class DragSourceAdapter * Such devices are typically the mouse buttons or keyboard * modifiers that the user is interacting with. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dropActionChanged(DragSourceDragEvent dsde) {} @@ -122,21 +122,21 @@ public abstract class DragSourceAdapter * has rejected the drag. * * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ public void dragExit(DragSourceEvent dse) {} /** * This method is invoked to signify that the Drag and Drop * operation is complete. The getDropSuccess() method of - * the DragSourceDropEvent can be used to + * the {@code DragSourceDropEvent} can be used to * determine the termination state. The getDropAction() method * returns the operation that the drop site selected * to apply to the Drop operation. Once this method is complete, the - * current DragSourceContext and + * current {@code DragSourceContext} and * associated resources become invalid. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ public void dragDropEnd(DragSourceDropEvent dsde) {} } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java index 7e0d0030175..7d858548ddb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java @@ -46,22 +46,22 @@ import sun.awt.AWTAccessor; import sun.awt.ComponentFactory; /** - * The DragSourceContext class is responsible for managing the + * The {@code DragSourceContext} class is responsible for managing the * initiator side of the Drag and Drop protocol. In particular, it is responsible * for managing drag event notifications to the * {@linkplain DragSourceListener DragSourceListeners} * and {@linkplain DragSourceMotionListener DragSourceMotionListeners}, and providing the * {@link Transferable} representing the source data for the drag operation. *

      - * Note that the DragSourceContext itself - * implements the DragSourceListener and - * DragSourceMotionListener interfaces. + * Note that the {@code DragSourceContext} itself + * implements the {@code DragSourceListener} and + * {@code DragSourceMotionListener} interfaces. * This is to allow the platform peer * (the {@link DragSourceContextPeer} instance) * created by the {@link DragSource} to notify - * the DragSourceContext of + * the {@code DragSourceContext} of * state changes in the ongoing operation. This allows the - * DragSourceContext object to interpose + * {@code DragSourceContext} object to interpose * itself between the platform and the * listeners provided by the initiator of the drag operation. *

      @@ -97,28 +97,28 @@ public class DragSourceContext // used by updateCurrentCursor /** - * An int used by updateCurrentCursor() - * indicating that the Cursor should change - * to the default (no drop) Cursor. + * An {@code int} used by updateCurrentCursor() + * indicating that the {@code Cursor} should change + * to the default (no drop) {@code Cursor}. */ protected static final int DEFAULT = 0; /** - * An int used by updateCurrentCursor() - * indicating that the Cursor - * has entered a DropTarget. + * An {@code int} used by updateCurrentCursor() + * indicating that the {@code Cursor} + * has entered a {@code DropTarget}. */ protected static final int ENTER = 1; /** - * An int used by updateCurrentCursor() - * indicating that the Cursor is - * over a DropTarget. + * An {@code int} used by updateCurrentCursor() + * indicating that the {@code Cursor} is + * over a {@code DropTarget}. */ protected static final int OVER = 2; /** - * An int used by updateCurrentCursor() + * An {@code int} used by updateCurrentCursor() * indicating that the user operation has changed. */ @@ -129,35 +129,35 @@ public class DragSourceContext } /** - * Called from DragSource, this constructor creates a new - * DragSourceContext given the - * DragSourceContextPeer for this Drag, the - * DragGestureEvent that triggered the Drag, the initial - * Cursor to use for the Drag, an (optional) - * Image to display while the Drag is taking place, the offset - * of the Image origin from the hotspot at the instant of the - * triggering event, the Transferable subject data, and the - * DragSourceListener to use during the Drag and Drop + * Called from {@code DragSource}, this constructor creates a new + * {@code DragSourceContext} given the + * {@code DragSourceContextPeer} for this Drag, the + * {@code DragGestureEvent} that triggered the Drag, the initial + * {@code Cursor} to use for the Drag, an (optional) + * {@code Image} to display while the Drag is taking place, the offset + * of the {@code Image} origin from the hotspot at the instant of the + * triggering event, the {@code Transferable} subject data, and the + * {@code DragSourceListener} to use during the Drag and Drop * operation. *
      - * If DragSourceContextPeer is null - * NullPointerException is thrown. + * If {@code DragSourceContextPeer} is {@code null} + * {@code NullPointerException} is thrown. *
      - * If DragGestureEvent is null - * NullPointerException is thrown. + * If {@code DragGestureEvent} is {@code null} + * {@code NullPointerException} is thrown. *
      - * If Cursor is null no exception is thrown and + * If {@code Cursor} is {@code null} no exception is thrown and * the default drag cursor behavior is activated for this drag operation. *
      - * If Image is null no exception is thrown. + * If {@code Image} is {@code null} no exception is thrown. *
      - * If Image is not null and the offset is - * null NullPointerException is thrown. + * If {@code Image} is not {@code null} and the offset is + * {@code null NullPointerException} is thrown. *
      - * If Transferable is null - * NullPointerException is thrown. + * If {@code Transferable} is {@code null} + * {@code NullPointerException} is thrown. *
      - * If DragSourceListener is null no exception + * If {@code DragSourceListener} is {@code null} no exception * is thrown. * * @param trigger the triggering event @@ -165,21 +165,21 @@ public class DragSourceContext * or {@code null} for the default cursor handling; * see class level documentation * for more details on the cursor handling mechanism during drag and drop - * @param dragImage the Image to drag (or null) + * @param dragImage the {@code Image} to drag (or {@code null}) * @param offset the offset of the image origin from the hotspot at the * instant of the triggering event - * @param t the Transferable - * @param dsl the DragSourceListener + * @param t the {@code Transferable} + * @param dsl the {@code DragSourceListener} * - * @throws IllegalArgumentException if the Component associated - * with the trigger event is null. - * @throws IllegalArgumentException if the DragSource for the - * trigger event is null. + * @throws IllegalArgumentException if the {@code Component} associated + * with the trigger event is {@code null}. + * @throws IllegalArgumentException if the {@code DragSource} for the + * trigger event is {@code null}. * @throws IllegalArgumentException if the drag action for the - * trigger event is DnDConstants.ACTION_NONE. + * trigger event is {@code DnDConstants.ACTION_NONE}. * @throws IllegalArgumentException if the source actions for the - * DragGestureRecognizer associated with the trigger - * event are equal to DnDConstants.ACTION_NONE. + * {@code DragGestureRecognizer} associated with the trigger + * event are equal to {@code DnDConstants.ACTION_NONE}. * @throws NullPointerException if dscp, trigger, or t are null, or * if dragImage is non-null and offset is null */ @@ -240,26 +240,26 @@ public class DragSourceContext } /** - * Returns the DragSource - * that instantiated this DragSourceContext. + * Returns the {@code DragSource} + * that instantiated this {@code DragSourceContext}. * - * @return the DragSource that - * instantiated this DragSourceContext + * @return the {@code DragSource} that + * instantiated this {@code DragSourceContext} */ public DragSource getDragSource() { return trigger.getDragSource(); } /** - * Returns the Component associated with this - * DragSourceContext. + * Returns the {@code Component} associated with this + * {@code DragSourceContext}. * - * @return the Component that started the drag + * @return the {@code Component} that started the drag */ public Component getComponent() { return trigger.getComponent(); } /** - * Returns the DragGestureEvent + * Returns the {@code DragGestureEvent} * that initially triggered the drag. * * @return the Event that triggered the drag @@ -268,9 +268,9 @@ public class DragSourceContext public DragGestureEvent getTrigger() { return trigger; } /** - * Returns a bitwise mask of DnDConstants that + * Returns a bitwise mask of {@code DnDConstants} that * represent the set of drop actions supported by the drag source for the - * drag operation associated with this DragSourceContext. + * drag operation associated with this {@code DragSourceContext}. * * @return the drop actions supported by the drag source */ @@ -280,8 +280,8 @@ public class DragSourceContext /** * Sets the cursor for this drag operation to the specified - * Cursor. If the specified Cursor - * is null, the default drag cursor behavior is + * {@code Cursor}. If the specified {@code Cursor} + * is {@code null}, the default drag cursor behavior is * activated for this drag operation, otherwise it is deactivated. * * @param c the initial {@code Cursor} for this drag operation, @@ -298,25 +298,25 @@ public class DragSourceContext } /** - * Returns the current drag Cursor. + * Returns the current drag {@code Cursor}. * - * @return the current drag Cursor + * @return the current drag {@code Cursor} */ public Cursor getCursor() { return cursor; } /** - * Add a DragSourceListener to this - * DragSourceContext if one has not already been added. - * If a DragSourceListener already exists, - * this method throws a TooManyListenersException. + * Add a {@code DragSourceListener} to this + * {@code DragSourceContext} if one has not already been added. + * If a {@code DragSourceListener} already exists, + * this method throws a {@code TooManyListenersException}. * - * @param dsl the DragSourceListener to add. - * Note that while null is not prohibited, + * @param dsl the {@code DragSourceListener} to add. + * Note that while {@code null} is not prohibited, * it is not acceptable as a parameter. * * @throws TooManyListenersException if - * a DragSourceListener has already been added + * a {@code DragSourceListener} has already been added */ public synchronized void addDragSourceListener(DragSourceListener dsl) throws TooManyListenersException { @@ -331,11 +331,11 @@ public class DragSourceContext } /** - * Removes the specified DragSourceListener - * from this DragSourceContext. + * Removes the specified {@code DragSourceListener} + * from this {@code DragSourceContext}. * - * @param dsl the DragSourceListener to remove; - * note that while null is not prohibited, + * @param dsl the {@code DragSourceListener} to remove; + * note that while {@code null} is not prohibited, * it is not acceptable as a parameter */ @@ -347,8 +347,8 @@ public class DragSourceContext } /** - * Notifies the peer that the Transferable's - * DataFlavors have changed. + * Notifies the peer that the {@code Transferable}'s + * {@code DataFlavor}s have changed. */ public void transferablesFlavorsChanged() { @@ -356,13 +356,13 @@ public class DragSourceContext } /** - * Calls dragEnter on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDragEvent. + * Calls {@code dragEnter} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragEnter(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -375,13 +375,13 @@ public class DragSourceContext } /** - * Calls dragOver on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDragEvent. + * Calls {@code dragOver} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dragOver(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -394,13 +394,13 @@ public class DragSourceContext } /** - * Calls dragExit on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceEvent. + * Calls {@code dragExit} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceEvent}. * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ public void dragExit(DragSourceEvent dse) { DragSourceListener dsl = listener; @@ -413,13 +413,13 @@ public class DragSourceContext } /** - * Calls dropActionChanged on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDragEvent. + * Calls {@code dropActionChanged} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ public void dropActionChanged(DragSourceDragEvent dsde) { DragSourceListener dsl = listener; @@ -432,13 +432,13 @@ public class DragSourceContext } /** - * Calls dragDropEnd on the - * DragSourceListeners registered with this - * DragSourceContext and with the associated - * DragSource, and passes them the specified - * DragSourceDropEvent. + * Calls {@code dragDropEnd} on the + * {@code DragSourceListener}s registered with this + * {@code DragSourceContext} and with the associated + * {@code DragSource}, and passes them the specified + * {@code DragSourceDropEvent}. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ public void dragDropEnd(DragSourceDropEvent dsde) { DragSourceListener dsl = listener; @@ -449,13 +449,13 @@ public class DragSourceContext } /** - * Calls dragMouseMoved on the - * DragSourceMotionListeners registered with the - * DragSource associated with this - * DragSourceContext, and them passes the specified - * DragSourceDragEvent. + * Calls {@code dragMouseMoved} on the + * {@code DragSourceMotionListener}s registered with the + * {@code DragSource} associated with this + * {@code DragSourceContext}, and them passes the specified + * {@code DragSourceDragEvent}. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} * @since 1.4 */ public void dragMouseMoved(DragSourceDragEvent dsde) { @@ -463,10 +463,10 @@ public class DragSourceContext } /** - * Returns the Transferable associated with - * this DragSourceContext. + * Returns the {@code Transferable} associated with + * this {@code DragSourceContext}. * - * @return the Transferable + * @return the {@code Transferable} */ public Transferable getTransferable() { return transferable; } @@ -478,9 +478,9 @@ public class DragSourceContext * * @param sourceAct the actions supported by the drag source * @param targetAct the drop target action - * @param status one of the fields DEFAULT, - * ENTER, OVER, - * CHANGED + * @param status one of the fields {@code DEFAULT}, + * {@code ENTER}, {@code OVER}, + * {@code CHANGED} */ @SuppressWarnings("fallthrough") protected synchronized void updateCurrentCursor(int sourceAct, int targetAct, int status) { @@ -532,21 +532,21 @@ public class DragSourceContext } /** - * Serializes this DragSourceContext. This method first + * Serializes this {@code DragSourceContext}. This method first * performs default serialization. Next, this object's - * Transferable is written out if and only if it can be - * serialized. If not, null is written instead. In this case, - * a DragSourceContext created from the resulting deserialized - * stream will contain a dummy Transferable which supports no - * DataFlavors. Finally, this object's - * DragSourceListener is written out if and only if it can be - * serialized. If not, null is written instead. + * {@code Transferable} is written out if and only if it can be + * serialized. If not, {@code null} is written instead. In this case, + * a {@code DragSourceContext} created from the resulting deserialized + * stream will contain a dummy {@code Transferable} which supports no + * {@code DataFlavor}s. Finally, this object's + * {@code DragSourceListener} is written out if and only if it can be + * serialized. If not, {@code null} is written instead. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a Transferable instance, or - * null, followed by either a - * DragSourceListener instance, or - * null. + * followed by either a {@code Transferable} instance, or + * {@code null}, followed by either a + * {@code DragSourceListener} instance, or + * {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -559,14 +559,14 @@ public class DragSourceContext } /** - * Deserializes this DragSourceContext. This method first - * performs default deserialization for all non-transient - * fields. This object's Transferable and - * DragSourceListener are then deserialized as well by using + * Deserializes this {@code DragSourceContext}. This method first + * performs default deserialization for all non-{@code transient} + * fields. This object's {@code Transferable} and + * {@code DragSourceListener} are then deserialized as well by using * the next two objects in the stream. If the resulting - * Transferable is null, this object's - * Transferable is set to a dummy Transferable - * which supports no DataFlavors. + * {@code Transferable} is {@code null}, this object's + * {@code Transferable} is set to a dummy {@code Transferable} + * which supports no {@code DataFlavor}s. * * @since 1.4 */ @@ -654,7 +654,7 @@ public class DragSourceContext private transient DragSourceListener listener; /** - * true if the custom drag cursor is used instead of the + * {@code true} if the custom drag cursor is used instead of the * default one. * * @serial @@ -662,9 +662,9 @@ public class DragSourceContext private boolean useCustomCursor; /** - * A bitwise mask of DnDConstants that represents the set of + * A bitwise mask of {@code DnDConstants} that represents the set of * drop actions supported by the drag source for the drag operation associated - * with this DragSourceContext. + * with this {@code DragSourceContext.} * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java index 63e60d92a20..b8d89d2b575 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDragEvent.java @@ -28,19 +28,19 @@ package java.awt.dnd; import java.awt.event.InputEvent; /** - * The DragSourceDragEvent is - * delivered from the DragSourceContextPeer, - * via the DragSourceContext, to the DragSourceListener - * registered with that DragSourceContext and with its associated - * DragSource. + * The {@code DragSourceDragEvent} is + * delivered from the {@code DragSourceContextPeer}, + * via the {@code DragSourceContext}, to the {@code DragSourceListener} + * registered with that {@code DragSourceContext} and with its associated + * {@code DragSource}. *

      - * The DragSourceDragEvent reports the target drop action + * The {@code DragSourceDragEvent} reports the target drop action * and the user drop action that reflect the current state of * the drag operation. *

      - * Target drop action is one of DnDConstants that represents + * Target drop action is one of {@code DnDConstants} that represents * the drop action selected by the current drop target if this drop action is - * supported by the drag source or DnDConstants.ACTION_NONE if this + * supported by the drag source or {@code DnDConstants.ACTION_NONE} if this * drop action is not supported by the drag source. *

      * User drop action depends on the drop actions supported by the drag @@ -52,18 +52,18 @@ import java.awt.event.InputEvent; * Shift -> ACTION_MOVE * * If the user selects a drop action, the user drop action is one of - * DnDConstants that represents the selected drop action if this + * {@code DnDConstants} that represents the selected drop action if this * drop action is supported by the drag source or - * DnDConstants.ACTION_NONE if this drop action is not supported + * {@code DnDConstants.ACTION_NONE} if this drop action is not supported * by the drag source. *

      * If the user doesn't select a drop action, the set of - * DnDConstants that represents the set of drop actions supported - * by the drag source is searched for DnDConstants.ACTION_MOVE, - * then for DnDConstants.ACTION_COPY, then for - * DnDConstants.ACTION_LINK and the user drop action is the + * {@code DnDConstants} that represents the set of drop actions supported + * by the drag source is searched for {@code DnDConstants.ACTION_MOVE}, + * then for {@code DnDConstants.ACTION_COPY}, then for + * {@code DnDConstants.ACTION_LINK} and the user drop action is the * first constant found. If no constant is found the user drop action - * is DnDConstants.ACTION_NONE. + * is {@code DnDConstants.ACTION_NONE}. * * @since 1.2 * @@ -74,25 +74,25 @@ public class DragSourceDragEvent extends DragSourceEvent { private static final long serialVersionUID = 481346297933902471L; /** - * Constructs a DragSourceDragEvent. + * Constructs a {@code DragSourceDragEvent}. * This class is typically - * instantiated by the DragSourceContextPeer + * instantiated by the {@code DragSourceContextPeer} * rather than directly * by client code. - * The coordinates for this DragSourceDragEvent - * are not specified, so getLocation will return - * null for this event. + * The coordinates for this {@code DragSourceDragEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. *

      - * The arguments dropAction and action should - * be one of DnDConstants that represents a single action. - * The argument modifiers should be either a bitwise mask - * of old java.awt.event.InputEvent.*_MASK constants or a - * bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK + * The arguments {@code dropAction} and {@code action} should + * be one of {@code DnDConstants} that represents a single action. + * The argument {@code modifiers} should be either a bitwise mask + * of old {@code java.awt.event.InputEvent.*_MASK} constants or a + * bitwise mask of extended {@code java.awt.event.InputEvent.*_DOWN_MASK} * constants. - * This constructor does not throw any exception for invalid dropAction, - * action and modifiers. + * This constructor does not throw any exception for invalid {@code dropAction}, + * {@code action} and {@code modifiers}. * - * @param dsc the DragSourceContext that is to manage + * @param dsc the {@code DragSourceContext} that is to manage * notifications for this event. * @param dropAction the user drop action. * @param action the target drop action. @@ -103,7 +103,7 @@ public class DragSourceDragEvent extends DragSourceEvent { * in one event. Use of the extended modifiers is * preferred. * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see java.awt.event.InputEvent * @see DragSourceEvent#getLocation @@ -128,20 +128,20 @@ public class DragSourceDragEvent extends DragSourceEvent { } /** - * Constructs a DragSourceDragEvent given the specified - * DragSourceContext, user drop action, target drop action, + * Constructs a {@code DragSourceDragEvent} given the specified + * {@code DragSourceContext}, user drop action, target drop action, * modifiers and coordinates. *

      - * The arguments dropAction and action should - * be one of DnDConstants that represents a single action. - * The argument modifiers should be either a bitwise mask - * of old java.awt.event.InputEvent.*_MASK constants or a - * bitwise mask of extended java.awt.event.InputEvent.*_DOWN_MASK + * The arguments {@code dropAction} and {@code action} should + * be one of {@code DnDConstants} that represents a single action. + * The argument {@code modifiers} should be either a bitwise mask + * of old {@code java.awt.event.InputEvent.*_MASK} constants or a + * bitwise mask of extended {@code java.awt.event.InputEvent.*_DOWN_MASK} * constants. - * This constructor does not throw any exception for invalid dropAction, - * action and modifiers. + * This constructor does not throw any exception for invalid {@code dropAction}, + * {@code action} and {@code modifiers}. * - * @param dsc the DragSourceContext associated with this + * @param dsc the {@code DragSourceContext} associated with this * event. * @param dropAction the user drop action. * @param action the target drop action. @@ -154,7 +154,7 @@ public class DragSourceDragEvent extends DragSourceEvent { * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see java.awt.event.InputEvent * @since 1.4 @@ -192,12 +192,12 @@ public class DragSourceDragEvent extends DragSourceEvent { ((InputEvent.ALT_GRAPH_DOWN_MASK << 1) - 1) & ~JDK_1_3_MODIFIERS; /** - * This method returns an int representing + * This method returns an {@code int} representing * the current state of the input device modifiers * associated with the user's gesture. Typically these * would be mouse buttons or keyboard modifiers. *

      - * If the modifiers passed to the constructor + * If the {@code modifiers} passed to the constructor * are invalid, this method returns them unchanged. * * @return the current state of the input device modifiers @@ -208,12 +208,12 @@ public class DragSourceDragEvent extends DragSourceEvent { } /** - * This method returns an int representing + * This method returns an {@code int} representing * the current state of the input device extended modifiers * associated with the user's gesture. * See {@link InputEvent#getModifiersEx} *

      - * If the modifiers passed to the constructor + * If the {@code modifiers} passed to the constructor * are invalid, this method returns them unchanged. * * @return the current state of the input device extended modifiers @@ -270,7 +270,7 @@ public class DragSourceDragEvent extends DragSourceEvent { private int gestureModifiers = 0; /** - * Indicates whether the gestureModifiers are invalid. + * Indicates whether the {@code gestureModifiers} are invalid. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java index f31e3d233dc..84317613ddc 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceDropEvent.java @@ -26,12 +26,12 @@ package java.awt.dnd; /** - * The DragSourceDropEvent is delivered - * from the DragSourceContextPeer, - * via the DragSourceContext, to the dragDropEnd - * method of DragSourceListeners registered with that - * DragSourceContext and with its associated - * DragSource. + * The {@code DragSourceDropEvent} is delivered + * from the {@code DragSourceContextPeer}, + * via the {@code DragSourceContext}, to the {@code dragDropEnd} + * method of {@code DragSourceListener}s registered with that + * {@code DragSourceContext} and with its associated + * {@code DragSource}. * It contains sufficient information for the * originator of the operation * to provide appropriate feedback to the end user @@ -45,24 +45,24 @@ public class DragSourceDropEvent extends DragSourceEvent { private static final long serialVersionUID = -5571321229470821891L; /** - * Construct a DragSourceDropEvent for a drop, + * Construct a {@code DragSourceDropEvent} for a drop, * given the - * DragSourceContext, the drop action, - * and a boolean indicating if the drop was successful. - * The coordinates for this DragSourceDropEvent - * are not specified, so getLocation will return - * null for this event. + * {@code DragSourceContext}, the drop action, + * and a {@code boolean} indicating if the drop was successful. + * The coordinates for this {@code DragSourceDropEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. *

      - * The argument action should be one of DnDConstants + * The argument {@code action} should be one of {@code DnDConstants} * that represents a single action. - * This constructor does not throw any exception for invalid action. + * This constructor does not throw any exception for invalid {@code action}. * - * @param dsc the DragSourceContext - * associated with this DragSourceDropEvent + * @param dsc the {@code DragSourceContext} + * associated with this {@code DragSourceDropEvent} * @param action the drop action * @param success a boolean indicating if the drop was successful * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see DragSourceEvent#getLocation */ @@ -75,22 +75,22 @@ public class DragSourceDropEvent extends DragSourceEvent { } /** - * Construct a DragSourceDropEvent for a drop, given the - * DragSourceContext, the drop action, a boolean + * Construct a {@code DragSourceDropEvent} for a drop, given the + * {@code DragSourceContext}, the drop action, a {@code boolean} * indicating if the drop was successful, and coordinates. *

      - * The argument action should be one of DnDConstants + * The argument {@code action} should be one of {@code DnDConstants} * that represents a single action. - * This constructor does not throw any exception for invalid action. + * This constructor does not throw any exception for invalid {@code action}. * - * @param dsc the DragSourceContext - * associated with this DragSourceDropEvent + * @param dsc the {@code DragSourceContext} + * associated with this {@code DragSourceDropEvent} * @param action the drop action * @param success a boolean indicating if the drop was successful * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @since 1.4 */ @@ -103,15 +103,15 @@ public class DragSourceDropEvent extends DragSourceEvent { } /** - * Construct a DragSourceDropEvent + * Construct a {@code DragSourceDropEvent} * for a drag that does not result in a drop. - * The coordinates for this DragSourceDropEvent - * are not specified, so getLocation will return - * null for this event. + * The coordinates for this {@code DragSourceDropEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. * - * @param dsc the DragSourceContext + * @param dsc the {@code DragSourceContext} * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see DragSourceEvent#getLocation */ @@ -123,12 +123,12 @@ public class DragSourceDropEvent extends DragSourceEvent { } /** - * This method returns a boolean indicating + * This method returns a {@code boolean} indicating * if the drop was successful. * - * @return true if the drop target accepted the drop and + * @return {@code true} if the drop target accepted the drop and * successfully performed a drop action; - * false if the drop target rejected the drop or + * {@code false} if the drop target rejected the drop or * if the drop target accepted the drop, but failed to perform * a drop action. */ @@ -136,13 +136,13 @@ public class DragSourceDropEvent extends DragSourceEvent { public boolean getDropSuccess() { return dropSuccess; } /** - * This method returns an int representing + * This method returns an {@code int} representing * the action performed by the target on the subject of the drop. * * @return the action performed by the target on the subject of the drop * if the drop target accepted the drop and the target drop action * is supported by the drag source; otherwise, - * DnDConstants.ACTION_NONE. + * {@code DnDConstants.ACTION_NONE}. */ public int getDropAction() { return dropAction; } @@ -152,7 +152,7 @@ public class DragSourceDropEvent extends DragSourceEvent { */ /** - * true if the drop was successful. + * {@code true} if the drop was successful. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java index b9f55e15170..5a389b0dd08 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceEvent.java @@ -31,23 +31,23 @@ import java.util.EventObject; /** * This class is the base class for - * DragSourceDragEvent and - * DragSourceDropEvent. + * {@code DragSourceDragEvent} and + * {@code DragSourceDropEvent}. *

      - * DragSourceEvents are generated whenever the drag enters, moves + * {@code DragSourceEvent}s are generated whenever the drag enters, moves * over, or exits a drop site, when the drop action changes, and when the drag - * ends. The location for the generated DragSourceEvent specifies + * ends. The location for the generated {@code DragSourceEvent} specifies * the mouse cursor location in screen coordinates at the moment this event * occurred. *

      * In a multi-screen environment without a virtual device, the cursor location is * specified in the coordinate system of the initiator - * GraphicsConfiguration. The initiator - * GraphicsConfiguration is the GraphicsConfiguration - * of the Component on which the drag gesture for the current drag + * {@code GraphicsConfiguration}. The initiator + * {@code GraphicsConfiguration} is the {@code GraphicsConfiguration} + * of the {@code Component} on which the drag gesture for the current drag * operation was recognized. If the cursor location is outside the bounds of - * the initiator GraphicsConfiguration, the reported coordinates are - * clipped to fit within the bounds of that GraphicsConfiguration. + * the initiator {@code GraphicsConfiguration}, the reported coordinates are + * clipped to fit within the bounds of that {@code GraphicsConfiguration}. *

      * In a multi-screen environment with a virtual device, the location is specified * in the corresponding virtual coordinate system. If the cursor location is @@ -62,7 +62,7 @@ public class DragSourceEvent extends EventObject { private static final long serialVersionUID = -763287114604032641L; /** - * The boolean indicating whether the cursor location + * The {@code boolean} indicating whether the cursor location * is specified for this event. * * @serial @@ -88,15 +88,15 @@ public class DragSourceEvent extends EventObject { private final int y; /** - * Construct a DragSourceEvent - * given a specified DragSourceContext. - * The coordinates for this DragSourceEvent - * are not specified, so getLocation will return - * null for this event. + * Construct a {@code DragSourceEvent} + * given a specified {@code DragSourceContext}. + * The coordinates for this {@code DragSourceEvent} + * are not specified, so {@code getLocation} will return + * {@code null} for this event. * - * @param dsc the DragSourceContext + * @param dsc the {@code DragSourceContext} * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @see #getLocation */ @@ -109,15 +109,15 @@ public class DragSourceEvent extends EventObject { } /** - * Construct a DragSourceEvent given a specified - * DragSourceContext, and coordinates of the cursor + * Construct a {@code DragSourceEvent} given a specified + * {@code DragSourceContext}, and coordinates of the cursor * location. * - * @param dsc the DragSourceContext + * @param dsc the {@code DragSourceContext} * @param x the horizontal coordinate for the cursor location * @param y the vertical coordinate for the cursor location * - * @throws IllegalArgumentException if dsc is null. + * @throws IllegalArgumentException if {@code dsc} is {@code null}. * * @since 1.4 */ @@ -129,10 +129,10 @@ public class DragSourceEvent extends EventObject { } /** - * This method returns the DragSourceContext that + * This method returns the {@code DragSourceContext} that * originated the event. * - * @return the DragSourceContext that originated the event + * @return the {@code DragSourceContext} that originated the event */ public DragSourceContext getDragSourceContext() { @@ -140,13 +140,13 @@ public class DragSourceEvent extends EventObject { } /** - * This method returns a Point indicating the cursor + * This method returns a {@code Point} indicating the cursor * location in screen coordinates at the moment this event occurred, or - * null if the cursor location is not specified for this + * {@code null} if the cursor location is not specified for this * event. * - * @return the Point indicating the cursor location - * or null if the cursor location is not specified + * @return the {@code Point} indicating the cursor location + * or {@code null} if the cursor location is not specified * @since 1.4 */ public Point getLocation() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java index e568b6a5ad7..dc3122f1607 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceListener.java @@ -28,19 +28,19 @@ package java.awt.dnd; import java.util.EventListener; /** - * The DragSourceListener defines the + * The {@code DragSourceListener} defines the * event interface for originators of * Drag and Drop operations to track the state of the user's gesture, and to * provide appropriate "drag over" * feedback to the user throughout the * Drag and Drop operation. *

      - * The drop site is associated with the previous dragEnter() - * invocation if the latest invocation of dragEnter() on this + * The drop site is associated with the previous {@code dragEnter()} + * invocation if the latest invocation of {@code dragEnter()} on this * listener: *

        *
      • corresponds to that drop site and - *
      • is not followed by a dragExit() invocation on this listener. + *
      • is not followed by a {@code dragExit()} invocation on this listener. *
      * * @since 1.2 @@ -58,7 +58,7 @@ public interface DragSourceListener extends EventListener { *
    3. The drop site accepts the drag. * * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dragEnter(DragSourceDragEvent dsde); @@ -73,7 +73,7 @@ public interface DragSourceListener extends EventListener { *
    4. The drop site accepts the drag. * * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dragOver(DragSourceDragEvent dsde); @@ -84,7 +84,7 @@ public interface DragSourceListener extends EventListener { * Such devices are typically the mouse buttons or keyboard * modifiers that the user is interacting with. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dropActionChanged(DragSourceDragEvent dsde); @@ -106,21 +106,21 @@ public interface DragSourceListener extends EventListener { * has rejected the drag. * * - * @param dse the DragSourceEvent + * @param dse the {@code DragSourceEvent} */ void dragExit(DragSourceEvent dse); /** * This method is invoked to signify that the Drag and Drop * operation is complete. The getDropSuccess() method of - * the DragSourceDropEvent can be used to + * the {@code DragSourceDropEvent} can be used to * determine the termination state. The getDropAction() method * returns the operation that the drop site selected * to apply to the Drop operation. Once this method is complete, the - * current DragSourceContext and + * current {@code DragSourceContext} and * associated resources become invalid. * - * @param dsde the DragSourceDropEvent + * @param dsde the {@code DragSourceDropEvent} */ void dragDropEnd(DragSourceDropEvent dsde); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java index 92bf6e12807..95bde275d2a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DragSourceMotionListener.java @@ -33,14 +33,14 @@ import java.util.EventListener; *

      * The class that is interested in processing mouse motion events during * a drag operation either implements this interface or extends the abstract - * DragSourceAdapter class (overriding only the methods of + * {@code DragSourceAdapter} class (overriding only the methods of * interest). *

      * Create a listener object using that class and then register it with - * a DragSource. Whenever the mouse moves during a drag - * operation initiated with this DragSource, that object's - * dragMouseMoved method is invoked, and the - * DragSourceDragEvent is passed to it. + * a {@code DragSource}. Whenever the mouse moves during a drag + * operation initiated with this {@code DragSource}, that object's + * {@code dragMouseMoved} method is invoked, and the + * {@code DragSourceDragEvent} is passed to it. * * @see DragSourceDragEvent * @see DragSource @@ -55,7 +55,7 @@ public interface DragSourceMotionListener extends EventListener { /** * Called whenever the mouse is moved during a drag operation. * - * @param dsde the DragSourceDragEvent + * @param dsde the {@code DragSourceDragEvent} */ void dragMouseMoved(DragSourceDragEvent dsde); } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java index 6fbb8cad8b4..bd8e54e1f34 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTarget.java @@ -54,15 +54,15 @@ import sun.awt.AWTAccessor.ComponentAccessor; /** - * The DropTarget is associated - * with a Component when that Component + * The {@code DropTarget} is associated + * with a {@code Component} when that {@code Component} * wishes * to accept drops during Drag and Drop operations. *

      * Each - * DropTarget is associated with a FlavorMap. - * The default FlavorMap hereafter designates the - * FlavorMap returned by SystemFlavorMap.getDefaultFlavorMap(). + * {@code DropTarget} is associated with a {@code FlavorMap}. + * The default {@code FlavorMap} hereafter designates the + * {@code FlavorMap} returned by {@code SystemFlavorMap.getDefaultFlavorMap()}. * * @since 1.2 */ @@ -72,20 +72,20 @@ public class DropTarget implements DropTargetListener, Serializable { private static final long serialVersionUID = -6283860791671019047L; /** - * Creates a new DropTarget given the Component - * to associate itself with, an int representing + * Creates a new DropTarget given the {@code Component} + * to associate itself with, an {@code int} representing * the default acceptable action(s) to - * support, a DropTargetListener - * to handle event processing, a boolean indicating - * if the DropTarget is currently accepting drops, and - * a FlavorMap to use (or null for the default FlavorMap). + * support, a {@code DropTargetListener} + * to handle event processing, a {@code boolean} indicating + * if the {@code DropTarget} is currently accepting drops, and + * a {@code FlavorMap} to use (or null for the default {@code FlavorMap}). *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param ops The default acceptable actions for this DropTarget - * @param dtl The DropTargetListener for this DropTarget - * @param act Is the DropTarget accepting drops. - * @param fm The FlavorMap to use, or null for the default FlavorMap + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param ops The default acceptable actions for this {@code DropTarget} + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} + * @param act Is the {@code DropTarget} accepting drops. + * @param fm The {@code FlavorMap} to use, or null for the default {@code FlavorMap} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -121,18 +121,18 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget given the Component - * to associate itself with, an int representing + * Creates a {@code DropTarget} given the {@code Component} + * to associate itself with, an {@code int} representing * the default acceptable action(s) - * to support, a DropTargetListener - * to handle event processing, and a boolean indicating - * if the DropTarget is currently accepting drops. + * to support, a {@code DropTargetListener} + * to handle event processing, and a {@code boolean} indicating + * if the {@code DropTarget} is currently accepting drops. *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param ops The default acceptable actions for this DropTarget - * @param dtl The DropTargetListener for this DropTarget - * @param act Is the DropTarget accepting drops. + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param ops The default acceptable actions for this {@code DropTarget} + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} + * @param act Is the {@code DropTarget} accepting drops. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -145,7 +145,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget. + * Creates a {@code DropTarget}. * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -155,13 +155,13 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget given the Component - * to associate itself with, and the DropTargetListener + * Creates a {@code DropTarget} given the {@code Component} + * to associate itself with, and the {@code DropTargetListener} * to handle event processing. *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param dtl The DropTargetListener for this DropTarget + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -173,15 +173,15 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Creates a DropTarget given the Component - * to associate itself with, an int representing + * Creates a {@code DropTarget} given the {@code Component} + * to associate itself with, an {@code int} representing * the default acceptable action(s) to support, and a - * DropTargetListener to handle event processing. + * {@code DropTargetListener} to handle event processing. *

      * The Component will receive drops only if it is enabled. - * @param c The Component with which this DropTarget is associated - * @param ops The default acceptable actions for this DropTarget - * @param dtl The DropTargetListener for this DropTarget + * @param c The {@code Component} with which this {@code DropTarget} is associated + * @param ops The default acceptable actions for this {@code DropTarget} + * @param dtl The {@code DropTargetListener} for this {@code DropTarget} * @exception HeadlessException if GraphicsEnvironment.isHeadless() * returns true * @see java.awt.GraphicsEnvironment#isHeadless @@ -195,11 +195,11 @@ public class DropTarget implements DropTargetListener, Serializable { /** * Note: this interface is required to permit the safe association * of a DropTarget with a Component in one of two ways, either: - * component.setDropTarget(droptarget); - * or droptarget.setComponent(component); + * {@code component.setDropTarget(droptarget);} + * or {@code droptarget.setComponent(component);} *

      * The Component will receive drops only if it is enabled. - * @param c The new Component this DropTarget + * @param c The new {@code Component} this {@code DropTarget} * is to be associated with. */ @@ -229,10 +229,10 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets the Component associated - * with this DropTarget. + * Gets the {@code Component} associated + * with this {@code DropTarget}. * - * @return the current Component + * @return the current {@code Component} */ public synchronized Component getComponent() { @@ -240,7 +240,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Sets the default acceptable actions for this DropTarget + * Sets the default acceptable actions for this {@code DropTarget} * * @param ops the default actions * @see java.awt.dnd.DnDConstants @@ -259,8 +259,8 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets an int representing the - * current action(s) supported by this DropTarget. + * Gets an {@code int} representing the + * current action(s) supported by this {@code DropTarget}. * * @return the current default actions */ @@ -270,10 +270,10 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Sets the DropTarget active if true, - * inactive if false. + * Sets the DropTarget active if {@code true}, + * inactive if {@code false}. * - * @param isActive sets the DropTarget (in)active. + * @param isActive sets the {@code DropTarget} (in)active. */ public synchronized void setActive(boolean isActive) { @@ -286,10 +286,10 @@ public class DropTarget implements DropTargetListener, Serializable { /** * Reports whether or not - * this DropTarget + * this {@code DropTarget} * is currently active (ready to accept drops). * - * @return true if active, false if not + * @return {@code true} if active, {@code false} if not */ public boolean isActive() { @@ -297,13 +297,13 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Adds a new DropTargetListener (UNICAST SOURCE). + * Adds a new {@code DropTargetListener} (UNICAST SOURCE). * - * @param dtl The new DropTargetListener + * @param dtl The new {@code DropTargetListener} * * @throws TooManyListenersException if a - * DropTargetListener is already added to this - * DropTarget. + * {@code DropTargetListener} is already added to this + * {@code DropTarget}. */ public synchronized void addDropTargetListener(DropTargetListener dtl) throws TooManyListenersException { @@ -318,7 +318,7 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Removes the current DropTargetListener (UNICAST SOURCE). + * Removes the current {@code DropTargetListener} (UNICAST SOURCE). * * @param dtl the DropTargetListener to deregister. */ @@ -333,16 +333,16 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dragEnter on the registered - * DropTargetListener and passes it - * the specified DropTargetDragEvent. - * Has no effect if this DropTarget + * Calls {@code dragEnter} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDragEvent}. + * Has no effect if this {@code DropTarget} * is not active. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} * - * @throws NullPointerException if this DropTarget - * is active and dtde is null + * @throws NullPointerException if this {@code DropTarget} + * is active and {@code dtde} is {@code null} * * @see #isActive */ @@ -360,16 +360,16 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dragOver on the registered - * DropTargetListener and passes it - * the specified DropTargetDragEvent. - * Has no effect if this DropTarget + * Calls {@code dragOver} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDragEvent}. + * Has no effect if this {@code DropTarget} * is not active. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} * - * @throws NullPointerException if this DropTarget - * is active and dtde is null + * @throws NullPointerException if this {@code DropTarget} + * is active and {@code dtde} is {@code null} * * @see #isActive */ @@ -382,16 +382,16 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dropActionChanged on the registered - * DropTargetListener and passes it - * the specified DropTargetDragEvent. - * Has no effect if this DropTarget + * Calls {@code dropActionChanged} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDragEvent}. + * Has no effect if this {@code DropTarget} * is not active. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} * - * @throws NullPointerException if this DropTarget - * is active and dtde is null + * @throws NullPointerException if this {@code DropTarget} + * is active and {@code dtde} is {@code null} * * @see #isActive */ @@ -404,17 +404,17 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls dragExit on the registered - * DropTargetListener and passes it - * the specified DropTargetEvent. - * Has no effect if this DropTarget + * Calls {@code dragExit} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetEvent}. + * Has no effect if this {@code DropTarget} * is not active. *

      * This method itself does not throw any exception * for null parameter but for exceptions thrown by * the respective method of the listener. * - * @param dte the DropTargetEvent + * @param dte the {@code DropTargetEvent} * * @see #isActive */ @@ -429,17 +429,17 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Calls drop on the registered - * DropTargetListener and passes it - * the specified DropTargetDropEvent - * if this DropTarget is active. + * Calls {@code drop} on the registered + * {@code DropTargetListener} and passes it + * the specified {@code DropTargetDropEvent} + * if this {@code DropTarget} is active. * - * @param dtde the DropTargetDropEvent + * @param dtde the {@code DropTargetDropEvent} * - * @throws NullPointerException if dtde is null + * @throws NullPointerException if {@code dtde} is null * and at least one of the following is true: this - * DropTarget is not active, or there is - * no a DropTargetListener registered. + * {@code DropTarget} is not active, or there is + * no a {@code DropTargetListener} registered. * * @see #isActive */ @@ -456,11 +456,11 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets the FlavorMap - * associated with this DropTarget. - * If no FlavorMap has been set for this - * DropTarget, it is associated with the default - * FlavorMap. + * Gets the {@code FlavorMap} + * associated with this {@code DropTarget}. + * If no {@code FlavorMap} has been set for this + * {@code DropTarget}, it is associated with the default + * {@code FlavorMap}. * * @return the FlavorMap for this DropTarget */ @@ -468,10 +468,10 @@ public class DropTarget implements DropTargetListener, Serializable { public FlavorMap getFlavorMap() { return flavorMap; } /** - * Sets the FlavorMap associated - * with this DropTarget. + * Sets the {@code FlavorMap} associated + * with this {@code DropTarget}. * - * @param fm the new FlavorMap, or null to + * @param fm the new {@code FlavorMap}, or null to * associate the default FlavorMap with this DropTarget. */ @@ -544,10 +544,10 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Gets the DropTargetContext associated - * with this DropTarget. + * Gets the {@code DropTargetContext} associated + * with this {@code DropTarget}. * - * @return the DropTargetContext associated with this DropTarget. + * @return the {@code DropTargetContext} associated with this {@code DropTarget}. */ public DropTargetContext getDropTargetContext() { @@ -571,14 +571,14 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Serializes this DropTarget. Performs default serialization, - * and then writes out this object's DropTargetListener if and - * only if it can be serialized. If not, null is written + * Serializes this {@code DropTarget}. Performs default serialization, + * and then writes out this object's {@code DropTargetListener} if and + * only if it can be serialized. If not, {@code null} is written * instead. * * @serialData The default serializable fields, in alphabetical order, - * followed by either a DropTargetListener - * instance, or null. + * followed by either a {@code DropTargetListener} + * instance, or {@code null}. * @since 1.4 */ private void writeObject(ObjectOutputStream s) throws IOException { @@ -589,13 +589,13 @@ public class DropTarget implements DropTargetListener, Serializable { } /** - * Deserializes this DropTarget. This method first performs - * default deserialization for all non-transient fields. An + * Deserializes this {@code DropTarget}. This method first performs + * default deserialization for all non-{@code transient} fields. An * attempt is then made to deserialize this object's - * DropTargetListener as well. This is first attempted by - * deserializing the field dtListener, because, in releases - * prior to 1.4, a non-transient field of this name stored the - * DropTargetListener. If this fails, the next object in the + * {@code DropTargetListener} as well. This is first attempted by + * deserializing the field {@code dtListener}, because, in releases + * prior to 1.4, a non-{@code transient} field of this name stored the + * {@code DropTargetListener}. If this fails, the next object in the * stream is used instead. * * @since 1.4 @@ -639,8 +639,8 @@ public class DropTarget implements DropTargetListener, Serializable { /** * construct a DropTargetAutoScroller * - * @param c the Component - * @param p the Point + * @param c the {@code Component} + * @param p the {@code Point} */ protected DropTargetAutoScroller(Component c, Point p) { @@ -709,7 +709,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * cause autoscroll to occur * - * @param newLocn the Point + * @param newLocn the {@code Point} */ protected synchronized void updateLocation(Point newLocn) { @@ -733,7 +733,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * cause autoscroll to occur * - * @param e the ActionEvent + * @param e the {@code ActionEvent} */ public synchronized void actionPerformed(ActionEvent e) { @@ -766,8 +766,8 @@ public class DropTarget implements DropTargetListener, Serializable { /** * create an embedded autoscroller * - * @param c the Component - * @param p the Point + * @param c the {@code Component} + * @param p the {@code Point} * @return an embedded autoscroller */ @@ -778,7 +778,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * initialize autoscrolling * - * @param p the Point + * @param p the {@code Point} */ protected void initializeAutoscrolling(Point p) { @@ -790,7 +790,7 @@ public class DropTarget implements DropTargetListener, Serializable { /** * update autoscrolling with current cursor location * - * @param dragCursorLocn the Point + * @param dragCursorLocn the {@code Point} */ protected void updateAutoscroll(Point dragCursorLocn) { @@ -843,7 +843,7 @@ public class DropTarget implements DropTargetListener, Serializable { int actions = DnDConstants.ACTION_COPY_OR_MOVE; /** - * true if the DropTarget is accepting Drag & Drop operations. + * {@code true} if the DropTarget is accepting Drag & Drop operations. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java index 2da3bf7eae2..f019ae108a5 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetAdapter.java @@ -30,39 +30,39 @@ package java.awt.dnd; * this class are empty. This class exists only as a convenience for creating * listener objects. *

      - * Extend this class to create a DropTargetEvent listener + * Extend this class to create a {@code DropTargetEvent} listener * and override the methods for the events of interest. (If you implement the - * DropTargetListener interface, you have to define all of + * {@code DropTargetListener} interface, you have to define all of * the methods in it. This abstract class defines a null implementation for - * every method except drop(DropTargetDropEvent), so you only have + * every method except {@code drop(DropTargetDropEvent)}, so you only have * to define methods for events you care about.) You must provide an - * implementation for at least drop(DropTargetDropEvent). This + * implementation for at least {@code drop(DropTargetDropEvent)}. This * method cannot have a null implementation because its specification requires * that you either accept or reject the drop, and, if accepted, indicate * whether the drop was successful. *

      * Create a listener object using the extended class and then register it with - * a DropTarget. When the drag enters, moves over, or exits - * the operable part of the drop site for that DropTarget, when + * a {@code DropTarget}. When the drag enters, moves over, or exits + * the operable part of the drop site for that {@code DropTarget}, when * the drop action changes, and when the drop occurs, the relevant method in - * the listener object is invoked, and the DropTargetEvent is + * the listener object is invoked, and the {@code DropTargetEvent} is * passed to it. *

      - * The operable part of the drop site for the DropTarget is - * the part of the associated Component's geometry that is not + * The operable part of the drop site for the {@code DropTarget} is + * the part of the associated {@code Component}'s geometry that is not * obscured by an overlapping top-level window or by another - * Component higher in the Z-order that has an associated active - * DropTarget. + * {@code Component} higher in the Z-order that has an associated active + * {@code DropTarget}. *

      * During the drag, the data associated with the current drag operation can be - * retrieved by calling getTransferable() on - * DropTargetDragEvent instances passed to the listener's + * retrieved by calling {@code getTransferable()} on + * {@code DropTargetDragEvent} instances passed to the listener's * methods. *

      - * Note that getTransferable() on the - * DropTargetDragEvent instance should only be called within the + * Note that {@code getTransferable()} on the + * {@code DropTargetDragEvent} instance should only be called within the * respective listener's method and all the necessary data should be retrieved - * from the returned Transferable before that method returns. + * from the returned {@code Transferable} before that method returns. * * @see DropTargetEvent * @see DropTargetListener @@ -74,19 +74,19 @@ public abstract class DropTargetAdapter implements DropTargetListener { /** * Called while a drag operation is ongoing, when the mouse pointer enters - * the operable part of the drop site for the DropTarget + * the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ public void dragEnter(DropTargetDragEvent dtde) {} /** * Called when a drag operation is ongoing, while the mouse pointer is still - * over the operable part of the drop site for the DropTarget + * over the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ public void dragOver(DropTargetDragEvent dtde) {} @@ -94,16 +94,16 @@ public abstract class DropTargetAdapter implements DropTargetListener { * Called if the user has modified * the current drop gesture. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ public void dropActionChanged(DropTargetDragEvent dtde) {} /** * Called while a drag operation is ongoing, when the mouse pointer has * exited the operable part of the drop site for the - * DropTarget registered with this listener. + * {@code DropTarget} registered with this listener. * - * @param dte the DropTargetEvent + * @param dte the {@code DropTargetEvent} */ public void dragExit(DropTargetEvent dte) {} } diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java index 00639cf9043..9a6b57d450b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDragEvent.java @@ -33,15 +33,15 @@ import java.awt.datatransfer.Transferable; import java.util.List; /** - * The DropTargetDragEvent is delivered to a - * DropTargetListener via its + * The {@code DropTargetDragEvent} is delivered to a + * {@code DropTargetListener} via its * dragEnter() and dragOver() methods. *

      - * The DropTargetDragEvent reports the source drop actions + * The {@code DropTargetDragEvent} reports the source drop actions * and the user drop action that reflect the current state of * the drag operation. *

      - * Source drop actions is a bitwise mask of DnDConstants + * Source drop actions is a bitwise mask of {@code DnDConstants} * that represents the set of drop actions supported by the drag source for * this drag operation. *

      @@ -54,18 +54,18 @@ import java.util.List; * Shift -> ACTION_MOVE * * If the user selects a drop action, the user drop action is one of - * DnDConstants that represents the selected drop action if this + * {@code DnDConstants} that represents the selected drop action if this * drop action is supported by the drag source or - * DnDConstants.ACTION_NONE if this drop action is not supported + * {@code DnDConstants.ACTION_NONE} if this drop action is not supported * by the drag source. *

      * If the user doesn't select a drop action, the set of - * DnDConstants that represents the set of drop actions supported - * by the drag source is searched for DnDConstants.ACTION_MOVE, - * then for DnDConstants.ACTION_COPY, then for - * DnDConstants.ACTION_LINK and the user drop action is the + * {@code DnDConstants} that represents the set of drop actions supported + * by the drag source is searched for {@code DnDConstants.ACTION_MOVE}, + * then for {@code DnDConstants.ACTION_COPY}, then for + * {@code DnDConstants.ACTION_LINK} and the user drop action is the * first constant found. If no constant is found the user drop action - * is DnDConstants.ACTION_NONE. + * is {@code DnDConstants.ACTION_NONE}. * * @since 1.2 */ @@ -75,10 +75,10 @@ public class DropTargetDragEvent extends DropTargetEvent { private static final long serialVersionUID = -8422265619058953682L; /** - * Construct a DropTargetDragEvent given the - * DropTargetContext for this operation, - * the location of the "Drag" Cursor's hotspot - * in the Component's coordinates, the + * Construct a {@code DropTargetDragEvent} given the + * {@code DropTargetContext} for this operation, + * the location of the "Drag" {@code Cursor}'s hotspot + * in the {@code Component}'s coordinates, the * user drop action, and the source drop actions. * * @param dtc The DropTargetContext for this operation @@ -89,10 +89,10 @@ public class DropTargetDragEvent extends DropTargetEvent { * * @throws NullPointerException if cursorLocn is null * @throws IllegalArgumentException if dropAction is not one of - * DnDConstants. + * {@code DnDConstants}. * @throws IllegalArgumentException if srcActions is not - * a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * a bitwise mask of {@code DnDConstants}. + * @throws IllegalArgumentException if dtc is {@code null}. */ public DropTargetDragEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) { @@ -114,13 +114,13 @@ public class DropTargetDragEvent extends DropTargetEvent { } /** - * This method returns a Point - * indicating the Cursor's current - * location within the Component's + * This method returns a {@code Point} + * indicating the {@code Cursor}'s current + * location within the {@code Component'}s * coordinates. * * @return the current cursor location in - * Component's coords. + * {@code Component}'s coords. */ public Point getLocation() { @@ -129,8 +129,8 @@ public class DropTargetDragEvent extends DropTargetEvent { /** - * This method returns the current DataFlavors from the - * DropTargetContext. + * This method returns the current {@code DataFlavor}s from the + * {@code DropTargetContext}. * * @return current DataFlavors from the DropTargetContext */ @@ -140,10 +140,10 @@ public class DropTargetDragEvent extends DropTargetEvent { } /** - * This method returns the current DataFlavors - * as a java.util.List + * This method returns the current {@code DataFlavor}s + * as a {@code java.util.List} * - * @return a java.util.List of the Current DataFlavors + * @return a {@code java.util.List} of the Current {@code DataFlavor}s */ public List getCurrentDataFlavorsAsList() { @@ -151,10 +151,10 @@ public class DropTargetDragEvent extends DropTargetEvent { } /** - * This method returns a boolean indicating - * if the specified DataFlavor is supported. + * This method returns a {@code boolean} indicating + * if the specified {@code DataFlavor} is supported. * - * @param df the DataFlavor to test + * @param df the {@code DataFlavor} to test * * @return if a particular DataFlavor is supported */ @@ -195,11 +195,11 @@ public class DropTargetDragEvent extends DropTargetEvent { * Accepts the drag. * * This method should be called from a - * DropTargetListeners dragEnter, - * dragOver, and dropActionChanged + * {@code DropTargetListeners dragEnter}, + * {@code dragOver}, and {@code dropActionChanged} * methods if the implementation wishes to accept an operation * from the srcActions other than the one selected by - * the user as represented by the dropAction. + * the user as represented by the {@code dropAction}. * * @param dragOperation the operation accepted by the target */ @@ -209,7 +209,7 @@ public class DropTargetDragEvent extends DropTargetEvent { /** * Rejects the drag as a result of examining either the - * dropAction or the available DataFlavor + * {@code dropAction} or the available {@code DataFlavor} * types. */ public void rejectDrag() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java index 6b197ae6b1f..7fdee103b3d 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetDropEvent.java @@ -33,14 +33,14 @@ import java.awt.datatransfer.Transferable; import java.util.List; /** - * The DropTargetDropEvent is delivered - * via the DropTargetListener drop() method. + * The {@code DropTargetDropEvent} is delivered + * via the {@code DropTargetListener} drop() method. *

      - * The DropTargetDropEvent reports the source drop actions + * The {@code DropTargetDropEvent} reports the source drop actions * and the user drop action that reflect the current state of the * drag-and-drop operation. *

      - * Source drop actions is a bitwise mask of DnDConstants + * Source drop actions is a bitwise mask of {@code DnDConstants} * that represents the set of drop actions supported by the drag source for * this drag-and-drop operation. *

      @@ -53,18 +53,18 @@ import java.util.List; * Shift -> ACTION_MOVE * * If the user selects a drop action, the user drop action is one of - * DnDConstants that represents the selected drop action if this + * {@code DnDConstants} that represents the selected drop action if this * drop action is supported by the drag source or - * DnDConstants.ACTION_NONE if this drop action is not supported + * {@code DnDConstants.ACTION_NONE} if this drop action is not supported * by the drag source. *

      * If the user doesn't select a drop action, the set of - * DnDConstants that represents the set of drop actions supported - * by the drag source is searched for DnDConstants.ACTION_MOVE, - * then for DnDConstants.ACTION_COPY, then for - * DnDConstants.ACTION_LINK and the user drop action is the + * {@code DnDConstants} that represents the set of drop actions supported + * by the drag source is searched for {@code DnDConstants.ACTION_MOVE}, + * then for {@code DnDConstants.ACTION_COPY}, then for + * {@code DnDConstants.ACTION_LINK} and the user drop action is the * first constant found. If no constant is found the user drop action - * is DnDConstants.ACTION_NONE. + * is {@code DnDConstants.ACTION_NONE}. * * @since 1.2 */ @@ -74,31 +74,31 @@ public class DropTargetDropEvent extends DropTargetEvent { private static final long serialVersionUID = -1721911170440459322L; /** - * Construct a DropTargetDropEvent given - * the DropTargetContext for this operation, - * the location of the drag Cursor's - * hotspot in the Component's coordinates, + * Construct a {@code DropTargetDropEvent} given + * the {@code DropTargetContext} for this operation, + * the location of the drag {@code Cursor}'s + * hotspot in the {@code Component}'s coordinates, * the currently * selected user drop action, and the current set of * actions supported by the source. * By default, this constructor * assumes that the target is not in the same virtual machine as * the source; that is, {@link #isLocalTransfer()} will - * return false. + * return {@code false}. * - * @param dtc The DropTargetContext for this operation + * @param dtc The {@code DropTargetContext} for this operation * @param cursorLocn The location of the "Drag" Cursor's - * hotspot in Component coordinates + * hotspot in {@code Component} coordinates * @param dropAction the user drop action. * @param srcActions the source drop actions. * * @throws NullPointerException - * if cursorLocn is null + * if cursorLocn is {@code null} * @throws IllegalArgumentException - * if dropAction is not one of DnDConstants. + * if dropAction is not one of {@code DnDConstants}. * @throws IllegalArgumentException - * if srcActions is not a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * if srcActions is not a bitwise mask of {@code DnDConstants}. + * @throws IllegalArgumentException if dtc is {@code null}. */ public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions) { @@ -120,13 +120,13 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * Construct a DropTargetEvent given the - * DropTargetContext for this operation, - * the location of the drag Cursor's hotspot - * in the Component's + * Construct a {@code DropTargetEvent} given the + * {@code DropTargetContext} for this operation, + * the location of the drag {@code Cursor}'s hotspot + * in the {@code Component}'s * coordinates, the currently selected user drop action, * the current set of actions supported by the source, - * and a boolean indicating if the source is in the same JVM + * and a {@code boolean} indicating if the source is in the same JVM * as the target. * * @param dtc The DropTargetContext for this operation @@ -137,11 +137,11 @@ public class DropTargetDropEvent extends DropTargetEvent { * @param isLocal True if the source is in the same JVM as the target * * @throws NullPointerException - * if cursorLocn is null + * if cursorLocn is {@code null} * @throws IllegalArgumentException - * if dropAction is not one of DnDConstants. - * @throws IllegalArgumentException if srcActions is not a bitwise mask of DnDConstants. - * @throws IllegalArgumentException if dtc is null. + * if dropAction is not one of {@code DnDConstants}. + * @throws IllegalArgumentException if srcActions is not a bitwise mask of {@code DnDConstants}. + * @throws IllegalArgumentException if dtc is {@code null}. */ public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, boolean isLocal) { @@ -151,11 +151,11 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method returns a Point - * indicating the Cursor's current - * location in the Component's coordinates. + * This method returns a {@code Point} + * indicating the {@code Cursor}'s current + * location in the {@code Component}'s coordinates. * - * @return the current Cursor location in Component's coords. + * @return the current {@code Cursor} location in Component's coords. */ public Point getLocation() { @@ -175,7 +175,7 @@ public class DropTargetDropEvent extends DropTargetEvent { /** * This method returns the currently available - * DataFlavors as a java.util.List. + * {@code DataFlavor}s as a {@code java.util.List}. * * @return the currently available DataFlavors as a java.util.List */ @@ -185,11 +185,11 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method returns a boolean indicating if the - * specified DataFlavor is available + * This method returns a {@code boolean} indicating if the + * specified {@code DataFlavor} is available * from the source. * - * @param df the DataFlavor to test + * @param df the {@code DataFlavor} to test * * @return if the DataFlavor specified is available from the source */ @@ -213,10 +213,10 @@ public class DropTargetDropEvent extends DropTargetEvent { public int getDropAction() { return dropAction; } /** - * This method returns the Transferable object + * This method returns the {@code Transferable} object * associated with the drop. * - * @return the Transferable associated with the drop + * @return the {@code Transferable} associated with the drop */ public Transferable getTransferable() { @@ -242,10 +242,10 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method notifies the DragSource + * This method notifies the {@code DragSource} * that the drop transfer(s) are completed. * - * @param success a boolean indicating that the drop transfer(s) are completed. + * @param success a {@code boolean} indicating that the drop transfer(s) are completed. */ public void dropComplete(boolean success) { @@ -253,7 +253,7 @@ public class DropTargetDropEvent extends DropTargetEvent { } /** - * This method returns an int indicating if + * This method returns an {@code int} indicating if * the source is in the same JVM as the target. * * @return if the Source is in the same JVM @@ -291,7 +291,7 @@ public class DropTargetDropEvent extends DropTargetEvent { private int dropAction = DnDConstants.ACTION_NONE; /** - * true if the source is in the same JVM as the target. + * {@code true} if the source is in the same JVM as the target. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java index e7911ab8cbb..3dfe215b0a2 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetEvent.java @@ -29,12 +29,12 @@ import java.util.EventObject; import java.awt.dnd.DropTargetContext; /** - * The DropTargetEvent is the base - * class for both the DropTargetDragEvent - * and the DropTargetDropEvent. + * The {@code DropTargetEvent} is the base + * class for both the {@code DropTargetDragEvent} + * and the {@code DropTargetDropEvent}. * It encapsulates the current state of the Drag and * Drop operations, in particular the current - * DropTargetContext. + * {@code DropTargetContext}. * * @since 1.2 * @@ -45,10 +45,10 @@ public class DropTargetEvent extends java.util.EventObject { private static final long serialVersionUID = 2821229066521922993L; /** - * Construct a DropTargetEvent object with - * the specified DropTargetContext. + * Construct a {@code DropTargetEvent} object with + * the specified {@code DropTargetContext}. * - * @param dtc The DropTargetContext + * @param dtc The {@code DropTargetContext} * @throws NullPointerException if {@code dtc} equals {@code null}. * @see #getSource() * @see #getDropTargetContext() @@ -61,10 +61,10 @@ public class DropTargetEvent extends java.util.EventObject { } /** - * This method returns the DropTargetContext - * associated with this DropTargetEvent. + * This method returns the {@code DropTargetContext} + * associated with this {@code DropTargetEvent}. * - * @return the DropTargetContext + * @return the {@code DropTargetContext} */ public DropTargetContext getDropTargetContext() { @@ -72,8 +72,8 @@ public class DropTargetEvent extends java.util.EventObject { } /** - * The DropTargetContext associated with this - * DropTargetEvent. + * The {@code DropTargetContext} associated with this + * {@code DropTargetEvent}. * * @serial */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java index ec04be74e32..be540d424a4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/DropTargetListener.java @@ -31,37 +31,37 @@ import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; /** - * The DropTargetListener interface + * The {@code DropTargetListener} interface * is the callback interface used by the - * DropTarget class to provide + * {@code DropTarget} class to provide * notification of DnD operations that involve - * the subject DropTarget. Methods of + * the subject {@code DropTarget}. Methods of * this interface may be implemented to provide * "drag under" visual feedback to the user throughout * the Drag and Drop operation. *

      * Create a listener object by implementing the interface and then register it - * with a DropTarget. When the drag enters, moves over, or exits - * the operable part of the drop site for that DropTarget, when + * with a {@code DropTarget}. When the drag enters, moves over, or exits + * the operable part of the drop site for that {@code DropTarget}, when * the drop action changes, and when the drop occurs, the relevant method in - * the listener object is invoked, and the DropTargetEvent is + * the listener object is invoked, and the {@code DropTargetEvent} is * passed to it. *

      - * The operable part of the drop site for the DropTarget is - * the part of the associated Component's geometry that is not + * The operable part of the drop site for the {@code DropTarget} is + * the part of the associated {@code Component}'s geometry that is not * obscured by an overlapping top-level window or by another - * Component higher in the Z-order that has an associated active - * DropTarget. + * {@code Component} higher in the Z-order that has an associated active + * {@code DropTarget}. *

      * During the drag, the data associated with the current drag operation can be - * retrieved by calling getTransferable() on - * DropTargetDragEvent instances passed to the listener's + * retrieved by calling {@code getTransferable()} on + * {@code DropTargetDragEvent} instances passed to the listener's * methods. *

      - * Note that getTransferable() on the - * DropTargetDragEvent instance should only be called within the + * Note that {@code getTransferable()} on the + * {@code DropTargetDragEvent} instance should only be called within the * respective listener's method and all the necessary data should be retrieved - * from the returned Transferable before that method returns. + * from the returned {@code Transferable} before that method returns. * * @since 1.2 */ @@ -70,20 +70,20 @@ public interface DropTargetListener extends EventListener { /** * Called while a drag operation is ongoing, when the mouse pointer enters - * the operable part of the drop site for the DropTarget + * the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ void dragEnter(DropTargetDragEvent dtde); /** * Called when a drag operation is ongoing, while the mouse pointer is still - * over the operable part of the drop site for the DropTarget + * over the operable part of the drop site for the {@code DropTarget} * registered with this listener. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ void dragOver(DropTargetDragEvent dtde); @@ -92,7 +92,7 @@ public interface DropTargetListener extends EventListener { * Called if the user has modified * the current drop gesture. * - * @param dtde the DropTargetDragEvent + * @param dtde the {@code DropTargetDragEvent} */ void dropActionChanged(DropTargetDragEvent dtde); @@ -100,52 +100,52 @@ public interface DropTargetListener extends EventListener { /** * Called while a drag operation is ongoing, when the mouse pointer has * exited the operable part of the drop site for the - * DropTarget registered with this listener. + * {@code DropTarget} registered with this listener. * - * @param dte the DropTargetEvent + * @param dte the {@code DropTargetEvent} */ void dragExit(DropTargetEvent dte); /** * Called when the drag operation has terminated with a drop on - * the operable part of the drop site for the DropTarget + * the operable part of the drop site for the {@code DropTarget} * registered with this listener. *

      * This method is responsible for undertaking * the transfer of the data associated with the - * gesture. The DropTargetDropEvent - * provides a means to obtain a Transferable + * gesture. The {@code DropTargetDropEvent} + * provides a means to obtain a {@code Transferable} * object that represents the data object(s) to * be transferred.

      - * From this method, the DropTargetListener + * From this method, the {@code DropTargetListener} * shall accept or reject the drop via the * acceptDrop(int dropAction) or rejectDrop() methods of the - * DropTargetDropEvent parameter. + * {@code DropTargetDropEvent} parameter. *

      * Subsequent to acceptDrop(), but not before, - * DropTargetDropEvent's getTransferable() + * {@code DropTargetDropEvent}'s getTransferable() * method may be invoked, and data transfer may be - * performed via the returned Transferable's + * performed via the returned {@code Transferable}'s * getTransferData() method. *

      * At the completion of a drop, an implementation * of this method is required to signal the success/failure * of the drop by passing an appropriate - * boolean to the DropTargetDropEvent's + * {@code boolean} to the {@code DropTargetDropEvent}'s * dropComplete(boolean success) method. *

      * Note: The data transfer should be completed before the call to the - * DropTargetDropEvent's dropComplete(boolean success) method. + * {@code DropTargetDropEvent}'s dropComplete(boolean success) method. * After that, a call to the getTransferData() method of the - * Transferable returned by - * DropTargetDropEvent.getTransferable() is guaranteed to + * {@code Transferable} returned by + * {@code DropTargetDropEvent.getTransferable()} is guaranteed to * succeed only if the data transfer is local; that is, only if - * DropTargetDropEvent.isLocalTransfer() returns - * true. Otherwise, the behavior of the call is + * {@code DropTargetDropEvent.isLocalTransfer()} returns + * {@code true}. Otherwise, the behavior of the call is * implementation-dependent. * - * @param dtde the DropTargetDropEvent + * @param dtde the {@code DropTargetDropEvent} */ void drop(DropTargetDropEvent dtde); diff --git a/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java b/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java index cf975835f22..0c5a623f754 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java +++ b/jdk/src/java.desktop/share/classes/java/awt/dnd/MouseDragGestureRecognizer.java @@ -32,8 +32,8 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; /** - * This abstract subclass of DragGestureRecognizer - * defines a DragGestureRecognizer + * This abstract subclass of {@code DragGestureRecognizer} + * defines a {@code DragGestureRecognizer} * for mouse-based gestures. * * Each platform implements its own concrete subclass of this class, @@ -67,12 +67,12 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i private static final long serialVersionUID = 6220099344182281120L; /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for the - * Component c, the Component + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for the + * {@code Component} c, the {@code Component} * to observe, the action(s) * permitted for this drag operation, and - * the DragGestureListener to + * the {@code DragGestureListener} to * notify when a drag gesture is detected. * * @param ds The DragSource for the Component c @@ -87,10 +87,10 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i } /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for - * the Component c, - * the Component to observe, and the action(s) + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for + * the {@code Component} c, + * the {@code Component} to observe, and the action(s) * permitted for this drag operation. * * @param ds The DragSource for the Component c @@ -103,10 +103,10 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i } /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for the - * Component c, and the - * Component to observe. + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for the + * {@code Component} c, and the + * {@code Component} to observe. * * @param ds The DragSource for the Component c * @param c The Component to observe @@ -117,8 +117,8 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i } /** - * Construct a new MouseDragGestureRecognizer - * given the DragSource for the Component. + * Construct a new {@code MouseDragGestureRecognizer} + * given the {@code DragSource} for the {@code Component}. * * @param ds The DragSource for the Component */ @@ -151,16 +151,16 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when the mouse has been clicked on a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseClicked(MouseEvent e) { } /** * Invoked when a mouse button has been - * pressed on a Component. + * pressed on a {@code Component}. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mousePressed(MouseEvent e) { } @@ -168,7 +168,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when a mouse button has been released on a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseReleased(MouseEvent e) { } @@ -176,7 +176,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when the mouse enters a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseEntered(MouseEvent e) { } @@ -184,7 +184,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when the mouse exits a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseExited(MouseEvent e) { } @@ -192,7 +192,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i /** * Invoked when a mouse button is pressed on a component. * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseDragged(MouseEvent e) { } @@ -201,7 +201,7 @@ public abstract class MouseDragGestureRecognizer extends DragGestureRecognizer i * Invoked when the mouse button has been moved on a component * (with no buttons no down). * - * @param e the MouseEvent + * @param e the {@code MouseEvent} */ public void mouseMoved(MouseEvent e) { } diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java index e56191fd988..f0050c740c4 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/AWTEventListener.java @@ -41,9 +41,9 @@ import java.awt.AWTEvent; * The class that is interested in monitoring AWT events * implements this interface, and the object created with that * class is registered with the Toolkit, using the Toolkit's - * addAWTEventListener method. When an event is + * {@code addAWTEventListener} method. When an event is * dispatched anywhere in the AWT, that object's - * eventDispatched method is invoked. + * {@code eventDispatched} method is invoked. * * @see java.awt.AWTEvent * @see java.awt.Toolkit#addAWTEventListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java index 24a91ac0cd2..6ce79554eeb 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ActionEvent.java @@ -32,17 +32,17 @@ import java.lang.annotation.Native; /** * A semantic event which indicates that a component-defined action occurred. * This high-level event is generated by a component (such as a - * Button) when + * {@code Button}) when * the component-specific action occurs (such as being pressed). - * The event is passed to every ActionListener object + * The event is passed to every {@code ActionListener} object * that registered to receive such events using the component's - * addActionListener method. + * {@code addActionListener} method. *

      - * Note: To invoke an ActionEvent on a - * Button using the keyboard, use the Space bar. + * Note: To invoke an {@code ActionEvent} on a + * {@code Button} using the keyboard, use the Space bar. *

      - * The object that implements the ActionListener interface - * gets this ActionEvent when the event occurs. The listener + * The object that implements the {@code ActionListener} interface + * gets this {@code ActionEvent} when the event occurs. The listener * is therefore spared the details of processing individual mouse movements * and mouse clicks, and can instead process a "meaningful" (semantic) * event like "button pressed". @@ -137,12 +137,12 @@ public class ActionEvent extends AWTEvent { private static final long serialVersionUID = -7671078796273832149L; /** - * Constructs an ActionEvent object. + * Constructs an {@code ActionEvent} object. *

      * This method throws an - * IllegalArgumentException if source - * is null. - * A null command string is legal, + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. + * A {@code null command} string is legal, * but not recommended. * * @param source The object that originated the event @@ -151,7 +151,7 @@ public class ActionEvent extends AWTEvent { * the class description for {@link ActionEvent} * @param command A string that may specify a command (possibly one * of several) associated with the event - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getActionCommand() @@ -161,12 +161,12 @@ public class ActionEvent extends AWTEvent { } /** - * Constructs an ActionEvent object with modifier keys. + * Constructs an {@code ActionEvent} object with modifier keys. *

      * This method throws an - * IllegalArgumentException if source - * is null. - * A null command string is legal, + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. + * A {@code null command} string is legal, * but not recommended. * * @param source The object that originated the event @@ -179,7 +179,7 @@ public class ActionEvent extends AWTEvent { * (shift, ctrl, alt, meta). * Passing negative parameter is not recommended. * Zero value means that no modifiers were passed - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getActionCommand() @@ -190,13 +190,13 @@ public class ActionEvent extends AWTEvent { } /** - * Constructs an ActionEvent object with the specified + * Constructs an {@code ActionEvent} object with the specified * modifier keys and timestamp. *

      * This method throws an - * IllegalArgumentException if source - * is null. - * A null command string is legal, + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. + * A {@code null command} string is legal, * but not recommended. * * @param source The object that originated the event @@ -212,7 +212,7 @@ public class ActionEvent extends AWTEvent { * @param when A long that gives the time the event occurred. * Passing negative or zero value * is not recommended - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getActionCommand() @@ -237,9 +237,9 @@ public class ActionEvent extends AWTEvent { * and the event would be the same in each case, but the command string * would identify the intended action. *

      - * Note that if a null command string was passed - * to the constructor for this ActionEvent, this - * this method returns null. + * Note that if a {@code null} command string was passed + * to the constructor for this {@code ActionEvent}, this + * this method returns {@code null}. * * @return the string identifying the command for this event */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java index bbb87dbddfb..50b94c46a18 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ActionListener.java @@ -32,8 +32,8 @@ import java.util.EventListener; * The class that is interested in processing an action event * implements this interface, and the object created with that * class is registered with a component, using the component's - * addActionListener method. When the action event - * occurs, that object's actionPerformed method is + * {@code addActionListener} method. When the action event + * occurs, that object's {@code actionPerformed} method is * invoked. * * @see ActionEvent diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java index 66d54c3c247..f113319c57b 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/AdjustmentEvent.java @@ -107,7 +107,7 @@ public class AdjustmentEvent extends AWTEvent { Adjustable adjustable; /** - * value will contain the new value of the + * {@code value} will contain the new value of the * adjustable object. This value will always be in a * range associated adjustable object. * @@ -117,7 +117,7 @@ public class AdjustmentEvent extends AWTEvent { int value; /** - * The adjustmentType describes how the adjustable + * The {@code adjustmentType} describes how the adjustable * object value has changed. * This value can be increased/decreased by a block or unit amount * where the block is associated with page increments/decrements, @@ -130,7 +130,7 @@ public class AdjustmentEvent extends AWTEvent { /** - * The isAdjusting is true if the event is one + * The {@code isAdjusting} is true if the event is one * of the series of multiple adjustment events. * * @since 1.4 @@ -147,14 +147,14 @@ public class AdjustmentEvent extends AWTEvent { /** - * Constructs an AdjustmentEvent object with the - * specified Adjustable source, event type, + * Constructs an {@code AdjustmentEvent} object with the + * specified {@code Adjustable} source, event type, * adjustment type, and value. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Adjustable object where the + * @param source The {@code Adjustable} object where the * event originated * @param id An integer indicating the type of event. * For information on allowable values, see @@ -163,7 +163,7 @@ public class AdjustmentEvent extends AWTEvent { * For information on allowable values, see * the class description for {@link AdjustmentEvent} * @param value The current value of the adjustment - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getAdjustmentType() @@ -174,13 +174,13 @@ public class AdjustmentEvent extends AWTEvent { } /** - * Constructs an AdjustmentEvent object with the + * Constructs an {@code AdjustmentEvent} object with the * specified Adjustable source, event type, adjustment type, and value. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Adjustable object where the + * @param source The {@code Adjustable} object where the * event originated * @param id An integer indicating the type of event. * For information on allowable values, see @@ -189,10 +189,10 @@ public class AdjustmentEvent extends AWTEvent { * For information on allowable values, see * the class description for {@link AdjustmentEvent} * @param value The current value of the adjustment - * @param isAdjusting A boolean that equals true if the event is one + * @param isAdjusting A boolean that equals {@code true} if the event is one * of a series of multiple adjusting events, - * otherwise false - * @throws IllegalArgumentException if source is null + * otherwise {@code false} + * @throws IllegalArgumentException if {@code source} is null * @since 1.4 * @see #getSource() * @see #getID() @@ -209,9 +209,9 @@ public class AdjustmentEvent extends AWTEvent { } /** - * Returns the Adjustable object where this event originated. + * Returns the {@code Adjustable} object where this event originated. * - * @return the Adjustable object where this event originated + * @return the {@code Adjustable} object where this event originated */ public Adjustable getAdjustable() { return adjustable; @@ -243,11 +243,11 @@ public class AdjustmentEvent extends AWTEvent { } /** - * Returns true if this is one of multiple + * Returns {@code true} if this is one of multiple * adjustment events. * - * @return true if this is one of multiple - * adjustment events, otherwise returns false + * @return {@code true} if this is one of multiple + * adjustment events, otherwise returns {@code false} * @since 1.4 */ public boolean getValueIsAdjusting() { diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java index 2e3ab4c2ca2..47cd188d2c3 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

      - * Extend this class to create a ComponentEvent listener + * Extend this class to create a {@code ComponentEvent} listener * and override the methods for the events of interest. (If you implement the - * ComponentListener interface, you have to define all of + * {@code ComponentListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

      * Create a listener object using your class and then register it with a - * component using the component's addComponentListener + * component using the component's {@code addComponentListener} * method. When the component's size, location, or visibility * changes, the relevant method in the listener object is invoked, - * and the ComponentEvent is passed to it. + * and the {@code ComponentEvent} is passed to it. * * @see ComponentEvent * @see ComponentListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java index d168f6c1763..705a9fb5848 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentEvent.java @@ -47,12 +47,12 @@ import java.lang.annotation.Native; *

      * This low-level event is generated by a component object (such as a * List) when the component is moved, resized, rendered invisible, or made - * visible again. The event is passed to every ComponentListener - * or ComponentAdapter object which registered to receive such - * events using the component's addComponentListener method. - * (ComponentAdapter objects implement the - * ComponentListener interface.) Each such listener object - * gets this ComponentEvent when the event occurs. + * visible again. The event is passed to every {@code ComponentListener} + * or {@code ComponentAdapter} object which registered to receive such + * events using the component's {@code addComponentListener} method. + * ({@code ComponentAdapter} objects implement the + * {@code ComponentListener} interface.) Each such listener object + * gets this {@code ComponentEvent} when the event occurs. *

      * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code ComponentEvent} instance is not @@ -103,16 +103,16 @@ public class ComponentEvent extends AWTEvent { private static final long serialVersionUID = 8101406823902992965L; /** - * Constructs a ComponentEvent object. + * Constructs a {@code ComponentEvent} object. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link ComponentEvent} - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getComponent() * @see #getID() */ @@ -123,9 +123,9 @@ public class ComponentEvent extends AWTEvent { /** * Returns the originator of the event. * - * @return the Component object that originated - * the event, or null if the object is not a - * Component. + * @return the {@code Component} object that originated + * the event, or {@code null} if the object is not a + * {@code Component}. */ public Component getComponent() { return (source instanceof Component) ? (Component)source : null; diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java index e3e83e638d1..e316597590a 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ComponentListener.java @@ -31,18 +31,18 @@ import java.util.EventListener; * The listener interface for receiving component events. * The class that is interested in processing a component event * either implements this interface (and all the methods it - * contains) or extends the abstract ComponentAdapter class + * contains) or extends the abstract {@code ComponentAdapter} class * (overriding only the methods of interest). * The listener object created from that class is then registered with a - * component using the component's addComponentListener + * component using the component's {@code addComponentListener} * method. When the component's size, location, or visibility * changes, the relevant method in the listener object is invoked, - * and the ComponentEvent is passed to it. + * and the {@code ComponentEvent} is passed to it. *

      * Component events are provided for notification purposes ONLY; * The AWT will automatically handle component moves and resizes * internally so that GUI layout works properly regardless of - * whether a program registers a ComponentListener or not. + * whether a program registers a {@code ComponentListener} or not. * * @see ComponentAdapter * @see ComponentEvent diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java index e4af172bc39..9a333b3d666 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

      - * Extend this class to create a ContainerEvent listener + * Extend this class to create a {@code ContainerEvent} listener * and override the methods for the events of interest. (If you implement the - * ContainerListener interface, you have to define all of + * {@code ContainerListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

      * Create a listener object using the extended class and then register it with - * a component using the component's addContainerListener + * a component using the component's {@code addContainerListener} * method. When the container's contents change because a component has * been added or removed, the relevant method in the listener object is invoked, - * and the ContainerEvent is passed to it. + * and the {@code ContainerEvent} is passed to it. * * @see ContainerEvent * @see ContainerListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java index 964b27cd22c..7aecc21b963 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerEvent.java @@ -39,12 +39,12 @@ import java.awt.Component; *

      * This low-level event is generated by a container object (such as a * Panel) when a component is added to it or removed from it. - * The event is passed to every ContainerListener - * or ContainerAdapter object which registered to receive such - * events using the component's addContainerListener method. - * (ContainerAdapter objects implement the - * ContainerListener interface.) Each such listener object - * gets this ContainerEvent when the event occurs. + * The event is passed to every {@code ContainerListener} + * or {@code ContainerAdapter} object which registered to receive such + * events using the component's {@code addContainerListener} method. + * ({@code ContainerAdapter} objects implement the + * {@code ContainerListener} interface.) Each such listener object + * gets this {@code ContainerEvent} when the event occurs. *

      * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code ContainerEvent} instance is not @@ -95,18 +95,18 @@ public class ContainerEvent extends ComponentEvent { private static final long serialVersionUID = -4114942250539772041L; /** - * Constructs a ContainerEvent object. + * Constructs a {@code ContainerEvent} object. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component object (container) + * @param source The {@code Component} object (container) * that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link ContainerEvent} * @param child the component that was added or removed - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getContainer() * @see #getID() * @see #getChild() @@ -119,9 +119,9 @@ public class ContainerEvent extends ComponentEvent { /** * Returns the originator of the event. * - * @return the Container object that originated - * the event, or null if the object is not a - * Container. + * @return the {@code Container} object that originated + * the event, or {@code null} if the object is not a + * {@code Container}. */ public Container getContainer() { return (source instanceof Container) ? (Container)source : null; diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java index c99c5b9c94b..a0557327c82 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ContainerListener.java @@ -31,13 +31,13 @@ import java.util.EventListener; * The listener interface for receiving container events. * The class that is interested in processing a container event * either implements this interface (and all the methods it - * contains) or extends the abstract ContainerAdapter class + * contains) or extends the abstract {@code ContainerAdapter} class * (overriding only the methods of interest). * The listener object created from that class is then registered with a - * component using the component's addContainerListener + * component using the component's {@code addContainerListener} * method. When the container's contents change because a component * has been added or removed, the relevant method in the listener object - * is invoked, and the ContainerEvent is passed to it. + * is invoked, and the {@code ContainerEvent} is passed to it. *

      * Container events are provided for notification purposes ONLY; * The AWT will automatically handle add and remove operations diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java index 5676d082e82..1525990d5aa 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/FocusAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

      - * Extend this class to create a FocusEvent listener + * Extend this class to create a {@code FocusEvent} listener * and override the methods for the events of interest. (If you implement the - * FocusListener interface, you have to define all of + * {@code FocusListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

      * Create a listener object using the extended class and then register it with - * a component using the component's addFocusListener + * a component using the component's {@code addFocusListener} * method. When the component gains or loses the keyboard focus, * the relevant method in the listener object is invoked, - * and the FocusEvent is passed to it. + * and the {@code FocusEvent} is passed to it. * * @see FocusEvent * @see FocusListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java index 2f9e1911c99..afef05edef0 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/FocusEvent.java @@ -32,11 +32,11 @@ import sun.awt.SunToolkit; /** * A low-level event which indicates that a Component has gained or lost the * input focus. This low-level event is generated by a Component (such as a - * TextField). The event is passed to every FocusListener or - * FocusAdapter object which registered to receive such events - * using the Component's addFocusListener method. ( - * FocusAdapter objects implement the FocusListener - * interface.) Each such listener object gets this FocusEvent when + * TextField). The event is passed to every {@code FocusListener} or + * {@code FocusAdapter} object which registered to receive such events + * using the Component's {@code addFocusListener} method. + * ({@code FocusAdapter} objects implement the {@code FocusListener} + * interface.) Each such listener object gets this {@code FocusEvent} when * the event occurs. *

      * There are two levels of focus events: permanent and temporary. Permanent @@ -114,30 +114,30 @@ public class FocusEvent extends ComponentEvent { private static final long serialVersionUID = 523753786457416396L; /** - * Constructs a FocusEvent object with the - * specified temporary state and opposite Component. - * The opposite Component is the other - * Component involved in this focus change. - * For a FOCUS_GAINED event, this is the - * Component that lost focus. For a - * FOCUS_LOST event, this is the Component + * Constructs a {@code FocusEvent} object with the + * specified temporary state and opposite {@code Component}. + * The opposite {@code Component} is the other + * {@code Component} involved in this focus change. + * For a {@code FOCUS_GAINED} event, this is the + * {@code Component} that lost focus. For a + * {@code FOCUS_LOST} event, this is the {@code Component} * that gained focus. If this focus change occurs with a native * application, with a Java application in a different VM, - * or with no other Component, then the opposite - * Component is null. + * or with no other {@code Component}, then the opposite + * {@code Component} is {@code null}. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link FocusEvent} - * @param temporary Equals true if the focus change is temporary; - * false otherwise + * @param temporary Equals {@code true} if the focus change is temporary; + * {@code false} otherwise * @param opposite The other Component involved in the focus change, - * or null - * @throws IllegalArgumentException if source equals {@code null} + * or {@code null} + * @throws IllegalArgumentException if {@code source} equals {@code null} * @see #getSource() * @see #getID() * @see #isTemporary() @@ -152,19 +152,19 @@ public class FocusEvent extends ComponentEvent { } /** - * Constructs a FocusEvent object and identifies + * Constructs a {@code FocusEvent} object and identifies * whether or not the change is temporary. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link FocusEvent} - * @param temporary Equals true if the focus change is temporary; - * false otherwise - * @throws IllegalArgumentException if source equals {@code null} + * @param temporary Equals {@code true} if the focus change is temporary; + * {@code false} otherwise + * @throws IllegalArgumentException if {@code source} equals {@code null} * @see #getSource() * @see #getID() * @see #isTemporary() @@ -174,17 +174,17 @@ public class FocusEvent extends ComponentEvent { } /** - * Constructs a FocusEvent object and identifies it + * Constructs a {@code FocusEvent} object and identifies it * as a permanent change in focus. *

      This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link FocusEvent} - * @throws IllegalArgumentException if source equals {@code null} + * @throws IllegalArgumentException if {@code source} equals {@code null} * @see #getSource() * @see #getID() */ @@ -195,8 +195,8 @@ public class FocusEvent extends ComponentEvent { /** * Identifies the focus change event as temporary or permanent. * - * @return true if the focus change is temporary; - * false otherwise + * @return {@code true} if the focus change is temporary; + * {@code false} otherwise */ public boolean isTemporary() { return temporary; diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java index 31edd5a0726..2acd1035305 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/FocusListener.java @@ -32,13 +32,13 @@ import java.util.EventListener; * a component. * The class that is interested in processing a focus event * either implements this interface (and all the methods it - * contains) or extends the abstract FocusAdapter class + * contains) or extends the abstract {@code FocusAdapter} class * (overriding only the methods of interest). * The listener object created from that class is then registered with a - * component using the component's addFocusListener + * component using the component's {@code addFocusListener} * method. When the component gains or loses the keyboard focus, * the relevant method in the listener object - * is invoked, and the FocusEvent is passed to it. + * is invoked, and the {@code FocusEvent} is passed to it. * * @see FocusAdapter * @see FocusEvent diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java index c17801468ad..5fa165a6839 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsAdapter.java @@ -31,16 +31,16 @@ package java.awt.event; * convenience for creating listener objects. *

      * Extend this class and override the method for the event of interest. (If - * you implement the HierarchyBoundsListener interface, you have + * you implement the {@code HierarchyBoundsListener} interface, you have * to define both methods in it. This abstract class defines null methods for * them both, so you only have to define the method for the event you care * about.) *

      * Create a listener object using your class and then register it with a - * Component using the Component's addHierarchyBoundsListener + * Component using the Component's {@code addHierarchyBoundsListener} * method. When the hierarchy to which the Component belongs changes by * resize or movement of an ancestor, the relevant method in the listener - * object is invoked, and the HierarchyEvent is passed to it. + * object is invoked, and the {@code HierarchyEvent} is passed to it. * * @author David Mendenhall * @see HierarchyBoundsListener diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java index a8f21342e9e..bc997939b43 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyBoundsListener.java @@ -31,18 +31,18 @@ import java.util.EventListener; * The listener interface for receiving ancestor moved and resized events. * The class that is interested in processing these events either implements * this interface (and all the methods it contains) or extends the abstract - * HierarchyBoundsAdapter class (overriding only the method of + * {@code HierarchyBoundsAdapter} class (overriding only the method of * interest). * The listener object created from that class is then registered with a - * Component using the Component's addHierarchyBoundsListener + * Component using the Component's {@code addHierarchyBoundsListener} * method. When the hierarchy to which the Component belongs changes by * the resizing or movement of an ancestor, the relevant method in the listener - * object is invoked, and the HierarchyEvent is passed to it. + * object is invoked, and the {@code HierarchyEvent} is passed to it. *

      * Hierarchy events are provided for notification purposes ONLY; * The AWT will automatically handle changes to the hierarchy internally so * that GUI layout works properly regardless of whether a - * program registers an HierarchyBoundsListener or not. + * program registers an {@code HierarchyBoundsListener} or not. * * @author David Mendenhall * @see HierarchyBoundsAdapter diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java index 47107b35981..c6cde2b5f0c 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyEvent.java @@ -30,8 +30,8 @@ import java.awt.Component; import java.awt.Container; /** - * An event which indicates a change to the Component - * hierarchy to which Component belongs. + * An event which indicates a change to the {@code Component} + * hierarchy to which {@code Component} belongs. *

        *
      • Hierarchy Change Events (HierarchyListener) *
          @@ -57,18 +57,18 @@ import java.awt.Container; * This event is generated by a Container object (such as a Panel) when the * Container is added, removed, moved, or resized, and passed down the * hierarchy. It is also generated by a Component object when that object's - * addNotify, removeNotify, show, or - * hide method is called. The {@code ANCESTOR_MOVED} and + * {@code addNotify}, {@code removeNotify}, {@code show}, or + * {@code hide} method is called. The {@code ANCESTOR_MOVED} and * {@code ANCESTOR_RESIZED} - * events are dispatched to every HierarchyBoundsListener or - * HierarchyBoundsAdapter object which registered to receive - * such events using the Component's addHierarchyBoundsListener - * method. (HierarchyBoundsAdapter objects implement the - * HierarchyBoundsListener interface.) The {@code HIERARCHY_CHANGED} events are - * dispatched to every HierarchyListener object which registered - * to receive such events using the Component's addHierarchyListener - * method. Each such listener object gets this HierarchyEvent - * when the event occurs. + * events are dispatched to every {@code HierarchyBoundsListener} or + * {@code HierarchyBoundsAdapter} object which registered to receive + * such events using the Component's {@code addHierarchyBoundsListener} + * method. ({@code HierarchyBoundsAdapter} objects implement the + * {@code HierarchyBoundsListener} interface.) The {@code HIERARCHY_CHANGED} events are + * dispatched to every {@code HierarchyListener} object which registered + * to receive such events using the Component's {@code addHierarchyListener} + * method. Each such listener object gets this {@code HierarchyEvent} + * when the event occurs. *

          * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code HierarchyEvent} instance is not @@ -122,20 +122,20 @@ public class HierarchyEvent extends AWTEvent { public static final int HIERARCHY_LAST = ANCESTOR_RESIZED; /** - * A change flag indicates that the HIERARCHY_CHANGED event + * A change flag indicates that the {@code HIERARCHY_CHANGED} event * was generated by a reparenting operation. */ public static final int PARENT_CHANGED = 0x1; /** - * A change flag indicates that the HIERARCHY_CHANGED event + * A change flag indicates that the {@code HIERARCHY_CHANGED} event * was generated due to the changing of the hierarchy displayability. * To discern the * current displayability of the hierarchy, call the - * Component.isDisplayable method. Displayability changes occur + * {@code Component.isDisplayable} method. Displayability changes occur * in response to explicit or implicit calls of the - * Component.addNotify and - * Component.removeNotify methods. + * {@code Component.addNotify} and + * {@code Component.removeNotify} methods. * * @see java.awt.Component#isDisplayable() * @see java.awt.Component#addNotify() @@ -144,15 +144,15 @@ public class HierarchyEvent extends AWTEvent { public static final int DISPLAYABILITY_CHANGED = 0x2; /** - * A change flag indicates that the HIERARCHY_CHANGED event + * A change flag indicates that the {@code HIERARCHY_CHANGED} event * was generated due to the changing of the hierarchy showing state. * To discern the * current showing state of the hierarchy, call the - * Component.isShowing method. Showing state changes occur + * {@code Component.isShowing} method. Showing state changes occur * when either the displayability or visibility of the * hierarchy occurs. Visibility changes occur in response to explicit - * or implicit calls of the Component.show and - * Component.hide methods. + * or implicit calls of the {@code Component.show} and + * {@code Component.hide} methods. * * @see java.awt.Component#isShowing() * @see java.awt.Component#addNotify() @@ -167,24 +167,24 @@ public class HierarchyEvent extends AWTEvent { long changeFlags; /** - * Constructs an HierarchyEvent object to identify a - * change in the Component hierarchy. + * Constructs an {@code HierarchyEvent} object to identify a + * change in the {@code Component} hierarchy. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component object that + * @param source The {@code Component} object that * originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link HierarchyEvent} - * @param changed The Component at the top of + * @param changed The {@code Component} at the top of * the hierarchy which was changed - * @param changedParent The parent of the changed component. + * @param changedParent The parent of the {@code changed} component. * This * may be the parent before or after the * change, depending on the type of change - * @throws IllegalArgumentException if source is {@code null} + * @throws IllegalArgumentException if {@code source} is {@code null} * @see #getSource() * @see #getID() * @see #getChanged() @@ -198,29 +198,29 @@ public class HierarchyEvent extends AWTEvent { } /** - * Constructs an HierarchyEvent object to identify - * a change in the Component hierarchy. + * Constructs an {@code HierarchyEvent} object to identify + * a change in the {@code Component} hierarchy. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component object that + * @param source The {@code Component} object that * originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link HierarchyEvent} - * @param changed The Component at the top + * @param changed The {@code Component} at the top * of the hierarchy which was changed - * @param changedParent The parent of the changed component. + * @param changedParent The parent of the {@code changed} component. * This * may be the parent before or after the * change, depending on the type of change * @param changeFlags A bitmask which indicates the type(s) of - * the HIERARCHY_CHANGED events + * the {@code HIERARCHY_CHANGED} events * represented in this event object. * For information on allowable values, see * the class description for {@link HierarchyEvent} - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getChanged() @@ -238,9 +238,9 @@ public class HierarchyEvent extends AWTEvent { /** * Returns the originator of the event. * - * @return the Component object that originated - * the event, or null if the object is not a - * Component. + * @return the {@code Component} object that originated + * the event, or {@code null} if the object is not a + * {@code Component}. */ public Component getComponent() { return (source instanceof Component) ? (Component)source : null; @@ -257,13 +257,13 @@ public class HierarchyEvent extends AWTEvent { } /** - * Returns the parent of the Component returned by - * getChanged(). For a HIERARCHY_CHANGED event where the - * change was of type PARENT_CHANGED via a call to - * Container.add, the parent returned is the parent + * Returns the parent of the Component returned by + * {@code getChanged()}. For a HIERARCHY_CHANGED event where the + * change was of type PARENT_CHANGED via a call to + * {@code Container.add}, the parent returned is the parent * after the add operation. For a HIERARCHY_CHANGED event where - * the change was of type PARENT_CHANGED via a call to - * Container.remove, the parent returned is the parent + * the change was of type PARENT_CHANGED via a call to + * {@code Container.remove}, the parent returned is the parent * before the remove operation. For all other events and types, * the parent returned is the parent during the operation. * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java index b681b54212e..b3fb3640343 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/HierarchyListener.java @@ -32,15 +32,15 @@ import java.util.EventListener; * The class that is interested in processing a hierarchy changed event * should implement this interface. * The listener object created from that class is then registered with a - * Component using the Component's addHierarchyListener + * Component using the Component's {@code addHierarchyListener} * method. When the hierarchy to which the Component belongs changes, the - * hierarchyChanged method in the listener object is invoked, - * and the HierarchyEvent is passed to it. + * {@code hierarchyChanged} method in the listener object is invoked, + * and the {@code HierarchyEvent} is passed to it. *

          * Hierarchy events are provided for notification purposes ONLY; * The AWT will automatically handle changes to the hierarchy internally so * that GUI layout, displayability, and visibility work properly regardless - * of whether a program registers a HierarchyListener or not. + * of whether a program registers a {@code HierarchyListener} or not. * * @author David Mendenhall * @see HierarchyEvent @@ -49,7 +49,7 @@ import java.util.EventListener; public interface HierarchyListener extends EventListener { /** * Called when the hierarchy has been changed. To discern the actual - * type of change, call HierarchyEvent.getChangeFlags(). + * type of change, call {@code HierarchyEvent.getChangeFlags()}. * * @param e the event to be processed * @see HierarchyEvent#getChangeFlags() diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java index ecf993530d3..d332d2d2735 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/InputEvent.java @@ -315,8 +315,8 @@ public abstract class InputEvent extends ComponentEvent { * Constructs an InputEvent object with the specified source component, * modifiers, and type. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the integer that identifies the event type. @@ -336,7 +336,7 @@ public abstract class InputEvent extends ComponentEvent { * Passing negative parameter * is not recommended. * Zero value means that no modifiers were passed - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getWhen() @@ -442,16 +442,16 @@ public abstract class InputEvent extends ComponentEvent { * button 2, and then releases them in the same order, * the following sequence of events is generated: *

          -     *    MOUSE_PRESSED:  BUTTON1_DOWN_MASK
          -     *    MOUSE_PRESSED:  BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK
          -     *    MOUSE_RELEASED: BUTTON2_DOWN_MASK
          -     *    MOUSE_CLICKED:  BUTTON2_DOWN_MASK
          -     *    MOUSE_RELEASED:
          -     *    MOUSE_CLICKED:
          +     *    {@code MOUSE_PRESSED}:  {@code BUTTON1_DOWN_MASK}
          +     *    {@code MOUSE_PRESSED}:  {@code BUTTON1_DOWN_MASK | BUTTON2_DOWN_MASK}
          +     *    {@code MOUSE_RELEASED}: {@code BUTTON2_DOWN_MASK}
          +     *    {@code MOUSE_CLICKED}:  {@code BUTTON2_DOWN_MASK}
          +     *    {@code MOUSE_RELEASED}:
          +     *    {@code MOUSE_CLICKED}:
                * 
          *

          * It is not recommended to compare the return value of this method - * using == because new modifiers can be added in the future. + * using {@code ==} because new modifiers can be added in the future. * For example, the appropriate way to check that SHIFT and BUTTON1 are * down, but CTRL is up is demonstrated by the following code: *

          @@ -494,7 +494,7 @@ public abstract class InputEvent extends ComponentEvent {
                * Returns a String describing the extended modifier keys and
                * mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".
                * These strings can be localized by changing the
          -     * awt.properties file.
          +     * {@code awt.properties} file.
                * 

          * Note that passing negative parameter is incorrect, * and will cause the returning an unspecified string. diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java index e1ec9abbcf5..00e6413fea1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/InputMethodEvent.java @@ -106,45 +106,45 @@ public class InputMethodEvent extends AWTEvent { private transient TextHitInfo visiblePosition; /** - * Constructs an InputMethodEvent with the specified + * Constructs an {@code InputMethodEvent} with the specified * source component, type, time, text, caret, and visiblePosition. *

          * The offsets of caret and visiblePosition are relative to the current - * composed text; that is, the composed text within text - * if this is an INPUT_METHOD_TEXT_CHANGED event, - * the composed text within the text of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. - *

          Note that passing in an invalid id results in + * composed text; that is, the composed text within {@code text} + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, + * the composed text within the {@code text} of the + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. + *

          Note that passing in an invalid {@code id} results in * unspecified behavior. This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the event type * @param when a long integer that specifies the time the event occurred * @param text the combined committed and composed text, - * committed text first; must be null - * when the event type is CARET_POSITION_CHANGED; - * may be null for - * INPUT_METHOD_TEXT_CHANGED if there's no + * committed text first; must be {@code null} + * when the event type is {@code CARET_POSITION_CHANGED}; + * may be {@code null} for + * {@code INPUT_METHOD_TEXT_CHANGED} if there's no * committed or composed text * @param committedCharacterCount the number of committed * characters in the text * @param caret the caret (a.k.a. insertion point); - * null if there's no caret within current + * {@code null} if there's no caret within current * composed text * @param visiblePosition the position that's most important - * to be visible; null if there's no + * to be visible; {@code null} if there's no * recommendation for a visible position within current * composed text - * @throws IllegalArgumentException if id is not + * @throws IllegalArgumentException if {@code id} is not * in the range - * INPUT_METHOD_FIRST..INPUT_METHOD_LAST; - * or if id is CARET_POSITION_CHANGED and - * text is not null; - * or if committedCharacterCount is not in the range - * 0..(text.getEndIndex() - text.getBeginIndex()) - * @throws IllegalArgumentException if source is null + * {@code INPUT_METHOD_FIRST}..{@code INPUT_METHOD_LAST}; + * or if id is {@code CARET_POSITION_CHANGED} and + * {@code text} is not {@code null}; + * or if {@code committedCharacterCount} is not in the range + * {@code 0}..{@code (text.getEndIndex() - text.getBeginIndex())} + * @throws IllegalArgumentException if {@code source} is null * * @since 1.4 */ @@ -177,46 +177,46 @@ public class InputMethodEvent extends AWTEvent { } /** - * Constructs an InputMethodEvent with the specified + * Constructs an {@code InputMethodEvent} with the specified * source component, type, text, caret, and visiblePosition. *

          * The offsets of caret and visiblePosition are relative to the current - * composed text; that is, the composed text within text - * if this is an INPUT_METHOD_TEXT_CHANGED event, - * the composed text within the text of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. + * composed text; that is, the composed text within {@code text} + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, + * the composed text within the {@code text} of the + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. * The time stamp for this event is initialized by invoking * {@link java.awt.EventQueue#getMostRecentEventTime()}. - *

          Note that passing in an invalid id results in + *

          Note that passing in an invalid {@code id} results in * unspecified behavior. This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the event type * @param text the combined committed and composed text, - * committed text first; must be null - * when the event type is CARET_POSITION_CHANGED; - * may be null for - * INPUT_METHOD_TEXT_CHANGED if there's no + * committed text first; must be {@code null} + * when the event type is {@code CARET_POSITION_CHANGED}; + * may be {@code null} for + * {@code INPUT_METHOD_TEXT_CHANGED} if there's no * committed or composed text * @param committedCharacterCount the number of committed * characters in the text * @param caret the caret (a.k.a. insertion point); - * null if there's no caret within current + * {@code null} if there's no caret within current * composed text * @param visiblePosition the position that's most important - * to be visible; null if there's no + * to be visible; {@code null} if there's no * recommendation for a visible position within current * composed text - * @throws IllegalArgumentException if id is not + * @throws IllegalArgumentException if {@code id} is not * in the range - * INPUT_METHOD_FIRST..INPUT_METHOD_LAST; - * or if id is CARET_POSITION_CHANGED and - * text is not null; - * or if committedCharacterCount is not in the range - * 0..(text.getEndIndex() - text.getBeginIndex()) - * @throws IllegalArgumentException if source is null + * {@code INPUT_METHOD_FIRST}..{@code INPUT_METHOD_LAST}; + * or if id is {@code CARET_POSITION_CHANGED} and + * {@code text} is not {@code null}; + * or if {@code committedCharacterCount} is not in the range + * {@code 0}..{@code (text.getEndIndex() - text.getBeginIndex())} + * @throws IllegalArgumentException if {@code source} is null */ public InputMethodEvent(Component source, int id, AttributedCharacterIterator text, int committedCharacterCount, @@ -228,39 +228,39 @@ public class InputMethodEvent extends AWTEvent { } /** - * Constructs an InputMethodEvent with the + * Constructs an {@code InputMethodEvent} with the * specified source component, type, caret, and visiblePosition. - * The text is set to null, - * committedCharacterCount to 0. + * The text is set to {@code null}, + * {@code committedCharacterCount} to 0. *

          - * The offsets of caret and visiblePosition + * The offsets of {@code caret} and {@code visiblePosition} * are relative to the current composed text; that is, - * the composed text within the text of the - * preceding INPUT_METHOD_TEXT_CHANGED event if the - * event being constructed as a CARET_POSITION_CHANGED event. - * For an INPUT_METHOD_TEXT_CHANGED event without text, - * caret and visiblePosition must be - * null. + * the composed text within the {@code text} of the + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event if the + * event being constructed as a {@code CARET_POSITION_CHANGED} event. + * For an {@code INPUT_METHOD_TEXT_CHANGED} event without text, + * {@code caret} and {@code visiblePosition} must be + * {@code null}. * The time stamp for this event is initialized by invoking * {@link java.awt.EventQueue#getMostRecentEventTime()}. - *

          Note that passing in an invalid id results in + *

          Note that passing in an invalid {@code id} results in * unspecified behavior. This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * * @param source the object where the event originated * @param id the event type * @param caret the caret (a.k.a. insertion point); - * null if there's no caret within current + * {@code null} if there's no caret within current * composed text * @param visiblePosition the position that's most important - * to be visible; null if there's no + * to be visible; {@code null} if there's no * recommendation for a visible position within current * composed text - * @throws IllegalArgumentException if id is not + * @throws IllegalArgumentException if {@code id} is not * in the range - * INPUT_METHOD_FIRST..INPUT_METHOD_LAST - * @throws IllegalArgumentException if source is null + * {@code INPUT_METHOD_FIRST}..{@code INPUT_METHOD_LAST} + * @throws IllegalArgumentException if {@code source} is null */ public InputMethodEvent(Component source, int id, TextHitInfo caret, TextHitInfo visiblePosition) { @@ -271,7 +271,7 @@ public class InputMethodEvent extends AWTEvent { /** * Gets the combined committed and composed text. - * Characters from index 0 to index getCommittedCharacterCount() - 1 are committed + * Characters from index 0 to index {@code getCommittedCharacterCount() - 1} are committed * text, the remaining characters are composed text. * * @return the text. @@ -295,9 +295,9 @@ public class InputMethodEvent extends AWTEvent { *

          * The offset of the caret is relative to the current * composed text; that is, the composed text within getText() - * if this is an INPUT_METHOD_TEXT_CHANGED event, + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, * the composed text within getText() of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. * * @return the caret (a.k.a. insertion point). * Null if there's no caret within current composed text. @@ -311,9 +311,9 @@ public class InputMethodEvent extends AWTEvent { *

          * The offset of the visible position is relative to the current * composed text; that is, the composed text within getText() - * if this is an INPUT_METHOD_TEXT_CHANGED event, + * if this is an {@code INPUT_METHOD_TEXT_CHANGED} event, * the composed text within getText() of the - * preceding INPUT_METHOD_TEXT_CHANGED event otherwise. + * preceding {@code INPUT_METHOD_TEXT_CHANGED} event otherwise. * * @return the position that's most important to be visible. * Null if there's no recommendation for a visible position within current composed text. @@ -411,7 +411,7 @@ public class InputMethodEvent extends AWTEvent { } /** - * Initializes the when field if it is not present in the + * Initializes the {@code when} field if it is not present in the * object input stream. In that case, the field will be initialized by * invoking {@link java.awt.EventQueue#getMostRecentEventTime()}. */ diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java index 34e3b5b01db..37a0c5f0084 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ItemEvent.java @@ -32,12 +32,12 @@ import java.awt.ItemSelectable; * A semantic event which indicates that an item was selected or deselected. * This high-level event is generated by an ItemSelectable object (such as a * List) when an item is selected or deselected by the user. - * The event is passed to every ItemListener object which + * The event is passed to every {@code ItemListener} object which * registered to receive such events using the component's - * addItemListener method. + * {@code addItemListener} method. *

          - * The object that implements the ItemListener interface gets - * this ItemEvent when the event occurs. The listener is + * The object that implements the {@code ItemListener} interface gets + * this {@code ItemEvent} when the event occurs. The listener is * spared the details of processing individual mouse movements and mouse * clicks, and can instead process a "meaningful" (semantic) event like * "item selected" or "item deselected". @@ -98,7 +98,7 @@ public class ItemEvent extends AWTEvent { Object item; /** - * stateChange indicates whether the item + * {@code stateChange} indicates whether the {@code item} * was selected or deselected. * * @serial @@ -112,12 +112,12 @@ public class ItemEvent extends AWTEvent { private static final long serialVersionUID = -608708132447206933L; /** - * Constructs an ItemEvent object. + * Constructs an {@code ItemEvent} object. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The ItemSelectable object + * @param source The {@code ItemSelectable} object * that originated the event * @param id The integer that identifies the event type. * For information on allowable values, see @@ -127,7 +127,7 @@ public class ItemEvent extends AWTEvent { * selected or deselected. * For information on allowable values, see * the class description for {@link ItemEvent} - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getItemSelectable() * @see #getID() * @see #getStateChange() diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java index 8d2cde627cc..c1533a3c3f8 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/ItemListener.java @@ -32,9 +32,9 @@ import java.util.EventListener; * The class that is interested in processing an item event * implements this interface. The object created with that * class is then registered with a component using the - * component's addItemListener method. When an + * component's {@code addItemListener} method. When an * item-selection event occurs, the listener object's - * itemStateChanged method is invoked. + * {@code itemStateChanged} method is invoked. * * @author Amy Fowler * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java index 846da09af14..12a8a6544a1 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyAdapter.java @@ -30,17 +30,17 @@ package java.awt.event; * The methods in this class are empty. This class exists as * convenience for creating listener objects. *

          - * Extend this class to create a KeyEvent listener + * Extend this class to create a {@code KeyEvent} listener * and override the methods for the events of interest. (If you implement the - * KeyListener interface, you have to define all of + * {@code KeyListener} interface, you have to define all of * the methods in it. This abstract class defines null methods for them * all, so you can only have to define methods for events you care about.) *

          * Create a listener object using the extended class and then register it with - * a component using the component's addKeyListener + * a component using the component's {@code addKeyListener} * method. When a key is pressed, released, or typed, * the relevant method in the listener object is invoked, - * and the KeyEvent is passed to it. + * and the {@code KeyEvent} is passed to it. * * @author Carl Quinn * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java index b8cbea6052e..f103d525271 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyEvent.java @@ -37,12 +37,12 @@ import sun.awt.AWTAccessor; *

          * This low-level event is generated by a component object (such as a text * field) when a key is pressed, released, or typed. - * The event is passed to every KeyListener - * or KeyAdapter object which registered to receive such - * events using the component's addKeyListener method. - * (KeyAdapter objects implement the - * KeyListener interface.) Each such listener object - * gets this KeyEvent when the event occurs. + * The event is passed to every {@code KeyListener} + * or {@code KeyAdapter} object which registered to receive such + * events using the component's {@code addKeyListener} method. + * ({@code KeyAdapter} objects implement the + * {@code KeyListener} interface.) Each such listener object + * gets this {@code KeyEvent} when the event occurs. *

          * "Key typed" events are higher-level and generally do not depend on * the platform or keyboard layout. They are generated when a Unicode character @@ -974,7 +974,7 @@ public class KeyEvent extends InputEvent { /** * A constant indicating that the keyLocation is indeterminate * or not relevant. - * KEY_TYPED events do not have a keyLocation; this value + * {@code KEY_TYPED} events do not have a keyLocation; this value * is used instead. * @since 1.4 */ @@ -1028,7 +1028,7 @@ public class KeyEvent extends InputEvent { int keyCode; /** - * keyChar is a valid unicode character + * {@code keyChar} is a valid unicode character * that is fired by a key or a key combination on * a keyboard. * @@ -1045,9 +1045,9 @@ public class KeyEvent extends InputEvent { * right shift keys. Additionally, some keys occur on the numeric * keypad. This variable is used to distinguish such keys. * - * The only legal values are KEY_LOCATION_UNKNOWN, - * KEY_LOCATION_STANDARD, KEY_LOCATION_LEFT, - * KEY_LOCATION_RIGHT, and KEY_LOCATION_NUMPAD. + * The only legal values are {@code KEY_LOCATION_UNKNOWN}, + * {@code KEY_LOCATION_STANDARD}, {@code KEY_LOCATION_LEFT}, + * {@code KEY_LOCATION_RIGHT}, and {@code KEY_LOCATION_NUMPAD}. * * @serial * @see #getKeyLocation() @@ -1115,12 +1115,12 @@ public class KeyEvent extends InputEvent { } /** - * Constructs a KeyEvent object. + * Constructs a {@code KeyEvent} object. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link KeyEvent} @@ -1142,19 +1142,19 @@ public class KeyEvent extends InputEvent { * CHAR_UNDEFINED (for key-pressed and key-released * events which do not map to a valid Unicode character) * @param keyLocation Identifies the key location. The only legal - * values are KEY_LOCATION_UNKNOWN, - * KEY_LOCATION_STANDARD, KEY_LOCATION_LEFT, - * KEY_LOCATION_RIGHT, and KEY_LOCATION_NUMPAD. + * values are {@code KEY_LOCATION_UNKNOWN}, + * {@code KEY_LOCATION_STANDARD}, {@code KEY_LOCATION_LEFT}, + * {@code KEY_LOCATION_RIGHT}, and {@code KEY_LOCATION_NUMPAD}. * @throws IllegalArgumentException - * if id is KEY_TYPED and - * keyChar is CHAR_UNDEFINED; - * or if id is KEY_TYPED and - * keyCode is not VK_UNDEFINED; - * or if id is KEY_TYPED and - * keyLocation is not KEY_LOCATION_UNKNOWN; - * or if keyLocation is not one of the legal + * if {@code id} is {@code KEY_TYPED} and + * {@code keyChar} is {@code CHAR_UNDEFINED}; + * or if {@code id} is {@code KEY_TYPED} and + * {@code keyCode} is not {@code VK_UNDEFINED}; + * or if {@code id} is {@code KEY_TYPED} and + * {@code keyLocation} is not {@code KEY_LOCATION_UNKNOWN}; + * or if {@code keyLocation} is not one of the legal * values enumerated above. - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getWhen() @@ -1196,12 +1196,12 @@ public class KeyEvent extends InputEvent { } /** - * Constructs a KeyEvent object. + * Constructs a {@code KeyEvent} object. *

          This method throws an - * IllegalArgumentException if source - * is null. + * {@code IllegalArgumentException} if {@code source} + * is {@code null}. * - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link KeyEvent} @@ -1222,12 +1222,12 @@ public class KeyEvent extends InputEvent { * @param keyChar The Unicode character generated by this event, or * CHAR_UNDEFINED (for key-pressed and key-released * events which do not map to a valid Unicode character) - * @throws IllegalArgumentException if id is - * KEY_TYPED and keyChar is - * CHAR_UNDEFINED; or if id is - * KEY_TYPED and keyCode is not - * VK_UNDEFINED - * @throws IllegalArgumentException if source is null + * @throws IllegalArgumentException if {@code id} is + * {@code KEY_TYPED} and {@code keyChar} is + * {@code CHAR_UNDEFINED}; or if {@code id} is + * {@code KEY_TYPED} and {@code keyCode} is not + * {@code VK_UNDEFINED} + * @throws IllegalArgumentException if {@code source} is null * @see #getSource() * @see #getID() * @see #getWhen() @@ -1243,7 +1243,7 @@ public class KeyEvent extends InputEvent { /** * @deprecated as of JDK1.1; use {@link #KeyEvent(Component, int, long, int, int, char)} instead - * @param source The Component that originated the event + * @param source The {@code Component} that originated the event * @param id An integer indicating the type of event. * For information on allowable values, see * the class description for {@link KeyEvent} @@ -1272,8 +1272,8 @@ public class KeyEvent extends InputEvent { * Returns the integer keyCode associated with the key in this event. * * @return the integer code for an actual key on the keyboard. - * (For KEY_TYPED events, the keyCode is - * VK_UNDEFINED.) + * (For {@code KEY_TYPED} events, the keyCode is + * {@code VK_UNDEFINED}.) */ public int getKeyCode() { return keyCode; @@ -1290,17 +1290,17 @@ public class KeyEvent extends InputEvent { /** * Returns the character associated with the key in this event. - * For example, the KEY_TYPED event for shift + "a" + * For example, the {@code KEY_TYPED} event for shift + "a" * returns the value for "A". *

          - * KEY_PRESSED and KEY_RELEASED events + * {@code KEY_PRESSED} and {@code KEY_RELEASED} events * are not intended for reporting of character input. Therefore, * the values returned by this method are guaranteed to be - * meaningful only for KEY_TYPED events. + * meaningful only for {@code KEY_TYPED} events. * * @return the Unicode character defined for this key event. * If no valid Unicode character exists for this key event, - * CHAR_UNDEFINED is returned. + * {@code CHAR_UNDEFINED} is returned. */ public char getKeyChar() { return keyChar; @@ -1322,7 +1322,7 @@ public class KeyEvent extends InputEvent { *

          * NOTE: use of this method is not recommended, because many AWT * implementations do not recognize modifier changes. This is - * especially true for KEY_TYPED events where the shift + * especially true for {@code KEY_TYPED} events where the shift * modifier is changed. * * @param modifiers an integer combination of the modifier constants. @@ -1347,8 +1347,8 @@ public class KeyEvent extends InputEvent { * keypad. This provides a way of distinguishing such keys. * * @return the location of the key that was pressed or released. - * Always returns KEY_LOCATION_UNKNOWN for - * KEY_TYPED events. + * Always returns {@code KEY_LOCATION_UNKNOWN} for + * {@code KEY_TYPED} events. * @since 1.4 */ public int getKeyLocation() { @@ -1541,15 +1541,15 @@ public class KeyEvent extends InputEvent { } /** - * Returns a String describing the modifier key(s), + * Returns a {@code String} describing the modifier key(s), * such as "Shift", or "Ctrl+Shift". These strings can be - * localized by changing the awt.properties file. + * localized by changing the {@code awt.properties} file. *

          - * Note that InputEvent.ALT_MASK and - * InputEvent.BUTTON2_MASK have the same value, + * Note that {@code InputEvent.ALT_MASK} and + * {@code InputEvent.BUTTON2_MASK} have the same value, * so the string "Alt" is returned for both modifiers. Likewise, - * InputEvent.META_MASK and - * InputEvent.BUTTON3_MASK have the same value, + * {@code InputEvent.META_MASK} and + * {@code InputEvent.BUTTON3_MASK} have the same value, * so the string "Meta" is returned for both modifiers. * * @param modifiers the modifier mask to be processed @@ -1595,8 +1595,8 @@ public class KeyEvent extends InputEvent { * Typically an action key does not fire a unicode character and is * not a modifier key. * - * @return true if the key is an "action" key, - * false otherwise + * @return {@code true} if the key is an "action" key, + * {@code false} otherwise */ public boolean isActionKey() { switch (keyCode) { diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java b/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java index 1a8ba31bae0..622c6b43991 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/KeyListener.java @@ -31,14 +31,14 @@ import java.util.EventListener; * The listener interface for receiving keyboard events (keystrokes). * The class that is interested in processing a keyboard event * either implements this interface (and all the methods it - * contains) or extends the abstract KeyAdapter class + * contains) or extends the abstract {@code KeyAdapter} class * (overriding only the methods of interest). *

          * The listener object created from that class is then registered with a - * component using the component's addKeyListener + * component using the component's {@code addKeyListener} * method. A keyboard event is generated when a key is pressed, released, * or typed. The relevant method in the listener - * object is then invoked, and the KeyEvent is passed to it. + * object is then invoked, and the {@code KeyEvent} is passed to it. * * @author Carl Quinn * diff --git a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java index de522828a4d..2ae987b8144 100644 --- a/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java +++ b/jdk/src/java.desktop/share/classes/java/awt/event/MouseEvent.java @@ -526,13 +526,15 @@ public class MouseEvent extends InputEvent { * {@link java.awt.MouseInfo#getNumberOfButtons() MouseInfo.getNumberOfButtons()} * if the mouse has more than three buttons. *

        - * @throws IllegalArgumentException if {@code button} is less then zero + * @throws IllegalArgumentException if {@code button} is less than zero * @throws IllegalArgumentException if {@code source} is null - * @throws IllegalArgumentException if {@code button} is greater then BUTTON3 and the support for extended mouse buttons is + * @throws IllegalArgumentException if {@code button} is greater than BUTTON3 + * and the support for extended mouse buttons is * {@link Toolkit#areExtraMouseButtonsEnabled() disabled} by Java - * @throws IllegalArgumentException if {@code button} is greater then the - * {@link java.awt.MouseInfo#getNumberOfButtons() current number of buttons} and the support - * for extended mouse buttons is {@link Toolkit#areExtraMouseButtonsEnabled() enabled} + * @throws IllegalArgumentException if {@code button} is greater than the + * {@link java.awt.MouseInfo#getNumberOfButtons() current number of buttons} + * and the support for extended mouse buttons is + * {@link Toolkit#areExtraMouseButtonsEnabled() enabled} * by Java * @throws IllegalArgumentException if an invalid {@code button} * value is passed in @@ -701,12 +703,14 @@ public class MouseEvent extends InputEvent { * {@link java.awt.MouseInfo#getNumberOfButtons() MouseInfo.getNumberOfButtons()} * if the mouse has more than three buttons. *
      - * @throws IllegalArgumentException if {@code button} is less then zero + * @throws IllegalArgumentException if {@code button} is less than zero * @throws IllegalArgumentException if {@code source} is null - * @throws IllegalArgumentException if {@code button} is greater then BUTTON3 and the support for extended mouse buttons is + * @throws IllegalArgumentException if {@code button} is greater than BUTTON3 + * and the support for extended mouse buttons is * {@link Toolkit#areExtraMouseButtonsEnabled() disabled} by Java - * @throws IllegalArgumentException if {@code button} is greater then the - * {@link java.awt.MouseInfo#getNumberOfButtons() current number of buttons} and the support + * @throws IllegalArgumentException if {@code button} is greater than the + * {@link java.awt.MouseInfo#getNumberOfButtons() + * current number of buttons} and the support * for extended mouse buttons is {@link Toolkit#areExtraMouseButtonsEnabled() enabled} * by Java * @throws IllegalArgumentException if an invalid {@code button} @@ -865,7 +869,8 @@ public class MouseEvent extends InputEvent { *
    5. 2 ({@code BUTTON2}) *
    6. 3 ({@code BUTTON3}) * - * Button numbers greater then {@code BUTTON3} have no constant identifier. So if a mouse with five buttons is + * Button numbers greater than {@code BUTTON3} have no constant identifier. + * So if a mouse with five buttons is * installed, this method may return the following values: * *

      * A Java Print Service instance is allowed to support any other doc flavors @@ -390,7 +390,7 @@ import java.io.Serializable; *

      * Class DocFlavor in package javax.print.data is similar to class * {@link java.awt.datatransfer.DataFlavor DataFlavor}. Class - * DataFlavor + * {@code DataFlavor} * is not used in the Java Print Service (JPS) API * for three reasons which are all rooted in allowing the JPS API to be * shared by other print services APIs which may need to run on Java profiles @@ -401,13 +401,13 @@ import java.io.Serializable; * AWT. * *

    7. - * The implementation of class java.awt.datatransfer.DataFlavor + * The implementation of class {@code java.awt.datatransfer.DataFlavor} * does not guarantee that equivalent data flavors will have the same * serialized representation. DocFlavor does, and can be used in services * which need this. * *
    8. - * The implementation of class java.awt.datatransfer.DataFlavor + * The implementation of class {@code java.awt.datatransfer.DataFlavor} * includes a human presentable name as part of the serialized representation. * This is not appropriate as part of a service matching constraint. * @@ -488,10 +488,10 @@ public class DocFlavor implements Serializable, Cloneable { * @param className Fully-qualified representation class name. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null or - * className is null. + * (unchecked exception) Thrown if {@code mimeType} is null or + * {@code className} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public DocFlavor(String mimeType, String className) { @@ -528,7 +528,7 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Returns a String representing a MIME + * Returns a {@code String} representing a MIME * parameter. * Mime types may include parameters which are usually optional. * The charset for text types is a commonly useful example. @@ -555,7 +555,7 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Converts this DocFlavor to a string. + * Converts this {@code DocFlavor} to a string. * * @return MIME type string based on the canonical form. Each parameter * value is enclosed in quotes. @@ -576,7 +576,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Determines if this doc flavor object is equal to the given object. * The two are equal if the given object is not null, is an instance - * of DocFlavor, has a MIME type equivalent to this doc + * of {@code DocFlavor}, has a MIME type equivalent to this doc * flavor object's MIME type (that is, the MIME types have the same media * type, media subtype, and parameters), and has the same representation * class name as this doc flavor object. Thus, if two doc flavor objects' @@ -588,7 +588,7 @@ public class DocFlavor implements Serializable, Cloneable { * * @param obj Object to test. * - * @return True if this doc flavor object equals obj, false + * @return True if this doc flavor object equals {@code obj}, false * otherwise. */ public boolean equals(Object obj) { @@ -642,7 +642,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.BYTE_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a byte array - * (byte[]) as the print data representation class. + * ({@code byte[]}) as the print data representation class. * * @author Alan Kaminsky */ @@ -652,14 +652,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of "[B" (byte array). + * data representation class name of {@code "[B"} (byte array). * * @param mimeType MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public BYTE_ARRAY (String mimeType) { @@ -667,19 +667,19 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain", + * Doc flavor with MIME type = {@code "text/plain"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_HOST = new BYTE_ARRAY ("text/plain; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-8", - * print data representation class name = "[B" (byte + * {@code "text/plain; charset=utf-8"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_8 = @@ -687,8 +687,8 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16", - * print data representation class name = "[B" (byte + * {@code "text/plain; charset=utf-16"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16 = @@ -697,9 +697,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16be" + * {@code "text/plain; charset=utf-16be"} * (big-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16BE = @@ -707,9 +707,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16le" + * {@code "text/plain; charset=utf-16le"} * (little-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_PLAIN_UTF_16LE = @@ -717,28 +717,28 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/plain; charset=us-ascii", + * {@code "text/plain; charset=us-ascii"}, * print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_PLAIN_US_ASCII = new BYTE_ARRAY ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = "text/html", + * Doc flavor with MIME type = {@code "text/html"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_HOST = new BYTE_ARRAY ("text/html; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/html; charset=utf-8", - * print data representation class name = "[B" (byte + * {@code "text/html; charset=utf-8"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_8 = @@ -746,8 +746,8 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=utf-16", - * print data representation class name = "[B" (byte + * {@code "text/html; charset=utf-16"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16 = @@ -755,9 +755,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=utf-16be" + * {@code "text/html; charset=utf-16be"} * (big-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16BE = @@ -765,9 +765,9 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=utf-16le" + * {@code "text/html; charset=utf-16le"} * (little-endian byte ordering), - * print data representation class name = "[B" (byte + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY TEXT_HTML_UTF_16LE = @@ -775,58 +775,58 @@ public class DocFlavor implements Serializable, Cloneable { /** * Doc flavor with MIME type = - * "text/html; charset=us-ascii", + * {@code "text/html; charset=us-ascii"}, * print data representation class name = - * "[B" (byte array). + * {@code "[B"} (byte array). */ public static final BYTE_ARRAY TEXT_HTML_US_ASCII = new BYTE_ARRAY ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = "application/pdf", print - * data representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "application/pdf"}, print + * data representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY PDF = new BYTE_ARRAY ("application/pdf"); /** - * Doc flavor with MIME type = "application/postscript", - * print data representation class name = "[B" (byte + * Doc flavor with MIME type = {@code "application/postscript"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY POSTSCRIPT = new BYTE_ARRAY ("application/postscript"); /** - * Doc flavor with MIME type = "application/vnd.hp-PCL", - * print data representation class name = "[B" (byte + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, + * print data representation class name = {@code "[B"} (byte * array). */ public static final BYTE_ARRAY PCL = new BYTE_ARRAY ("application/vnd.hp-PCL"); /** - * Doc flavor with MIME type = "image/gif", print data - * representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "image/gif"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY GIF = new BYTE_ARRAY ("image/gif"); /** - * Doc flavor with MIME type = "image/jpeg", print data - * representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "image/jpeg"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY JPEG = new BYTE_ARRAY ("image/jpeg"); /** - * Doc flavor with MIME type = "image/png", print data - * representation class name = "[B" (byte array). + * Doc flavor with MIME type = {@code "image/png"}, print data + * representation class name = {@code "[B"} (byte array). */ public static final BYTE_ARRAY PNG = new BYTE_ARRAY ("image/png"); /** * Doc flavor with MIME type = - * "application/octet-stream", - * print data representation class name = "[B" (byte + * {@code "application/octet-stream"}, + * print data representation class name = {@code "[B"} (byte * array). The client must determine that data described * using this DocFlavor is valid for the printer. */ @@ -850,14 +850,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print * data representation class name of - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). * * @param mimeType MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public INPUT_STREAM (String mimeType) { @@ -865,169 +865,169 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain", + * Doc flavor with MIME type = {@code "text/plain"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_HOST = new INPUT_STREAM ("text/plain; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-8", + * {@code "text/plain; charset=utf-8"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_8 = new INPUT_STREAM ("text/plain; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16", + * {@code "text/plain; charset=utf-16"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16 = new INPUT_STREAM ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16be" + * {@code "text/plain; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16BE = new INPUT_STREAM ("text/plain; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16le" + * {@code "text/plain; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_UTF_16LE = new INPUT_STREAM ("text/plain; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/plain; charset=us-ascii", + * {@code "text/plain; charset=us-ascii"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_PLAIN_US_ASCII = new INPUT_STREAM ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = "text/html", + * Doc flavor with MIME type = {@code "text/html"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_HOST = new INPUT_STREAM ("text/html; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/html; charset=utf-8", + * {@code "text/html; charset=utf-8"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_8 = new INPUT_STREAM ("text/html; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16", + * {@code "text/html; charset=utf-16"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16 = new INPUT_STREAM ("text/html; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16be" + * {@code "text/html; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16BE = new INPUT_STREAM ("text/html; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16le" + * {@code "text/html; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_UTF_16LE = new INPUT_STREAM ("text/html; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/html; charset=us-ascii", + * {@code "text/html; charset=us-ascii"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM TEXT_HTML_US_ASCII = new INPUT_STREAM ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = "application/pdf", print - * data representation class name = "java.io.InputStream" + * Doc flavor with MIME type = {@code "application/pdf"}, print + * data representation class name = {@code "java.io.InputStream"} * (byte stream). */ public static final INPUT_STREAM PDF = new INPUT_STREAM ("application/pdf"); /** - * Doc flavor with MIME type = "application/postscript", + * Doc flavor with MIME type = {@code "application/postscript"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM POSTSCRIPT = new INPUT_STREAM ("application/postscript"); /** - * Doc flavor with MIME type = "application/vnd.hp-PCL", + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM PCL = new INPUT_STREAM ("application/vnd.hp-PCL"); /** - * Doc flavor with MIME type = "image/gif", print data + * Doc flavor with MIME type = {@code "image/gif"}, print data * representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM GIF = new INPUT_STREAM ("image/gif"); /** - * Doc flavor with MIME type = "image/jpeg", print data + * Doc flavor with MIME type = {@code "image/jpeg"}, print data * representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM JPEG = new INPUT_STREAM ("image/jpeg"); /** - * Doc flavor with MIME type = "image/png", print data + * Doc flavor with MIME type = {@code "image/png"}, print data * representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). */ public static final INPUT_STREAM PNG = new INPUT_STREAM ("image/png"); /** * Doc flavor with MIME type = - * "application/octet-stream", + * {@code "application/octet-stream"}, * print data representation class name = - * "java.io.InputStream" (byte stream). + * {@code "java.io.InputStream"} (byte stream). * The client must determine that data described * using this DocFlavor is valid for the printer. */ @@ -1050,14 +1050,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of "java.net.URL". + * data representation class name of {@code "java.net.URL"}. * * @param mimeType MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public URL (String mimeType) { @@ -1065,160 +1065,160 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain", + * Doc flavor with MIME type = {@code "text/plain"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_HOST = new URL ("text/plain; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-8", + * {@code "text/plain; charset=utf-8"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_8 = new URL ("text/plain; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16", + * {@code "text/plain; charset=utf-16"}, * print data representation class name = - * java.net.URL"" (byte stream). + * {@code java.net.URL""} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16 = new URL ("text/plain; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16be" + * {@code "text/plain; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16BE = new URL ("text/plain; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/plain; charset=utf-16le" + * {@code "text/plain; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_UTF_16LE = new URL ("text/plain; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/plain; charset=us-ascii", + * {@code "text/plain; charset=us-ascii"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_PLAIN_US_ASCII = new URL ("text/plain; charset=us-ascii"); /** - * Doc flavor with MIME type = "text/html", + * Doc flavor with MIME type = {@code "text/html"}, * encoded in the host platform encoding. * See {@link DocFlavor#hostEncoding hostEncoding} * Print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_HOST = new URL ("text/html; charset="+hostEncoding); /** * Doc flavor with MIME type = - * "text/html; charset=utf-8", + * {@code "text/html; charset=utf-8"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_8 = new URL ("text/html; charset=utf-8"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16", + * {@code "text/html; charset=utf-16"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16 = new URL ("text/html; charset=utf-16"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16be" + * {@code "text/html; charset=utf-16be"} * (big-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16BE = new URL ("text/html; charset=utf-16be"); /** * Doc flavor with MIME type = - * "text/html; charset=utf-16le" + * {@code "text/html; charset=utf-16le"} * (little-endian byte ordering), * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_UTF_16LE = new URL ("text/html; charset=utf-16le"); /** * Doc flavor with MIME type = - * "text/html; charset=us-ascii", + * {@code "text/html; charset=us-ascii"}, * print data representation class name = - * "java.net.URL" (byte stream). + * {@code "java.net.URL"} (byte stream). */ public static final URL TEXT_HTML_US_ASCII = new URL ("text/html; charset=us-ascii"); /** - * Doc flavor with MIME type = "application/pdf", print - * data representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "application/pdf"}, print + * data representation class name = {@code "java.net.URL"}. */ public static final URL PDF = new URL ("application/pdf"); /** - * Doc flavor with MIME type = "application/postscript", - * print data representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "application/postscript"}, + * print data representation class name = {@code "java.net.URL"}. */ public static final URL POSTSCRIPT = new URL ("application/postscript"); /** - * Doc flavor with MIME type = "application/vnd.hp-PCL", - * print data representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "application/vnd.hp-PCL"}, + * print data representation class name = {@code "java.net.URL"}. */ public static final URL PCL = new URL ("application/vnd.hp-PCL"); /** - * Doc flavor with MIME type = "image/gif", print data - * representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "image/gif"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL GIF = new URL ("image/gif"); /** - * Doc flavor with MIME type = "image/jpeg", print data - * representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "image/jpeg"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL JPEG = new URL ("image/jpeg"); /** - * Doc flavor with MIME type = "image/png", print data - * representation class name = "java.net.URL". + * Doc flavor with MIME type = {@code "image/png"}, print data + * representation class name = {@code "java.net.URL"}. */ public static final URL PNG = new URL ("image/png"); /** * Doc flavor with MIME type = - * "application/octet-stream", - * print data representation class name = "java.net.URL". + * {@code "application/octet-stream"}, + * print data representation class name = {@code "java.net.URL"}. * The client must determine that data described * using this DocFlavor is valid for the printer. */ @@ -1229,7 +1229,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Class DocFlavor.CHAR_ARRAY provides predefined static constant * DocFlavor objects for example doc flavors using a character array - * (char[]) as the print data representation class. As such, + * ({@code char[]}) as the print data representation class. As such, * the character set is Unicode. * * @author Alan Kaminsky @@ -1241,16 +1241,16 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print * data representation class name of - * "[C" (character array). + * {@code "[C"} (character array). * * @param mimeType MIME media type string. If it is a text media * type, it is assumed to contain a - * "charset=utf-16" parameter. + * {@code "charset=utf-16"} parameter. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public CHAR_ARRAY (String mimeType) { @@ -1258,17 +1258,17 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain; - * charset=utf-16", print data representation class name = - * "[C" (character array). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = + * {@code "[C"} (character array). */ public static final CHAR_ARRAY TEXT_PLAIN = new CHAR_ARRAY ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = "text/html; - * charset=utf-16", print data representation class name = - * "[C" (character array). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = + * {@code "[C"} (character array). */ public static final CHAR_ARRAY TEXT_HTML = new CHAR_ARRAY ("text/html; charset=utf-16"); @@ -1289,16 +1289,16 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print - * data representation class name of "java.lang.String". + * data representation class name of {@code "java.lang.String"}. * * @param mimeType MIME media type string. If it is a text media * type, it is assumed to contain a - * "charset=utf-16" parameter. + * {@code "charset=utf-16"} parameter. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public STRING (String mimeType) { @@ -1306,17 +1306,17 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain; - * charset=utf-16", print data representation class name = - * "java.lang.String". + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = + * {@code "java.lang.String"}. */ public static final STRING TEXT_PLAIN = new STRING ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = "text/html; - * charset=utf-16", print data representation class name = - * "java.lang.String". + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = + * {@code "java.lang.String"}. */ public static final STRING TEXT_HTML = new STRING ("text/html; charset=utf-16"); @@ -1337,16 +1337,16 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with the given MIME type and a print * data representation class name of\ - * "java.io.Reader" (character stream). + * {@code "java.io.Reader"} (character stream). * * @param mimeType MIME media type string. If it is a text media * type, it is assumed to contain a - * "charset=utf-16" parameter. + * {@code "charset=utf-16"} parameter. * * @exception NullPointerException - * (unchecked exception) Thrown if mimeType is null. + * (unchecked exception) Thrown if {@code mimeType} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if mimeType does not + * (unchecked exception) Thrown if {@code mimeType} does not * obey the syntax for a MIME media type string. */ public READER (String mimeType) { @@ -1354,17 +1354,17 @@ public class DocFlavor implements Serializable, Cloneable { } /** - * Doc flavor with MIME type = "text/plain; - * charset=utf-16", print data representation class name = - * "java.io.Reader" (character stream). + * Doc flavor with MIME type = {@code "text/plain; charset=utf-16"}, + * print data representation class name = + * {@code "java.io.Reader"} (character stream). */ public static final READER TEXT_PLAIN = new READER ("text/plain; charset=utf-16"); /** - * Doc flavor with MIME type = "text/html; - * charset=utf-16", print data representation class name = - * "java.io.Reader" (character stream). + * Doc flavor with MIME type = {@code "text/html; charset=utf-16"}, + * print data representation class name = + * {@code "java.io.Reader"} (character stream). */ public static final READER TEXT_HTML = new READER ("text/html; charset=utf-16"); @@ -1384,14 +1384,14 @@ public class DocFlavor implements Serializable, Cloneable { /** * Constructs a new doc flavor with a MIME type of - * "application/x-java-jvm-local-objectref" indicating + * {@code "application/x-java-jvm-local-objectref"} indicating * service formatted print data and the given print data * representation class name. * * @param className Fully-qualified representation class name. * * @exception NullPointerException - * (unchecked exception) Thrown if className is + * (unchecked exception) Thrown if {@code className} is * null. */ public SERVICE_FORMATTED (String className) { @@ -1401,7 +1401,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Service formatted print data doc flavor with print data * representation class name = - * "java.awt.image.renderable.RenderableImage" + * {@code "java.awt.image.renderable.RenderableImage"} * (renderable image object). */ public static final SERVICE_FORMATTED RENDERABLE_IMAGE = @@ -1409,7 +1409,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Service formatted print data doc flavor with print data - * representation class name = "java.awt.print.Printable" + * representation class name = {@code "java.awt.print.Printable"} * (printable object). */ public static final SERVICE_FORMATTED PRINTABLE = @@ -1417,7 +1417,7 @@ public class DocFlavor implements Serializable, Cloneable { /** * Service formatted print data doc flavor with print data - * representation class name = "java.awt.print.Pageable" + * representation class name = {@code "java.awt.print.Pageable"} * (pageable object). */ public static final SERVICE_FORMATTED PAGEABLE = diff --git a/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java b/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java index 3d504dd6451..3ab15f96664 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java +++ b/jdk/src/java.desktop/share/classes/javax/print/DocPrintJob.java @@ -45,7 +45,7 @@ public interface DocPrintJob { * Determines the {@link PrintService} object to which this print job * object is bound. * - * @return PrintService object. + * @return {@code PrintService} object. * */ public PrintService getPrintService(); @@ -58,7 +58,7 @@ public interface DocPrintJob { * call; that is, the returned attribute set's object's contents will * not be updated if this Print Job's attribute set's contents change * in the future. To detect changes in attribute values, call - * getAttributes() again and compare the new attribute + * {@code getAttributes()} again and compare the new attribute * set to the previous attribute set; alternatively, register a * listener for print job events. * The returned value may be an empty set but should not be null. @@ -96,7 +96,7 @@ public interface DocPrintJob { * If listener is null, no exception is thrown and no action is * performed. * To determine the attribute updates that may be reported by this job, - * a client can call getAttributes() and identify the + * a client can call {@code getAttributes()} and identify the * subset that are interesting and likely to be reported to the * listener. Clients expecting to be updated about changes in a * specific job attribute should verify it is in that set, but @@ -152,7 +152,7 @@ public interface DocPrintJob { * Print service implementors should close any print data streams (ie * Reader or InputStream implementations) that they obtain * from the client doc. Robust clients may still wish to verify this. - * An exception is always generated if a DocFlavor cannot + * An exception is always generated if a {@code DocFlavor} cannot * be printed. * * @param doc The document to be printed. If must be a flavor diff --git a/jdk/src/java.desktop/share/classes/javax/print/MimeType.java b/jdk/src/java.desktop/share/classes/javax/print/MimeType.java index 87891f655b7..c9d1f614af0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/MimeType.java +++ b/jdk/src/java.desktop/share/classes/javax/print/MimeType.java @@ -195,9 +195,9 @@ class MimeType implements Serializable, Cloneable { * @param s MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if s is null. + * (unchecked exception) Thrown if {@code s} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if s does not obey the + * (unchecked exception) Thrown if {@code s} does not obey the * syntax for a MIME media type string. */ public MimeType(String s) { @@ -271,7 +271,7 @@ class MimeType implements Serializable, Cloneable { * * @param obj Object to test. * - * @return True if this MIME type object equals obj, false + * @return True if this MIME type object equals {@code obj}, false * otherwise. */ public boolean equals (Object obj) { @@ -525,7 +525,7 @@ class MimeType implements Serializable, Cloneable { /** * Parses the given string into canonical pieces and stores the pieces in - * {@link #myPieces myPieces}. + * {@link #myPieces myPieces}. *

      * Special rules applied: *

        @@ -536,9 +536,9 @@ class MimeType implements Serializable, Cloneable { * @param s MIME media type string. * * @exception NullPointerException - * (unchecked exception) Thrown if s is null. + * (unchecked exception) Thrown if {@code s} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if s does not obey the + * (unchecked exception) Thrown if {@code s} does not obey the * syntax for a MIME media type string. */ private void parse(String s) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/PrintService.java b/jdk/src/java.desktop/share/classes/javax/print/PrintService.java index a003e730880..356e8498d01 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/PrintService.java +++ b/jdk/src/java.desktop/share/classes/javax/print/PrintService.java @@ -91,7 +91,7 @@ public interface PrintService { /** * Removes the print-service listener from this print service. * This means the listener is no longer interested in - * PrintService events. + * {@code PrintService} events. * @param listener a PrintServiceAttributeListener object * @see #addPrintServiceAttributeListener */ @@ -103,10 +103,10 @@ public interface PrintService { * giving this Print Service's status. The returned attribute set object * is unmodifiable. The returned attribute set object is a "snapshot" of * this Print Service's attribute set at the time of the - * getAttributes() method call: that is, the returned + * {@code getAttributes()} method call: that is, the returned * attribute set's contents will not be updated if this print * service's attribute set's contents change in the future. To detect - * changes in attribute values, call getAttributes() again + * changes in attribute values, call {@code getAttributes()} again * and compare the new attribute set to the previous attribute set; * alternatively, register a listener for print service events. * @@ -126,8 +126,8 @@ public interface PrintService { * attribute is not supported by this service. * @exception NullPointerException if the category is null. * @exception IllegalArgumentException - * (unchecked exception) if category is not a - * Class that implements interface + * (unchecked exception) if {@code category} is not a + * {@code Class} that implements interface *{@link javax.print.attribute.PrintServiceAttribute PrintServiceAttribute}. */ public @@ -135,13 +135,13 @@ public interface PrintService { /** * Determines the print data formats a client can specify when setting - * up a job for this PrintService. A print data format is + * up a job for this {@code PrintService}. A print data format is * designated by a "doc * flavor" (class {@link javax.print.DocFlavor DocFlavor}) * consisting of a MIME type plus a print data representation class. *

        * Note that some doc flavors may not be supported in combination - * with all attributes. Use getUnsupportedAttributes(..) + * with all attributes. Use {@code getUnsupportedAttributes(..)} * to validate specific combinations. * * @return Array of supported doc flavors, should have at least @@ -152,19 +152,19 @@ public interface PrintService { /** * Determines if this print service supports a specific - * DocFlavor. This is a convenience method to determine - * if the DocFlavor would be a member of the result of - * getSupportedDocFlavors(). + * {@code DocFlavor}. This is a convenience method to determine + * if the {@code DocFlavor} would be a member of the result of + * {@code getSupportedDocFlavors()}. *

        * Note that some doc flavors may not be supported in combination - * with all attributes. Use getUnsupportedAttributes(..) + * with all attributes. Use {@code getUnsupportedAttributes(..)} * to validate specific combinations. * - * @param flavor the DocFlavorto query for support. - * @return true if this print service supports the - * specified DocFlavor; false otherwise. + * @param flavor the {@code DocFlavor} to query for support. + * @return {@code true} if this print service supports the + * specified {@code DocFlavor}; {@code false} otherwise. * @exception NullPointerException - * (unchecked exception) Thrown if flavor is null. + * (unchecked exception) Thrown if {@code flavor} is null. */ public boolean isDocFlavorSupported(DocFlavor flavor); @@ -173,7 +173,7 @@ public interface PrintService { * Determines the printing attribute categories a client can specify * when setting up a job for this print service. * A printing attribute category is - * designated by a Class that implements interface + * designated by a {@code Class} that implements interface * {@link javax.print.attribute.Attribute Attribute}. This method returns * just the attribute categories that are supported; it does not * return the particular attribute values that are supported. @@ -181,10 +181,10 @@ public interface PrintService { * This method returns all the printing attribute * categories this print service supports for any possible job. * Some categories may not be supported in a particular context (ie - * for a particular DocFlavor). - * Use one of the methods that include a DocFlavor to + * for a particular {@code DocFlavor}). + * Use one of the methods that include a {@code DocFlavor} to * validate the request before submitting it, such as - * getSupportedAttributeValues(..). + * {@code getSupportedAttributeValues(..)}. * * @return Array of printing attribute categories that the client can * specify as a doc-level or job-level attribute in a Print @@ -198,37 +198,37 @@ public interface PrintService { /** * Determines whether a client can specify the given printing * attribute category when setting up a job for this print service. A - * printing attribute category is designated by a Class + * printing attribute category is designated by a {@code Class} * that implements interface {@link javax.print.attribute.Attribute * Attribute}. This method tells whether the attribute category is * supported; it does not tell whether a particular attribute value * is supported. *

        * Some categories may not be supported in a particular context (ie - * for a particular DocFlavor). - * Use one of the methods which include a DocFlavor to + * for a particular {@code DocFlavor}). + * Use one of the methods which include a {@code DocFlavor} to * validate the request before submitting it, such as - * getSupportedAttributeValues(..). + * {@code getSupportedAttributeValues(..)}. *

        * This is a convenience method to determine if the category * would be a member of the result of - * getSupportedAttributeCategories(). + * {@code getSupportedAttributeCategories()}. * * @param category Printing attribute category to test. It must be a - * Class that implements + * {@code Class} that implements * interface * {@link javax.print.attribute.Attribute Attribute}. * - * @return true if this print service supports + * @return {@code true} if this print service supports * specifying a doc-level or - * job-level attribute in category in a Print - * Request; false if it doesn't. + * job-level attribute in {@code category} in a Print + * Request; {@code false} if it doesn't. * * @exception NullPointerException - * (unchecked exception) Thrown if category is null. + * (unchecked exception) Thrown if {@code category} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if category is not a - * Class that implements interface + * (unchecked exception) Thrown if {@code category} is not a + * {@code Class} that implements interface * {@link javax.print.attribute.Attribute Attribute}. */ public boolean @@ -244,16 +244,16 @@ public interface PrintService { * default attribute value instead. *

        * Some attributes may not be supported in a particular context (ie - * for a particular DocFlavor). - * Use one of the methods that include a DocFlavor to + * for a particular {@code DocFlavor}). + * Use one of the methods that include a {@code DocFlavor} to * validate the request before submitting it, such as - * getSupportedAttributeValues(..). + * {@code getSupportedAttributeValues(..)}. *

        * Not all attributes have a default value. For example the - * service will not have a defaultvalue for RequestingUser + * service will not have a defaultvalue for {@code RequestingUser} * i.e. a null return for a supported category means there is no * service default value for that category. Use the - * isAttributeCategorySupported(Class) method to + * {@code isAttributeCategorySupported(Class)} method to * distinguish these cases. * * @param category Printing attribute category for which the default @@ -262,16 +262,16 @@ public interface PrintService { * {@link javax.print.attribute.Attribute * Attribute}. * - * @return Default attribute value for category, or null + * @return Default attribute value for {@code category}, or null * if this Print Service does not support specifying a doc-level or - * job-level attribute in category in a Print + * job-level attribute in {@code category} in a Print * Request, or the service does not have a default value * for this attribute. * * @exception NullPointerException - * (unchecked exception) Thrown if category is null. + * (unchecked exception) Thrown if {@code category} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if category is not a + * (unchecked exception) Thrown if {@code category} is not a * {@link java.lang.Class Class} that implements interface {@link * javax.print.attribute.Attribute Attribute}. */ @@ -285,10 +285,10 @@ public interface PrintService { * attribute value is an instance of a class that implements interface * {@link javax.print.attribute.Attribute Attribute}. *

        - * If flavor is null and attributes is null + * If {@code flavor} is null and {@code attributes} is null * or is an empty set, this method returns all the printing attribute * values this Print Service supports for any possible job. If - * flavor is not null or attributes is not + * {@code flavor} is not null or {@code attributes} is not * an empty set, this method returns just the printing attribute values * that are compatible with the given doc flavor and/or set of attributes. * That is, a null return value may indicate that specifying this attribute @@ -296,12 +296,12 @@ public interface PrintService { * Also if DocFlavor is not null it must be a flavor supported by this * PrintService, else IllegalArgumentException will be thrown. *

        - * If the attributes parameter contains an Attribute whose - * category is the same as the category parameter, the service + * If the {@code attributes} parameter contains an Attribute whose + * category is the same as the {@code category} parameter, the service * must ignore this attribute in the AttributeSet. *

        - * DocAttributes which are to be specified on the - * Doc must be included in this set to accurately + * {@code DocAttribute}s which are to be specified on the + * {@code Doc} must be included in this set to accurately * represent the context. *

        * This method returns an Object because different printing attribute @@ -321,7 +321,7 @@ public interface PrintService { * containing the legal values -- used, for example, by an attribute with * a list of enumerated values. The type of the array is an array of the * specified attribute category type as returned by its - * getCategory(Class). + * {@code getCategory(Class)}. *

      • * Return a single object (of some class other than the attribute category) * that indicates bounds on the legal values -- used, for example, by an @@ -337,18 +337,18 @@ public interface PrintService { * (both job-level attributes and document-level * attributes), or null. * - * @return Object indicating supported values for category, + * @return Object indicating supported values for {@code category}, * or null if this Print Service does not support specifying a - * doc-level or job-level attribute in category in + * doc-level or job-level attribute in {@code category} in * a Print Request. * * @exception NullPointerException - * (unchecked exception) Thrown if category is null. + * (unchecked exception) Thrown if {@code category} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if category is not a + * (unchecked exception) Thrown if {@code category} is not a * {@link java.lang.Class Class} that implements interface {@link * javax.print.attribute.Attribute Attribute}, or - * DocFlavor is not supported by this service. + * {@code DocFlavor} is not supported by this service. */ public Object getSupportedAttributeValues(Class category, @@ -362,24 +362,24 @@ public interface PrintService { * attribute value is an instance of a class that implements interface * {@link javax.print.attribute.Attribute Attribute}. *

        - * If flavor is null and attributes is null or + * If {@code flavor} is null and {@code attributes} is null or * is an empty set, this method tells whether this Print Service supports * the given printing attribute value for some possible combination of doc - * flavor and set of attributes. If flavor is not null or - * attributes is not an empty set, this method tells whether + * flavor and set of attributes. If {@code flavor} is not null or + * {@code attributes} is not an empty set, this method tells whether * this Print Service supports the given printing attribute value in * combination with the given doc flavor and/or set of attributes. *

        * Also if DocFlavor is not null it must be a flavor supported by this * PrintService, else IllegalArgumentException will be thrown. *

        - * DocAttributes which are to be specified on the - * Doc must be included in this set to accurately + * {@code DocAttribute}s which are to be specified on the + * {@code Doc} must be included in this set to accurately * represent the context. *

        * This is a convenience method to determine if the value * would be a member of the result of - * getSupportedAttributeValues(...). + * {@code getSupportedAttributeValues(...)}. * * @param attrval Printing attribute value to test. * @param flavor Doc flavor for a supposed job, or null. @@ -388,11 +388,11 @@ public interface PrintService { * attributes), or null. * * @return True if this Print Service supports specifying - * attrval as a doc-level or job-level attribute in a + * {@code attrval} as a doc-level or job-level attribute in a * Print Request, false if it doesn't. * * @exception NullPointerException - * (unchecked exception) if attrval is null. + * (unchecked exception) if {@code attrval} is null. * @exception IllegalArgumentException if flavor is not supported by * this PrintService. */ @@ -410,8 +410,8 @@ public interface PrintService { * IllegalArgumentException will be thrown. If the * return value from this method is null, all attributes are supported. *

        - * DocAttributes which are to be specified on the - * Doc must be included in this set to accurately + * {@code DocAttribute}s which are to be specified on the + * {@code Doc} must be included in this set to accurately * represent the context. *

        * If the return value is non-null, all attributes in the returned @@ -428,7 +428,7 @@ public interface PrintService { * to select the attribute(s) to be identified as the cause of the * conflict. *

        - * Use isDocFlavorSupported() to verify that a DocFlavor + * Use {@code isDocFlavorSupported()} to verify that a DocFlavor * is supported before calling this method. * * @param flavor Doc flavor to test, or null @@ -439,7 +439,7 @@ public interface PrintService { * @return null if this Print Service supports the print request * specification, else the unsupported attributes. * - * @exception IllegalArgumentException ifflavor is + * @exception IllegalArgumentException if {@code flavor} is * not supported by this PrintService. */ public AttributeSet getUnsupportedAttributes(DocFlavor flavor, @@ -453,7 +453,7 @@ public interface PrintService { * an environment with no UI support should ensure that the factory * is not initialised unless the application calls this method to * obtain the factory. - * See ServiceUIFactory for more information. + * See {@code ServiceUIFactory} for more information. * @return null or a factory for UI components. */ public ServiceUIFactory getServiceUIFactory(); @@ -480,7 +480,7 @@ public interface PrintService { /** * This method should be implemented consistently with - * equals(Object). + * {@code equals(Object)}. * @return hash code of this object. */ public int hashCode(); diff --git a/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java b/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java index d15a0146287..a6981a1f441 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java +++ b/jdk/src/java.desktop/share/classes/javax/print/PrintServiceLookup.java @@ -113,7 +113,7 @@ public abstract class PrintServiceLookup { * @param attributes attributes that the print service must support. * If null this constraint is not used. * - * @return array of matching PrintService objects + * @return array of matching {@code PrintService} objects * representing print services that support the specified flavor * attributes. If no services match, the array is zero-length. */ @@ -129,9 +129,9 @@ public abstract class PrintServiceLookup { * Locates MultiDoc print Services capable of printing MultiDocs * containing all the specified doc flavors. *

        This method is useful to help locate a service that can print - * a MultiDoc in which the elements may be different + * a {@code MultiDoc} in which the elements may be different * flavors. An application could perform this itself by multiple lookups - * on each DocFlavor in turn and collating the results, + * on each {@code DocFlavor} in turn and collating the results, * but the lookup service may be able to do this more efficiently. * * @param flavors the flavors to print. If null or empty this @@ -201,8 +201,8 @@ public abstract class PrintServiceLookup { * the method returns false. * * @param sp an implementation of a lookup service. - * @return true if the new lookup service is newly - * registered; false otherwise. + * @return {@code true} if the new lookup service is newly + * registered; {@code false} otherwise. */ public static boolean registerServiceProvider(PrintServiceLookup sp) { synchronized (PrintServiceLookup.class) { @@ -232,15 +232,15 @@ public abstract class PrintServiceLookup { * values and classes reported by the service. * This may be less efficient than a lookup * service tuned for that service. - * Therefore registering a PrintServiceLookup instance + * Therefore registering a {@code PrintServiceLookup} instance * instead is recommended. * The method returns true if this service is not previously * registered and is now successfully registered. * This method should not be called with StreamPrintService instances. * They will always fail to register and the method will return false. * @param service an implementation of a print service. - * @return true if the service is newly - * registered; false otherwise. + * @return {@code true} if the service is newly + * registered; {@code false} otherwise. */ public static boolean registerService(PrintService service) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java b/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java index a3960af1816..520d508c3b5 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java +++ b/jdk/src/java.desktop/share/classes/javax/print/ServiceUI.java @@ -136,8 +136,8 @@ public class ServiceUI { * @param x location of dialog including border in screen coordinates * @param y location of dialog including border in screen coordinates * @param services to be browsable, must be non-null. - * @param defaultService - initial PrintService to display. - * @param flavor - the flavor to be printed, or null. + * @param defaultService initial PrintService to display. + * @param flavor the flavor to be printed, or null. * @param attributes on input is the initial application supplied * preferences. This cannot be null but may be empty. * On output the attributes reflect changes made by the user. diff --git a/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java b/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java index f73d794f76b..dfe8dc4a470 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java +++ b/jdk/src/java.desktop/share/classes/javax/print/SimpleDoc.java @@ -35,7 +35,7 @@ import javax.print.attribute.AttributeSetUtilities; import javax.print.attribute.DocAttributeSet; /** - * This class is an implementation of interface Doc that can + * This class is an implementation of interface {@code Doc} that can * be used in many common printing requests. * It can handle all of the presently defined "pre-defined" doc flavors * defined as static variables in the DocFlavor class. @@ -52,7 +52,7 @@ import javax.print.attribute.DocAttributeSet; * or need a MultiDoc will not want to use this class. *

        * If the print data is a stream, or a print job requests data as a - * stream, then SimpleDoc does not monitor if the service + * stream, then {@code SimpleDoc} does not monitor if the service * properly closes the stream after data transfer completion or job * termination. * Clients may prefer to use provide their own implementation of doc that @@ -69,18 +69,18 @@ public final class SimpleDoc implements Doc { private InputStream inStream; /** - * Constructs a SimpleDoc with the specified + * Constructs a {@code SimpleDoc} with the specified * print data, doc flavor and doc attribute set. * @param printData the print data object - * @param flavor the DocFlavor object - * @param attributes a DocAttributeSet, which can - * be null - * @throws IllegalArgumentException if flavor or - * printData is null, or the - * printData does not correspond + * @param flavor the {@code DocFlavor} object + * @param attributes a {@code DocAttributeSet}, which can + * be {@code null} + * @throws IllegalArgumentException if {@code flavor} or + * {@code printData} is {@code null}, or the + * {@code printData} does not correspond * to the specified doc flavor--for example, the data is * not of the type specified as the representation in the - * DocFlavor. + * {@code DocFlavor}. */ public SimpleDoc(Object printData, DocFlavor flavor, DocAttributeSet attributes) { @@ -144,7 +144,7 @@ public final class SimpleDoc implements Doc { * Obtains the print data representation object that contains this doc * object's piece of print data in the format corresponding to the * supported doc flavor. - * The getPrintData() method returns an instance of + * The {@code getPrintData()} method returns an instance of * the representation class whose name is given by * {@link DocFlavor#getRepresentationClassName() getRepresentationClassName}, * and the return value can be cast @@ -161,26 +161,26 @@ public final class SimpleDoc implements Doc { /** * Obtains a reader for extracting character print data from this doc. - * The Doc implementation is required to support this - * method if the DocFlavor has one of the following print - * data representation classes, and return null + * The {@code Doc} implementation is required to support this + * method if the {@code DocFlavor} has one of the following print + * data representation classes, and return {@code null} * otherwise: *

          - *
        • char[] - *
        • java.lang.String - *
        • java.io.Reader + *
        • {@code char[]} + *
        • {@code java.lang.String} + *
        • {@code java.io.Reader} *
        * The doc's print data representation object is used to construct and - * return a Reader for reading the print data as a stream + * return a {@code Reader} for reading the print data as a stream * of characters from the print data representation object. * However, if the print data representation object is itself a - * Reader then the print data representation object is + * {@code Reader} then the print data representation object is * simply returned. * - * @return a Reader for reading the print data + * @return a {@code Reader} for reading the print data * characters from this doc. * If a reader cannot be provided because this doc does not meet - * the criteria stated above, null is returned. + * the criteria stated above, {@code null} is returned. * * @exception IOException if there was an I/O error while creating * the reader. @@ -209,13 +209,13 @@ public final class SimpleDoc implements Doc { /** * Obtains an input stream for extracting byte print data from * this doc. - * The Doc implementation is required to support this - * method if the DocFlavor has one of the following print + * The {@code Doc} implementation is required to support this + * method if the {@code DocFlavor} has one of the following print * data representation classes; otherwise this method - * returns null: + * returns {@code null}: *
          - *
        • byte[] - *
        • java.io.InputStream + *
        • {@code byte[]} + *
        • {@code java.io.InputStream} *
        * The doc's print data representation object is obtained. Then, an * input stream for reading the print data @@ -225,10 +225,10 @@ public final class SimpleDoc implements Doc { * input stream then the print data representation object is simply * returned. * - * @return an InputStream for reading the print data + * @return an {@code InputStream} for reading the print data * bytes from this doc. If an input stream cannot be * provided because this doc does not meet - * the criteria stated above, null is returned. + * the criteria stated above, {@code null} is returned. * * @exception IOException * if there was an I/O error while creating the input stream. diff --git a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java index c1a99229b2e..a735d542a58 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java +++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintService.java @@ -37,17 +37,17 @@ import java.io.OutputStream; * The output format must be declared as a mime type. * This is equivalent to an output document flavor where the * representation class is always "java.io.OutputStream" - * An instance of the StreamPrintService class is + * An instance of the {@code StreamPrintService} class is * obtained from a {@link StreamPrintServiceFactory} instance. *

        - * Note that a StreamPrintService is different from a - * PrintService, which supports a + * Note that a {@code StreamPrintService} is different from a + * {@code PrintService}, which supports a * {@link javax.print.attribute.standard.Destination Destination} - * attribute. A StreamPrintService always requires an output - * stream, whereas a PrintService optionally accepts a - * Destination. A StreamPrintService + * attribute. A {@code StreamPrintService} always requires an output + * stream, whereas a {@code PrintService} optionally accepts a + * {@code Destination}. A {@code StreamPrintService} * has no default destination for its formatted output. - * Additionally a StreamPrintService is expected to generate + * Additionally a {@code StreamPrintService} is expected to generate output in * a format useful in other contexts. * StreamPrintService's are not expected to support the Destination attribute. @@ -88,7 +88,7 @@ public abstract class StreamPrintService implements PrintService { public abstract String getOutputFormat(); /** - * Disposes this StreamPrintService. + * Disposes this {@code StreamPrintService}. * If a stream service cannot be re-used, it must be disposed * to indicate this. Typically the client will call this method. * Services which write data which cannot meaningfully be appended to @@ -100,12 +100,12 @@ public abstract class StreamPrintService implements PrintService { } /** - * Returns a boolean indicating whether or not - * this StreamPrintService has been disposed. + * Returns a {@code boolean} indicating whether or not + * this {@code StreamPrintService} has been disposed. * If this object has been disposed, will return true. * Used by services and client applications to recognize streams * to which no further data should be written. - * @return if this StreamPrintService has been disposed + * @return if this {@code StreamPrintService} has been disposed */ public boolean isDisposed() { return disposed; diff --git a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java index f1f7f28c410..a7da64e61f3 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java +++ b/jdk/src/java.desktop/share/classes/javax/print/StreamPrintServiceFactory.java @@ -37,7 +37,7 @@ import java.util.ServiceLoader; import java.util.ServiceConfigurationError; /** - * A StreamPrintServiceFactory is the factory for + * A {@code StreamPrintServiceFactory} is the factory for * {@link StreamPrintService} instances, * which can print to an output stream in a particular * document format described as a mime type. @@ -51,8 +51,8 @@ import java.util.ServiceConfigurationError; * Applications locate instances of this class by calling the * {@link #lookupStreamPrintServiceFactories(DocFlavor, String)} method. *

        - * Applications can use a StreamPrintService obtained from a - * factory in place of a PrintService which represents a + * Applications can use a {@code StreamPrintService} obtained from a + * factory in place of a {@code PrintService} which represents a * physical printer device. */ @@ -101,7 +101,7 @@ public abstract class StreamPrintServiceFactory { * @param outputMimeType representing the required output format, used to * identify suitable stream printer factories. A value of null means * match all formats. - * @return - matching factories for stream print service instance, + * @return matching factories for stream print service instance, * empty if no suitable factories could be located. */ public static StreamPrintServiceFactory[] @@ -127,25 +127,25 @@ public abstract class StreamPrintServiceFactory { public abstract DocFlavor[] getSupportedDocFlavors(); /** - * Returns a StreamPrintService that can print to + * Returns a {@code StreamPrintService} that can print to * the specified output stream. * The output stream is created and managed by the application. * It is the application's responsibility to close the stream and * to ensure that this Printer is not reused. * The application should not close this stream until any print job * created from the printer is complete. Doing so earlier may generate - * a PrinterException and an event indicating that the + * a {@code PrinterException} and an event indicating that the * job failed. *

        - * Whereas a PrintService connected to a physical printer + * Whereas a {@code PrintService} connected to a physical printer * can be reused, - * a StreamPrintService connected to a stream cannot. - * The underlying StreamPrintService may be disposed by + * a {@code StreamPrintService} connected to a stream cannot. + * The underlying {@code StreamPrintService} may be disposed by * the print system with * the {@link StreamPrintService#dispose() dispose} method * before returning from the * {@link DocPrintJob#print(Doc, javax.print.attribute.PrintRequestAttributeSet) print} - * method of DocPrintJob so that the print system knows + * method of {@code DocPrintJob} so that the print system knows * this printer is no longer usable. * This is equivalent to a physical printer going offline - permanently. * Applications may supply a null print stream to create a queryable diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java index a6c58e6f933..e493b4869de 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Attribute.java @@ -52,8 +52,8 @@ public interface Attribute extends Serializable { *

        * Note: This method is intended to provide a default, nonlocalized * string for the attribute's category. If two attribute objects return the - * same category from the getCategory() method, they should - * return the same name from the getName() method. + * same category from the {@code getCategory()} method, they should + * return the same name from the {@code getName()} method. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java index 2c5896f633f..587a4833501 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/AttributeSetUtilities.java @@ -206,10 +206,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. Null is never a + * Thrown if {@code attributeSet} is null. Null is never a */ public static AttributeSet unmodifiableView(AttributeSet attributeSet) { if (attributeSet == null) { @@ -224,10 +224,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying doc attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static DocAttributeSet unmodifiableView (DocAttributeSet attributeSet) { @@ -242,10 +242,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print request attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet) { @@ -260,10 +260,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print job attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet) { @@ -278,10 +278,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print service attribute set. * - * @return Unmodifiable view of attributeSet. + * @return Unmodifiable view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet) { @@ -417,10 +417,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static AttributeSet synchronizedView (AttributeSet attributeSet) { @@ -435,10 +435,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying doc attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet) { @@ -453,10 +453,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print request attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet) { @@ -471,10 +471,10 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print job attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. * * @exception NullPointerException - * Thrown if attributeSet is null. + * Thrown if {@code attributeSet} is null. */ public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet) { @@ -489,7 +489,7 @@ public final class AttributeSetUtilities { * * @param attributeSet Underlying print service attribute set. * - * @return Synchronized view of attributeSet. + * @return Synchronized view of {@code attributeSet}. */ public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet) { @@ -508,17 +508,17 @@ public final class AttributeSetUtilities { * @param object Object to test. * @param interfaceName Interface the object must implement. * - * @return If object is a {@link java.lang.Class Class} - * that implements interfaceName, - * object is returned downcast to type {@link + * @return If {@code object} is a {@link java.lang.Class Class} + * that implements {@code interfaceName}, + * {@code object} is returned downcast to type {@link * java.lang.Class Class}; otherwise an exception is thrown. * * @exception NullPointerException - * (unchecked exception) Thrown if object is null. + * (unchecked exception) Thrown if {@code object} is null. * @exception ClassCastException - * (unchecked exception) Thrown if object is not a + * (unchecked exception) Thrown if {@code object} is not a * {@link java.lang.Class Class} that implements - * interfaceName. + * {@code interfaceName}. */ public static Class verifyAttributeCategory(Object object, Class interfaceName) { @@ -540,16 +540,16 @@ public final class AttributeSetUtilities { * @param object Object to test. * @param interfaceName Interface of which the object must be an instance. * - * @return If object is an instance of - * interfaceName, object is returned + * @return If {@code object} is an instance of + * {@code interfaceName}, {@code object} is returned * downcast to type {@link Attribute Attribute}; otherwise an * exception is thrown. * * @exception NullPointerException - * (unchecked exception) Thrown if object is null. + * (unchecked exception) Thrown if {@code object} is null. * @exception ClassCastException - * (unchecked exception) Thrown if object is not an - * instance of interfaceName. + * (unchecked exception) Thrown if {@code object} is not an + * instance of {@code interfaceName}. */ public static Attribute verifyAttributeValue(Object object, Class interfaceName) { @@ -573,11 +573,11 @@ public final class AttributeSetUtilities { * @param attribute Attribute value to test. * * @exception NullPointerException - * (unchecked exception) Thrown if the category is - * null or if the attribute is null. + * (unchecked exception) Thrown if the {@code category} is + * null or if the {@code attribute} is null. * @exception IllegalArgumentException - * (unchecked exception) Thrown if the category is not - * equal to the category of the attribute. + * (unchecked exception) Thrown if the {@code category} is not + * equal to the category of the {@code attribute}. */ public static void verifyCategoryForValue(Class category, Attribute attribute) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java index 72e583a0347..0515be6e801 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DateTimeSyntax.java @@ -34,26 +34,25 @@ import java.util.Date; * Class DateTimeSyntax is an abstract base class providing the common * implementation of all attributes whose value is a date and time. *

        - * Under the hood, a date-time attribute is stored as a value of class - * java.util.Date. You can get a date-time attribute's Date value by + * Under the hood, a date-time attribute is stored as a value of class + * {@code java.util.Date}. You can get a date-time attribute's Date value by * calling {@link #getValue() getValue()}. A date-time attribute's * Date value is established when it is constructed (see {@link * #DateTimeSyntax(Date) DateTimeSyntax(Date)}). Once * constructed, a date-time attribute's value is immutable. *

        * To construct a date-time attribute from separate values of the year, month, - * day, hour, minute, and so on, use a java.util.Calendar - * object to construct a java.util.Date object, then use the - * java.util.Date object to construct the date-time attribute. + * day, hour, minute, and so on, use a {@code java.util.Calendar} + * object to construct a {@code java.util.Date} object, then use the + * {@code java.util.Date} object to construct the date-time attribute. * To convert * a date-time attribute to separate values of the year, month, day, hour, - * minute, and so on, create a java.util.Calendar object and - * set it to the java.util.Date from the date-time attribute. Class - * DateTimeSyntax stores its value in the form of a java.util.Date - * - * rather than a java.util.Calendar because it typically takes - * less memory to store and less time to compare a java.util.Date - * than a java.util.Calendar. + * minute, and so on, create a {@code java.util.Calendar} object and + * set it to the {@code java.util.Date} from the date-time attribute. Class + * DateTimeSyntax stores its value in the form of a {@code java.util.Date} + * rather than a {@code java.util.Calendar} because it typically takes + * less memory to store and less time to compare a {@code java.util.Date} + * than a {@code java.util.Calendar}. * * @author Alan Kaminsky */ @@ -64,7 +63,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { // Hidden data members. /** - * This date-time attribute'sjava.util.Date value. + * This date-time attribute's {@code java.util.Date} value. * @serial */ private Date value; @@ -73,12 +72,12 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { /** * Construct a new date-time attribute with the given - * java.util.Date value. + * {@code java.util.Date} value. * - * @param value java.util.Date value. + * @param value {@code java.util.Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if theValue is null. + * (unchecked exception) Thrown if {@code theValue} is null. */ protected DateTimeSyntax(Date value) { if (value == null) { @@ -90,7 +89,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { // Exported operations. /** - * Returns this date-time attribute's java.util.Date + * Returns this date-time attribute's {@code java.util.Date} * value. * @return the Date. */ @@ -105,17 +104,17 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class DateTimeSyntax. + * {@code object} is an instance of class DateTimeSyntax. *
        3. - * This date-time attribute's java.util.Date value and - * object's java.util.Date value are + * This date-time attribute's {@code java.util.Date} value and + * {@code object}'s {@code java.util.Date} value are * equal.
        * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * attribute, false otherwise. */ public boolean equals(Object object) { @@ -126,7 +125,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { /** * Returns a hash code value for this date-time attribute. The hashcode is - * that of this attribute's java.util.Date value. + * that of this attribute's {@code java.util.Date} value. */ public int hashCode() { return value.hashCode(); @@ -135,7 +134,7 @@ public abstract class DateTimeSyntax implements Serializable, Cloneable { /** * Returns a string value corresponding to this date-time attribute. * The string value is just this attribute's - * java.util.Date value + * {@code java.util.Date} value * converted to a string. */ public String toString() { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java index 994208f0a9e..509eee309d4 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/DocAttribute.java @@ -30,7 +30,7 @@ package javax.print.attribute; * Interface DocAttribute is a tagging interface which a printing attribute * class implements to indicate the attribute denotes a setting for a doc. * ("Doc" is a short, easy-to-pronounce term that means "a piece of print - * data.") The client may include a DocAttribute in a Doc's + * data.") The client may include a DocAttribute in a {@code Doc}'s * attribute set to specify a characteristic of * that doc. If an attribute implements {@link PrintRequestAttribute * PrintRequestAttribute} as well as DocAttribute, the client may include the diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java index f774066e592..2b3470c5da4 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/EnumSyntax.java @@ -68,7 +68,7 @@ import java.io.Serializable; * } * } * - * You can then write code that uses the == and != + * You can then write code that uses the {@code ==} and {@code !=} * operators to test enumeration values; for example: *
          *     Bach theComposer;
        @@ -77,8 +77,8 @@ import java.io.Serializable;
          *         System.out.println ("The greatest composer of all time!");
          *     }
          * 
        - * The equals() method for an enumeration class just does a test - * for identical objects (==). + * The {@code equals()} method for an enumeration class just does a test + * for identical objects ({@code ==}). *

        * You can convert an enumeration value to a string by calling {@link * #toString() toString()}. The string is obtained from a table @@ -97,8 +97,8 @@ import java.io.Serializable; * You can define a subclass of an enumeration class that extends it with * additional enumeration values. The subclass's enumeration values' integer * values need not be distinct from the superclass's enumeration values' integer - * values; the ==, !=, equals(), and - * toString() methods will still work properly even if the subclass + * values; the {@code ==}, {@code !=}, {@code equals()}, and + * {@code toString()} methods will still work properly even if the subclass * uses some of the same integer values as the superclass. However, the * application in which the enumeration class and subclass are used may need to * have distinct integer values in the superclass and subclass. @@ -182,7 +182,7 @@ public abstract class EnumSyntax implements Serializable, Cloneable { * enumeration value table is null. (Note: {@link * java.io.InvalidObjectException InvalidObjectException} is a subclass * of {@link java.io.ObjectStreamException ObjectStreamException}, which - * readResolve() is declared to throw.) + * {@code readResolve()} is declared to throw.) */ protected Object readResolve() throws ObjectStreamException { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java index 0b915ba2ca9..5742a074420 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashDocAttributeSet.java @@ -55,7 +55,7 @@ public class HashDocAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashDocAttributeSet(DocAttribute attribute) { super (attribute, DocAttribute.class); @@ -65,7 +65,7 @@ public class HashDocAttributeSet extends HashAttributeSet * Construct a new hash doc attribute set, * initially populated with the values from the given array. * The new attribute set is populated by - * adding the elements of attributes array to the set in + * adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -75,7 +75,7 @@ public class HashDocAttributeSet extends HashAttributeSet * * @exception NullPointerException * (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashDocAttributeSet(DocAttribute[] attributes) { super (attributes, DocAttribute.class); @@ -84,15 +84,15 @@ public class HashDocAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the DocAttribute interface. + * are restricted to the {@code DocAttribute} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * DocAttribute. + * {@code attributes} is not an instance of + * {@code DocAttribute}. */ public HashDocAttributeSet(DocAttributeSet attributes) { super(attributes, DocAttribute.class); diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java index f39c85883d5..e9971e9a45c 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintJobAttributeSet.java @@ -55,7 +55,7 @@ public class HashPrintJobAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashPrintJobAttributeSet(PrintJobAttribute attribute) { super(attribute, PrintJobAttribute.class); @@ -65,7 +65,7 @@ public class HashPrintJobAttributeSet extends HashAttributeSet * Construct a new hash print job attribute set, * initially populated with the values from the given array. * The new attribute set is populated - * by adding the elements of attributes array to the set in + * by adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -74,7 +74,7 @@ public class HashPrintJobAttributeSet extends HashAttributeSet * If null, an empty attribute set is constructed. * * @exception NullPointerException (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashPrintJobAttributeSet(PrintJobAttribute[] attributes) { super (attributes, PrintJobAttribute.class); @@ -83,15 +83,15 @@ public class HashPrintJobAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the PrintJobAttribute interface. + * are restricted to the {@code PrintJobAttribute} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * PrintJobAttribute. + * {@code attributes} is not an instance of + * {@code PrintJobAttribute}. */ public HashPrintJobAttributeSet(PrintJobAttributeSet attributes) { super(attributes, PrintJobAttribute.class); diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java index fde4ebb6945..9ef717500e7 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintRequestAttributeSet.java @@ -55,7 +55,7 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashPrintRequestAttributeSet(PrintRequestAttribute attribute) { super (attribute, PrintRequestAttribute.class); @@ -64,7 +64,7 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet /** * Construct a new print request attribute set, initially populated with * the values from the given array. The new attribute set is populated - * by adding the elements of attributes array to the set in + * by adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -74,7 +74,7 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet * * @exception NullPointerException * (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes) { super (attributes, PrintRequestAttribute.class); @@ -84,15 +84,15 @@ public class HashPrintRequestAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the (PrintRequestAttributeSe interface. + * are restricted to the {@code (PrintRequestAttributeSe} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * (PrintRequestAttributeSe. + * {@code attributes} is not an instance of + * {@code (PrintRequestAttributeSe}. */ public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java index d98430d0d75..31bd2ec738c 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/HashPrintServiceAttributeSet.java @@ -55,7 +55,7 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet * @param attribute Attribute value to add to the set. * * @exception NullPointerException - * (unchecked exception) Thrown if attribute is null. + * (unchecked exception) Thrown if {@code attribute} is null. */ public HashPrintServiceAttributeSet(PrintServiceAttribute attribute) { super (attribute, PrintServiceAttribute.class); @@ -64,7 +64,7 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet /** * Construct a new print service attribute set, initially populated with * the values from the given array. The new attribute set is populated - * by adding the elements of attributes array to the set in + * by adding the elements of {@code attributes} array to the set in * sequence, starting at index 0. Thus, later array elements may replace * earlier array elements if the array contains duplicate attribute * values or attribute categories. @@ -74,7 +74,7 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet * * @exception NullPointerException * (unchecked exception) - * Thrown if any element of attributes is null. + * Thrown if any element of {@code attributes} is null. */ public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes) { super (attributes, PrintServiceAttribute.class); @@ -84,15 +84,15 @@ public class HashPrintServiceAttributeSet extends HashAttributeSet /** * Construct a new attribute set, initially populated with the * values from the given set where the members of the attribute set - * are restricted to the PrintServiceAttribute interface. + * are restricted to the {@code PrintServiceAttribute} interface. * * @param attributes set of attribute values to initialise the set. If * null, an empty attribute set is constructed. * * @exception ClassCastException * (unchecked exception) Thrown if any element of - * attributes is not an instance of - * PrintServiceAttribute. + * {@code attributes} is not an instance of + * {@code PrintServiceAttribute}. */ public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java index 1fbd3b2556d..a68cb0eac97 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/IntegerSyntax.java @@ -69,9 +69,9 @@ public abstract class IntegerSyntax implements Serializable, Cloneable { * @param upperBound Upper bound. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than - * lowerBound or greater than - * upperBound. + * (Unchecked exception) Thrown if {@code value} is less than + * {@code lowerBound} or greater than + * {@code upperBound}. */ protected IntegerSyntax(int value, int lowerBound, int upperBound) { if (lowerBound > value || value > upperBound) { @@ -95,17 +95,17 @@ public abstract class IntegerSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class IntegerSyntax. + * {@code object} is an instance of class IntegerSyntax. *
        3. - * This integer attribute's value and object's value are + * This integer attribute's value and {@code object}'s value are * equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this integer + * @return True if {@code object} is equivalent to this integer * attribute, false otherwise. */ public boolean equals(Object object) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java index 48249480e60..6acf9ca51ef 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/PrintRequestAttribute.java @@ -37,7 +37,7 @@ package javax.print.attribute; *

        * If an attribute implements {@link DocAttribute DocAttribute} * as well as PrintRequestAttribute, the client may include the - * attribute in a Doc}'s attribute set to specify + * attribute in a {@code Doc}'s attribute set to specify * a job setting which pertains just to that doc. * * @see DocAttributeSet diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java index 7e9c40835b5..c6674707ec0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/ResolutionSyntax.java @@ -150,13 +150,13 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * @param dphi * Value (dphi) to convert. * @param units - * Unit conversion factor, e.g. {@link #DPI DPI} or - * {@link #DPCM DPCM}. + * Unit conversion factor, e.g. {@link #DPI DPI} or + * {@link #DPCM DPCM}. * - * @return The value of dphi converted to the desired units. + * @return The value of {@code dphi} converted to the desired units. * * @exception IllegalArgumentException - * (unchecked exception) Thrown if units < 1. + * (unchecked exception) Thrown if {@code units} < 1. */ private static int convertFromDphi(int dphi, int units) { if (units < 1) { @@ -222,7 +222,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { /** * Returns a string version of this resolution attribute in the given units. - * The string takes the form "CxF U", + * The string takes the form "CxF U", * where C is the cross feed direction resolution, F is the * feed direction resolution, and U is the units name. The values are * rounded to the nearest integer. @@ -231,7 +231,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * Unit conversion factor, e.g. {@link #DPI CODE>DPI} or {@link * #DPCM DPCM}. * @param unitsName - * Units name string, e.g. "dpi" or "dpcm". If + * Units name string, e.g. {@code "dpi"} or {@code "dpcm"}. If * null, no units name is appended to the result. * * @return String version of this resolution attribute. @@ -259,19 +259,19 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { *

          *
        • * This attribute's cross feed direction resolution is less than or equal to - * the other attribute's cross feed direction resolution. + * the {@code other} attribute's cross feed direction resolution. *
        • * This attribute's feed direction resolution is less than or equal to the - * other attribute's feed direction resolution. + * {@code other} attribute's feed direction resolution. *
        * * @param other Resolution attribute to compare with. * * @return True if this resolution attribute is less than or equal to the - * other resolution attribute, false otherwise. + * {@code other} resolution attribute, false otherwise. * * @exception NullPointerException - * (unchecked exception) Thrown if other is null. + * (unchecked exception) Thrown if {@code other} is null. */ public boolean lessThanOrEquals(ResolutionSyntax other) { return (this.crossFeedResolution <= other.crossFeedResolution && @@ -284,20 +284,20 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class ResolutionSyntax. + * {@code object} is an instance of class ResolutionSyntax. *
        3. * This attribute's cross feed direction resolution is equal to - * object's cross feed direction resolution. + * {@code object}'s cross feed direction resolution. *
        4. * This attribute's feed direction resolution is equal to - * object's feed direction resolution. + * {@code object}'s feed direction resolution. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this resolution + * @return True if {@code object} is equivalent to this resolution * attribute, false otherwise. */ public boolean equals(Object object) { @@ -320,7 +320,7 @@ public abstract class ResolutionSyntax implements Serializable, Cloneable { /** * Returns a string version of this resolution attribute. The string takes - * the form "CxF dphi", where C is the + * the form "CxF dphi", where C is the * cross feed direction resolution and F is the feed direction * resolution. The values are reported in the internal units of dphi. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java index 8ba9303135a..ca1c81a6f31 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/SetOfIntegerSyntax.java @@ -38,19 +38,18 @@ import java.util.Vector; * You can construct an instance of SetOfIntegerSyntax by giving it in "string * form." The string consists of zero or more comma-separated integer groups. * Each integer group consists of either one integer, two integers separated by - * a hyphen (-), or two integers separated by a colon - * (:). Each integer consists of one or more decimal digits - * (0 through 9). Whitespace characters cannot + * a hyphen ({@code -}), or two integers separated by a colon + * ({@code :}). Each integer consists of one or more decimal digits + * ({@code 0} through {@code 9}). Whitespace characters cannot * appear within an integer but are otherwise ignored. For example: - * "", "1", "5-10", "1:2, - * 4". + * {@code ""}, {@code "1"}, {@code "5-10"}, {@code "1:2, 4"}. *

        * You can also construct an instance of SetOfIntegerSyntax by giving it in * "array form." Array form consists of an array of zero or more integer groups * where each integer group is a length-1 or length-2 array of - * ints; for example, int[0][], - * int[][]{{1}}, int[][]{{5,10}}, - * int[][]{{1,2},{4}}. + * {@code int}s; for example, {@code int[0][]}, + * {@code int[][]{{1}}}, {@code int[][]{{5,10}}}, + * {@code int[][]{{1,2},{4}}}. *

        * In both string form and array form, each successive integer group gives a * range of integers to be included in the set. The first integer in each group @@ -68,7 +67,7 @@ import java.util.Vector; * array form." This is the same as array form, except there are no null ranges; * the members of the set are represented in as few ranges as possible (i.e., * overlapping ranges are coalesced); the ranges appear in ascending order; and - * each range is always represented as a length-two array of ints + * each range is always represented as a length-two array of {@code int}s * in the form {lower bound, upper bound}. An empty set is represented as a * zero-length array. *

        @@ -98,7 +97,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * constructed. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if members does not + * (Unchecked exception) Thrown if {@code members} does not * obey the proper syntax. */ protected SetOfIntegerSyntax(String members) { @@ -305,11 +304,11 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * * @exception NullPointerException * (Unchecked exception) Thrown if any element of - * members is null. + * {@code members} is null. * @exception IllegalArgumentException * (Unchecked exception) Thrown if any element of - * members is not a length-one or length-two array or if - * any non-null range in members has a lower bound less + * {@code members} is not a length-one or length-two array or if + * any non-null range in {@code members} has a lower bound less * than zero. */ protected SetOfIntegerSyntax(int[][] members) { @@ -357,7 +356,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than + * (Unchecked exception) Thrown if {@code member} is less than * zero. */ protected SetOfIntegerSyntax(int member) { @@ -377,7 +376,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * * @exception IllegalArgumentException * (Unchecked exception) Thrown if the range is non-null and - * lowerBound is less than zero. + * {@code lowerBound} is less than zero. */ protected SetOfIntegerSyntax(int lowerBound, int upperBound) { if (lowerBound <= upperBound && lowerBound < 0) { @@ -411,7 +410,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * @param x Integer value. * * @return True if this set-of-integer attribute contains the value - * x, false otherwise. + * {@code x}, false otherwise. */ public boolean contains(int x) { // Do a linear search to find the range that contains x, if any. @@ -433,7 +432,7 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * @param attribute Integer attribute. * * @return True if this set-of-integer attribute contains - * theAttribute's value, false otherwise. + * {@code theAttribute}'s value, false otherwise. */ public boolean contains(IntegerSyntax attribute) { return contains (attribute.getValue()); @@ -442,10 +441,10 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { /** * Determine the smallest integer in this set-of-integer attribute that is * greater than the given value. If there are no integers in this - * set-of-integer attribute greater than the given value, -1 is + * set-of-integer attribute greater than the given value, {@code -1} is * returned. (Since a set-of-integer attribute can only contain nonnegative - * values, -1 will never appear in the set.) You can use the - * next() method to iterate through the integer values in a + * values, {@code -1} will never appear in the set.) You can use the + * {@code next()} method to iterate through the integer values in a * set-of-integer attribute in ascending order, like this: *

              *     SetOfIntegerSyntax attribute = . . .;
        @@ -459,8 +458,8 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable {
              * @param  x  Integer value.
              *
              * @return  The smallest integer in this set-of-integer attribute that is
        -     *          greater than x, or -1 if no integer in
        -     *          this set-of-integer attribute is greater than x.
        +     *          greater than {@code x}, or {@code -1} if no integer in
        +     *          this set-of-integer attribute is greater than {@code x}.
              */
             public int next(int x) {
                 // Do a linear search to find the range that contains x, if any.
        @@ -481,17 +480,17 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable {
              * true:
              * 
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class SetOfIntegerSyntax. + * {@code object} is an instance of class SetOfIntegerSyntax. *
        3. - * This set-of-integer attribute's members and object's + * This set-of-integer attribute's members and {@code object}'s * members are the same. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this + * @return True if {@code object} is equivalent to this * set-of-integer attribute, false otherwise. */ public boolean equals(Object object) { @@ -534,9 +533,9 @@ public abstract class SetOfIntegerSyntax implements Serializable, Cloneable { * Returns a string value corresponding to this set-of-integer attribute. * The string value is a zero-length string if this set is empty. Otherwise, * the string value is a comma-separated list of the ranges in the canonical - * array form, where each range is represented as "i" if + * array form, where each range is represented as "i" if * the lower bound equals the upper bound or - * "i-j" otherwise. + * "i-j" otherwise. */ public String toString() { StringBuilder result = new StringBuilder(); diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java index 76832508c94..e57c0812d58 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java @@ -172,13 +172,13 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { * @param x * Value (micrometers) to convert. * @param units - * Unit conversion factor, e.g. {@link #INCH INCH} or - * {@link #MM MM}. + * Unit conversion factor, e.g. {@link #INCH INCH} or + * {@link #MM MM}. * - * @return The value of x converted to the desired units. + * @return The value of {@code x} converted to the desired units. * * @exception IllegalArgumentException - * (unchecked exception) Thrown if units < 1. + * (unchecked exception) Thrown if {@code units} < 1. */ private static float convertFromMicrometers(int x, int units) { if (units < 1) { @@ -238,8 +238,8 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { /** * Returns a string version of this two-dimensional size attribute in the - * given units. The string takes the form "XxY - * U", where X is the X dimension, Y is the Y + * given units. The string takes the form "XxY + * U", where X is the X dimension, Y is the Y * dimension, and U is the units name. The values are displayed in * floating point. * @@ -273,20 +273,20 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { * be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class Size2DSyntax. + * {@code object} is an instance of class Size2DSyntax. *
        3. - * This attribute's X dimension is equal to object's X + * This attribute's X dimension is equal to {@code object}'s X * dimension. *
        4. - * This attribute's Y dimension is equal to object's Y + * This attribute's Y dimension is equal to {@code object}'s Y * dimension. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this + * @return True if {@code object} is equivalent to this * two-dimensional size attribute, false otherwise. */ public boolean equals(Object object) { @@ -306,7 +306,7 @@ public abstract class Size2DSyntax implements Serializable, Cloneable { /** * Returns a string version of this two-dimensional size attribute. The - * string takes the form "XxY um", where + * string takes the form "XxY um", where * X is the X dimension and Y is the Y dimension. * The values are reported in the internal units of micrometers. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java index 7b91de24d0f..fb7a5654364 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/TextSyntax.java @@ -61,10 +61,10 @@ public abstract class TextSyntax implements Serializable, Cloneable { * @param value Text string. * @param locale Natural language of the text string. null * is interpreted to mean the default locale for as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if value is null. + * (unchecked exception) Thrown if {@code value} is null. */ protected TextSyntax(String value, Locale locale) { this.value = verify (value); @@ -115,20 +115,20 @@ public abstract class TextSyntax implements Serializable, Cloneable { * object. To be equivalent, all of the following conditions must be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class TextSyntax. + * {@code object} is an instance of class TextSyntax. *
        3. - * This text attribute's underlying string and object's + * This text attribute's underlying string and {@code object}'s * underlying string are equal. *
        4. - * This text attribute's locale and object's locale are + * This text attribute's locale and {@code object}'s locale are * equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this text + * @return True if {@code object} is equivalent to this text * attribute, false otherwise. */ public boolean equals(Object object) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java index 770ba8a9592..baee148a778 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/URISyntax.java @@ -52,7 +52,7 @@ public abstract class URISyntax implements Serializable, Cloneable { * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ protected URISyntax(URI uri) { this.uri = verify (uri); @@ -88,17 +88,17 @@ public abstract class URISyntax implements Serializable, Cloneable { * To be equivalent, all of the following conditions must be true: *
          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class URISyntax. + * {@code object} is an instance of class URISyntax. *
        3. - * This URI attribute's underlying URI and object's + * This URI attribute's underlying URI and {@code object}'s * underlying URI are equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this URI + * @return True if {@code object} is equivalent to this URI * attribute, false otherwise. */ public boolean equals(Object object) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java index 0cce5fde315..a9ac9a10c0b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Chromaticity.java @@ -145,7 +145,7 @@ public final class Chromaticity extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

        - * For class Chromaticity, the category name is "chromaticity". + * For class Chromaticity, the category name is {@code "chromaticity"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java index 53def76bff1..ab5bee83451 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ColorSupported.java @@ -49,8 +49,8 @@ import javax.print.attribute.PrintServiceAttribute; *

        * IPP Compatibility: The IPP boolean value is "true" for SUPPORTED and * "false" for NOT_SUPPORTED. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -118,7 +118,7 @@ public final class ColorSupported extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

        - * For class ColorSupported, the category name is "color-supported". + * For class ColorSupported, the category name is {@code "color-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java index 80b391ed3bd..c0ba6680aba 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Compression.java @@ -37,8 +37,8 @@ import javax.print.attribute.DocAttribute; * NONE}). *

        * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -122,7 +122,7 @@ public class Compression extends EnumSyntax implements DocAttribute { * instance. *

        * For class Compression and any vendor-defined subclasses, the category - * name is "compression". + * name is {@code "compression"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java index 55b8db8489b..67cd5258885 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Copies.java @@ -62,7 +62,7 @@ import javax.print.attribute.PrintJobAttribute; *

      *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author David Mendenhall @@ -79,7 +79,7 @@ public final class Copies extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1. + * (Unchecked exception) Thrown if {@code value} is less than 1. */ public Copies(int value) { super (value, 1, Integer.MAX_VALUE); @@ -90,17 +90,17 @@ public final class Copies extends IntegerSyntax * object. To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class Copies. + * {@code object} is an instance of class Copies. *
      3. - * This copies attribute's value and object's value are + * This copies attribute's value and {@code object}'s value are * equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this copies + * @return True if {@code object} is equivalent to this copies * attribute, false otherwise. */ public boolean equals(Object object) { @@ -124,7 +124,7 @@ public final class Copies extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class Copies, the category name is "copies". + * For class Copies, the category name is {@code "copies"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java index 4d24577ca7d..96efbb60bac 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/CopiesSupported.java @@ -39,7 +39,7 @@ import javax.print.attribute.SupportedValuesAttribute; * in an IPP "copies-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -55,7 +55,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than 1. + * (Unchecked exception) Thrown if {@code member} is less than 1. */ public CopiesSupported(int member) { super (member); @@ -74,7 +74,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 1. */ public CopiesSupported(int lowerBound, int upperBound) { @@ -93,17 +93,17 @@ public final class CopiesSupported extends SetOfIntegerSyntax * be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class CopiesSupported. + * {@code object} is an instance of class CopiesSupported. *
      3. - * This copies supported attribute's members and object's + * This copies supported attribute's members and {@code object}'s * members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this copies + * @return True if {@code object} is equivalent to this copies * supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -129,7 +129,7 @@ public final class CopiesSupported extends SetOfIntegerSyntax * instance. *

      * For class CopiesSupported, the category - * name is "copies-supported". + * name is {@code "copies-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java index c51b2fd32ab..9005e940db1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCompleted.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The information needed to construct an IPP * "date-time-at-completed" attribute can be obtained as described above. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -62,7 +62,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public DateTimeAtCompleted(Date dateTime) { super (dateTime); @@ -74,17 +74,17 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DateTimeAtCompleted. + * {@code object} is an instance of class DateTimeAtCompleted. *
      3. * This date-time at completed attribute's {@link java.util.Date Date} value - * and object's {@link java.util.Date Date} value are equal. + * and {@code object}'s {@link java.util.Date Date} value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * at completed attribute, false otherwise. */ public boolean equals(Object object) { @@ -113,7 +113,7 @@ public final class DateTimeAtCompleted extends DateTimeSyntax * instance. *

      * For class DateTimeAtCompleted, the category name is - * "date-time-at-completed". + * {@code "date-time-at-completed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java index f4c98aaba7d..497398cc3d2 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtCreation.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The information needed to construct an IPP * "date-time-at-creation" attribute can be obtained as described above. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -62,7 +62,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public DateTimeAtCreation(Date dateTime) { super (dateTime); @@ -74,17 +74,17 @@ public final class DateTimeAtCreation extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DateTimeAtCreation. + * {@code object} is an instance of class DateTimeAtCreation. *
      3. * This date-time at creation attribute's {@link java.util.Date Date} value - * and object's {@link java.util.Date Date} value are equal. + * and {@code object}'s {@link java.util.Date Date} value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * at creation attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public final class DateTimeAtCreation extends DateTimeSyntax * instance. *

      * For class DateTimeAtCreation, the category name is - * "date-time-at-creation". + * {@code "date-time-at-creation"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java index 821a8453a1a..98ad0d2216d 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DateTimeAtProcessing.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The information needed to construct an IPP * "date-time-at-processing" attribute can be obtained as described above. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -62,7 +62,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public DateTimeAtProcessing(Date dateTime) { super (dateTime); @@ -74,18 +74,18 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DateTimeAtProcessing. + * {@code object} is an instance of class DateTimeAtProcessing. *
      3. * This date-time at processing attribute's {@link java.util.Date Date} - * value and object's {@link java.util.Date Date} value + * value and {@code object}'s {@link java.util.Date Date} value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this date-time + * @return True if {@code object} is equivalent to this date-time * at processing attribute, false otherwise. */ public boolean equals(Object object) { @@ -112,7 +112,7 @@ public final class DateTimeAtProcessing extends DateTimeSyntax * instance. *

      * For class DateTimeAtProcessing, the category name is - * "date-time-at-processing". + * {@code "date-time-at-processing"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java index 43e1ea9b150..4c855da4b73 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Destination.java @@ -40,7 +40,7 @@ import javax.print.attribute.PrintJobAttribute; * A common use for this attribute will be applications which want * to redirect output to a local disk file : eg."file:out.prn". * Note that proper construction of "file:" scheme URI instances should - * be performed using the toURI() method of class + * be performed using the {@code toURI()} method of class * {@link java.io.File File}. * See the documentation on that class for more information. *

      @@ -64,7 +64,7 @@ public final class Destination extends URISyntax * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public Destination(URI uri) { super (uri); @@ -76,17 +76,17 @@ public final class Destination extends URISyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class Destination. + * {@code object} is an instance of class Destination. *
      3. - * This destination attribute's URI and object's URI + * This destination attribute's URI and {@code object}'s URI * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this destination + * @return True if {@code object} is equivalent to this destination * attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public final class Destination extends URISyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class Destination, the category name is "spool-data-destination". + * For class Destination, the category name is {@code "spool-data-destination"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java index 3e567f50973..f4827744815 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DialogTypeSelection.java @@ -120,7 +120,7 @@ public final class DialogTypeSelection extends EnumSyntax * instance. *

      * For class DialogTypeSelection the category name is - * "dialog-type-selection". + * {@code "dialog-type-selection"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java index 68b93bed43c..a2716895cf1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/DocumentName.java @@ -42,7 +42,7 @@ import javax.print.attribute.DocAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -57,10 +57,10 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * @param documentName Document name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if documentName is null. + * (unchecked exception) Thrown if {@code documentName} is null. */ public DocumentName(String documentName, Locale locale) { super (documentName, locale); @@ -72,20 +72,20 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class DocumentName. + * {@code object} is an instance of class DocumentName. *
      3. * This document name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This document name attribute's locale and object's locale + * This document name attribute's locale and {@code object}'s locale * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this document + * @return True if {@code object} is equivalent to this document * name attribute, false otherwise. */ public boolean equals(Object object) { @@ -109,7 +109,7 @@ public final class DocumentName extends TextSyntax implements DocAttribute { * Get the name of the category of which this attribute value is an * instance. *

      - * For class DocumentName, the category name is "document-name". + * For class DocumentName, the category name is {@code "document-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java index 8db0c98366b..b77b110d309 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Fidelity.java @@ -41,8 +41,8 @@ import javax.print.attribute.PrintRequestAttribute; *

      * IPP Compatibility: The IPP boolean value is "true" for FIDELITY_TRUE * and "false" for FIDELITY_FALSE. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * See RFC 2911 Section 15.1 for * a fuller description of the IPP fidelity attribute. @@ -117,7 +117,7 @@ public final class Fidelity extends EnumSyntax * instance. *

      * For class Fidelity the category name is - * "ipp-attribute-fidelity". + * {@code "ipp-attribute-fidelity"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java index cc21389cbaf..8369f7f4da8 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java @@ -212,8 +212,8 @@ import javax.print.attribute.PrintJobAttribute; * IPP Compatibility: Class Finishings encapsulates some of the * IPP enum values that can be included in an IPP "finishings" attribute, which * is a set of enums. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * In IPP Finishings is a multi-value attribute, this API currently allows * only one binding to be specified. @@ -466,7 +466,7 @@ public class Finishings extends EnumSyntax * instance. *

      * For class Finishings and any vendor-defined subclasses, the - * category name is "finishings". + * category name is {@code "finishings"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java index 4e3ee705bb7..6c6da671faf 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobHoldUntil.java @@ -77,7 +77,7 @@ import javax.print.attribute.PrintJobAttribute; * converted to one of the standard IPP keywords with some loss of precision; * for example, a JobHoldUntil value with today's date and 9:00pm local time * might be converted to the standard IPP keyword "night". The category name - * returned by getName() gives the IPP attribute name. + * returned by {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -94,7 +94,7 @@ public final class JobHoldUntil extends DateTimeSyntax * @param dateTime {@link java.util.Date Date} value. * * @exception NullPointerException - * (unchecked exception) Thrown if dateTime is null. + * (unchecked exception) Thrown if {@code dateTime} is null. */ public JobHoldUntil(Date dateTime) { super (dateTime); @@ -106,17 +106,17 @@ public final class JobHoldUntil extends DateTimeSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobHoldUntil. + * {@code object} is an instance of class JobHoldUntil. *
      3. * This job hold until attribute's {@link java.util.Date Date} value and - * object's {@link java.util.Date Date} value are equal. + * {@code object}'s {@link java.util.Date Date} value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job hold + * @return True if {@code object} is equivalent to this job hold * until attribute, false otherwise. */ public boolean equals(Object object) { @@ -141,7 +141,7 @@ public final class JobHoldUntil extends DateTimeSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobHoldUntil, the category name is "job-hold-until". + * For class JobHoldUntil, the category name is {@code "job-hold-until"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java index e0b267bae89..8d5a1244327 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressions.java @@ -63,7 +63,7 @@ import javax.print.attribute.PrintJobAttribute; * than a measure of the number of impressions to be produced by the job. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobImpressionsSupported @@ -85,7 +85,7 @@ public final class JobImpressions extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobImpressions(int value) { super(value, 0, Integer.MAX_VALUE); @@ -97,17 +97,17 @@ public final class JobImpressions extends IntegerSyntax * be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobImpressions. + * {@code object} is an instance of class JobImpressions. *
      3. - * This job impressions attribute's value and object's value + * This job impressions attribute's value and {@code object}'s value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * impressions attribute, false otherwise. */ public boolean equals(Object object) { @@ -132,7 +132,7 @@ public final class JobImpressions extends IntegerSyntax * instance. *

      * For class JobImpressions, the category name is - * "job-impressions". + * {@code "job-impressions"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java index 2ac4f6049d1..ea346435dd6 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsCompleted.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; * states, the JobImpressionsCompleted value is the final value for the job. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobImpressions @@ -67,7 +67,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobImpressionsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); @@ -79,17 +79,17 @@ public final class JobImpressionsCompleted extends IntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobImpressionsCompleted. + * {@code object} is an instance of class JobImpressionsCompleted. *
      3. * This job impressions completed attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * impressions completed attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class JobImpressionsCompleted extends IntegerSyntax * instance. *

      * For class JobImpressionsCompleted, the category name is - * "job-impressions-completed". + * {@code "job-impressions-completed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java index b6804aae2c8..ee53d2a3614 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobImpressionsSupported.java @@ -41,7 +41,7 @@ import javax.print.attribute.SupportedValuesAttribute; * included in an IPP "job-impressions-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -61,7 +61,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 0. */ public JobImpressionsSupported(int lowerBound, int upperBound) { @@ -81,17 +81,17 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobImpressionsSupported. + * {@code object} is an instance of class JobImpressionsSupported. *
      3. * This job impressions supported attribute's members and - * object's members are the same. + * {@code object}'s members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * impressions supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -118,7 +118,7 @@ public final class JobImpressionsSupported extends SetOfIntegerSyntax * instance. *

      * For class JobImpressionsSupported, the category name is - * "job-impressions-supported". + * {@code "job-impressions-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java index 383f5fe1e2e..c50dc9f3b7d 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctets.java @@ -115,7 +115,7 @@ import javax.print.attribute.PrintJobAttribute; * data, replacing any JobKOctets value the client specified. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobKOctetsSupported @@ -136,7 +136,7 @@ public final class JobKOctets extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobKOctets(int value) { super (value, 0, Integer.MAX_VALUE); @@ -148,17 +148,17 @@ public final class JobKOctets extends IntegerSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobKOctets. + * {@code object} is an instance of class JobKOctets. *
      3. - * This job K octets attribute's value and object's value + * This job K octets attribute's value and {@code object}'s value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job K + * @return True if {@code object} is equivalent to this job K * octets attribute, false otherwise. */ public boolean equals(Object object) { @@ -182,7 +182,7 @@ public final class JobKOctets extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobKOctets, the category name is "job-k-octets". + * For class JobKOctets, the category name is {@code "job-k-octets"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java index cecd80ddd1b..d3fff73454f 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsProcessed.java @@ -57,7 +57,7 @@ import javax.print.attribute.PrintJobAttribute; * JobKOctets} attribute. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobKOctets @@ -79,7 +79,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobKOctetsProcessed(int value) { super (value, 0, Integer.MAX_VALUE); @@ -91,17 +91,17 @@ public final class JobKOctetsProcessed extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobKOctetsProcessed. + * {@code object} is an instance of class JobKOctetsProcessed. *
      3. * This job K octets processed attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job K + * @return True if {@code object} is equivalent to this job K * octets processed attribute, false otherwise. */ public boolean equals(Object object) { @@ -128,7 +128,7 @@ public final class JobKOctetsProcessed extends IntegerSyntax * instance. *

      * For class JobKOctetsProcessed, the category name is - * "job-k-octets-processed". + * {@code "job-k-octets-processed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java index 9a7a8504e00..c4666bee8b1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobKOctetsSupported.java @@ -41,7 +41,7 @@ import javax.print.attribute.SupportedValuesAttribute; * in an IPP "job-k-octets-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -60,7 +60,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 0. */ public JobKOctetsSupported(int lowerBound, int upperBound) { @@ -79,17 +79,17 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobKOctetsSupported. + * {@code object} is an instance of class JobKOctetsSupported. *
      3. * This job K octets supported attribute's members and - * object's members are the same. + * {@code object}'s members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job K + * @return True if {@code object} is equivalent to this job K * octets supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class JobKOctetsSupported extends SetOfIntegerSyntax * instance. *

      * For class JobKOctetsSupported, the category name is - * "job-k-octets-supported". + * {@code "job-k-octets-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java index caeb31e996c..ad574753c4e 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheets.java @@ -55,7 +55,7 @@ import javax.print.attribute.PrintJobAttribute; * with {@link JobMediaSheetsSupported JobMediaSheetsSupported}. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobMediaSheetsSupported @@ -78,7 +78,7 @@ public class JobMediaSheets extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobMediaSheets(int value) { super (value, 0, Integer.MAX_VALUE); @@ -90,17 +90,17 @@ public class JobMediaSheets extends IntegerSyntax * be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMediaSheets. + * {@code object} is an instance of class JobMediaSheets. *
      3. - * This job media sheets attribute's value and object's + * This job media sheets attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job media + * @return True if {@code object} is equivalent to this job media * sheets attribute, false otherwise. */ public boolean equals(Object object) { @@ -126,7 +126,7 @@ public class JobMediaSheets extends IntegerSyntax * instance. *

      * For class JobMediaSheets and any vendor-defined subclasses, the - * category name is "job-media-sheets". + * category name is {@code "job-media-sheets"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java index 5b75cdbb89b..ed39a52e122 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsCompleted.java @@ -45,7 +45,7 @@ import javax.print.attribute.PrintJobAttribute; * states, the JobMediaSheetsCompleted value is the final value for the job. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @see JobMediaSheets @@ -68,7 +68,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public JobMediaSheetsCompleted(int value) { super (value, 0, Integer.MAX_VALUE); @@ -80,17 +80,17 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMediaSheetsCompleted. + * {@code object} is an instance of class JobMediaSheetsCompleted. *
      3. * This job media sheets completed attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job media + * @return True if {@code object} is equivalent to this job media * sheets completed attribute, false otherwise. */ public boolean equals(Object object) { @@ -117,7 +117,7 @@ public final class JobMediaSheetsCompleted extends IntegerSyntax * instance. *

      * For class JobMediaSheetsCompleted, the category name is - * "job-media-sheets-completed". + * {@code "job-media-sheets-completed"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java index 47c7b04459a..19d3a6a2084 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMediaSheetsSupported.java @@ -41,7 +41,7 @@ import javax.print.attribute.SupportedValuesAttribute; * included in an IPP "job-media-sheets-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -60,7 +60,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 0. */ public JobMediaSheetsSupported(int lowerBound, int upperBound) { @@ -79,17 +79,17 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMediaSheetsSupported. + * {@code object} is an instance of class JobMediaSheetsSupported. *
      3. * This job media sheets supported attribute's members and - * object's members are the same. + * {@code object}'s members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job media + * @return True if {@code object} is equivalent to this job media * sheets supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class JobMediaSheetsSupported extends SetOfIntegerSyntax * instance. *

      * For class JobMediaSheetsSupported, the - * category name is "job-media-sheets-supported". + * category name is {@code "job-media-sheets-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java index c1f4231009c..f52de7d303a 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobMessageFromOperator.java @@ -46,7 +46,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -62,10 +62,10 @@ public final class JobMessageFromOperator extends TextSyntax * @param message Message. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if message is null. + * (unchecked exception) Thrown if {@code message} is null. */ public JobMessageFromOperator(String message, Locale locale) { super (message, locale); @@ -77,20 +77,20 @@ public final class JobMessageFromOperator extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobMessageFromOperator. + * {@code object} is an instance of class JobMessageFromOperator. *
      3. * This job message from operator attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This job message from operator attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * message from operator attribute, false otherwise. */ public boolean equals(Object object) { @@ -117,7 +117,7 @@ public final class JobMessageFromOperator extends TextSyntax * instance. *

      * For class JobMessageFromOperator, the - * category name is "job-message-from-operator". + * category name is {@code "job-message-from-operator"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java index bb563ceaf75..7be25f02c91 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobName.java @@ -47,7 +47,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -62,10 +62,10 @@ public final class JobName extends TextSyntax * @param jobName Job name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if jobName is null. + * (unchecked exception) Thrown if {@code jobName} is null. */ public JobName(String jobName, Locale locale) { super (jobName, locale); @@ -76,20 +76,20 @@ public final class JobName extends TextSyntax * object. To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobName. + * {@code object} is an instance of class JobName. *
      3. - * This job name attribute's underlying string and object's + * This job name attribute's underlying string and {@code object}'s * underlying string are equal. *
      4. - * This job name attribute's locale and object's locale are + * This job name attribute's locale and {@code object}'s locale are * equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job name + * @return True if {@code object} is equivalent to this job name * attribute, false otherwise. */ public boolean equals(Object object) { @@ -113,7 +113,7 @@ public final class JobName extends TextSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobName, the category name is "job-name". + * For class JobName, the category name is {@code "job-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java index 61e589c7f64..62a3e20b235 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobOriginatingUserName.java @@ -46,7 +46,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -62,10 +62,10 @@ public final class JobOriginatingUserName extends TextSyntax * @param userName User name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if userName is null. + * (unchecked exception) Thrown if {@code userName} is null. */ public JobOriginatingUserName(String userName, Locale locale) { super (userName, locale); @@ -77,20 +77,20 @@ public final class JobOriginatingUserName extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobOriginatingUserName. + * {@code object} is an instance of class JobOriginatingUserName. *
      3. * This job originating user name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This job originating user name attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * originating user name attribute, false otherwise. */ public boolean equals(Object object) { @@ -117,7 +117,7 @@ public final class JobOriginatingUserName extends TextSyntax * instance. *

      * For class JobOriginatingUserName, the - * category name is "job-originating-user-name". + * category name is {@code "job-originating-user-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java index b4a77ae5c51..7a03e304f1b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPriority.java @@ -52,7 +52,7 @@ import javax.print.attribute.PrintJobAttribute; * among the available job priority levels. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -68,7 +68,7 @@ public final class JobPriority extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1 + * (Unchecked exception) Thrown if {@code value} is less than 1 * or greater than 100. */ public JobPriority(int value) { @@ -81,17 +81,17 @@ public final class JobPriority extends IntegerSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobPriority. + * {@code object} is an instance of class JobPriority. *
      3. - * This job priority attribute's value and object's value + * This job priority attribute's value and {@code object}'s value * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * priority attribute, false otherwise. */ public boolean equals(Object object) { @@ -115,7 +115,7 @@ public final class JobPriority extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class JobPriority, the category name is "job-priority". + * For class JobPriority, the category name is {@code "job-priority"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java index 80e7b6c54a5..3d7cf55095a 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobPrioritySupported.java @@ -42,7 +42,7 @@ import javax.print.attribute.SupportedValuesAttribute; * priority values equally among the available job priority levels. *

      * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -60,7 +60,7 @@ public final class JobPrioritySupported extends IntegerSyntax * @param value Number of different job priority levels supported. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1 + * (Unchecked exception) Thrown if {@code value} is less than 1 * or greater than 100. */ public JobPrioritySupported(int value) { @@ -73,17 +73,17 @@ public final class JobPrioritySupported extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class JobPrioritySupported. + * {@code object} is an instance of class JobPrioritySupported. *
      3. * This job priority supported attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this job + * @return True if {@code object} is equivalent to this job * priority supported attribute, false otherwise. */ public boolean equals (Object object) { @@ -112,7 +112,7 @@ public final class JobPrioritySupported extends IntegerSyntax * instance. *

      * For class JobPrioritySupported, the - * category name is "job-priority-supported". + * category name is {@code "job-priority-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java index cec0f27901a..69579ce6c60 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobSheets.java @@ -44,9 +44,9 @@ import javax.print.attribute.PrintJobAttribute; * particular JobSheets value. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The + * {@code getName()} is the IPP attribute name. The * enumeration's integer value is the IPP enum value. The - * toString() method returns the IPP string representation of + * {@code toString()} method returns the IPP string representation of * the attribute value. For a subclass, the attribute value must be * localized to give the IPP name and natural language values. * @@ -122,7 +122,7 @@ public class JobSheets extends EnumSyntax * instance. *

      * For class JobSheets and any vendor-defined subclasses, the category - * name is "job-sheets". + * name is {@code "job-sheets"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java index 0ad1e5997ba..e87de1aab70 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobState.java @@ -39,8 +39,8 @@ import javax.print.attribute.PrintJobAttribute; * detailed information about the job in the given job state. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -225,7 +225,7 @@ public class JobState extends EnumSyntax implements PrintJobAttribute { * instance. *

      * For class JobState and any vendor-defined subclasses, the category - * name is "job-state". + * name is {@code "job-state"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java index 3465eae6204..553236efaeb 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/JobStateReason.java @@ -48,8 +48,8 @@ import javax.print.attribute.Attribute; * JobState} also changed. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -259,7 +259,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { * The job was aborted by the system because the document data's document * format (doc flavor) is not among those supported by the printer. If the * client specifies a doc flavor with a MIME type of - * "application/octet-stream", the printer may abort the job if + * {@code "application/octet-stream"}, the printer may abort the job if * the printer cannot determine the document data's actual format through * auto-sensing (even if the printer supports the document format if * specified explicitly). This value must be supported, since a doc flavor @@ -449,7 +449,7 @@ public class JobStateReason extends EnumSyntax implements Attribute { * instance. *

      * For class JobStateReason and any vendor-defined subclasses, the - * category name is "job-state-reason". + * category name is {@code "job-state-reason"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java index 59dd57b320b..94eec385dfb 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Media.java @@ -49,8 +49,8 @@ import javax.print.attribute.PrintJobAttribute; * one of the ways in which the Media attribute can be specified. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Phil Race @@ -74,16 +74,16 @@ public abstract class Media extends EnumSyntax * object. To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is of the same subclass of Media as this object. + * {@code object} is of the same subclass of Media as this object. *
      3. * The values are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this media + * @return True if {@code object} is equivalent to this media * attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public abstract class Media extends EnumSyntax * instance. *

      * For class Media and any vendor-defined subclasses, the category name is - * "media". + * {@code "media"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java index 232600e88ad..cfe9a34cbf8 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaPrintableArea.java @@ -54,7 +54,7 @@ import javax.print.attribute.PrintRequestAttribute; * The hardware's minimum margins is not just a property of the printer, * but may be a function of the media size, orientation, media type, and * any specified finishings. - * PrintService provides the method to query the supported + * {@code PrintService} provides the method to query the supported * values of an attribute in a suitable context : * See {@link javax.print.PrintService#getSupportedAttributeValues(Class,DocFlavor, AttributeSet) PrintService.getSupportedAttributeValues()} *

      @@ -236,16 +236,16 @@ public final class MediaPrintableArea * To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class MediaPrintableArea. + * {@code object} is an instance of class MediaPrintableArea. *
      3. * The origin and dimensions are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this media margins + * @return True if {@code object} is equivalent to this media margins * attribute, false otherwise. */ public boolean equals(Object object) { @@ -278,7 +278,7 @@ public final class MediaPrintableArea * instance. *

      * For class MediaPrintableArea, - * the category name is "media-printable-area". + * the category name is {@code "media-printable-area"}. *

      This is not an IPP V1.1 attribute. * * @return Attribute category name. @@ -295,7 +295,7 @@ public final class MediaPrintableArea * Unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM}. * @param unitsName - * Units name string, e.g. "in" or "mm". If + * Units name string, e.g. {@code "in"} or {@code "mm"}. If * null, no units name is appended to the result. * * @return String version of this two-dimensional size attribute. diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java index b6fdbdccb4f..55990097a71 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java @@ -42,7 +42,7 @@ import javax.print.attribute.Attribute; * MediaSize is not yet used to specify media. Its current role is * as a mapping for named media (see {@link MediaSizeName MediaSizeName}). * Clients can use the mapping method - * MediaSize.getMediaSizeForName(MediaSizeName) + * {@code MediaSize.getMediaSizeForName(MediaSizeName)} * to find the physical dimensions of the MediaSizeName instances * enumerated in this API. This is useful for clients which need this * information to format {@literal &} paginate printing. @@ -66,8 +66,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * * @exception IllegalArgumentException * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or @@ -87,8 +87,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * * @exception IllegalArgumentException * (Unchecked exception) Thrown if {@code x < 0} or {@code y < 0} or @@ -109,8 +109,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * @param media a media name to associate with this MediaSize * * @exception IllegalArgumentException @@ -135,8 +135,8 @@ public class MediaSize extends Size2DSyntax implements Attribute { * @param x X dimension. * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM. + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM}. * @param media a media name to associate with this MediaSize * * @exception IllegalArgumentException @@ -168,7 +168,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { /** * Get the MediaSize for the specified named media. * - * @param media - the name of the media for which the size is sought + * @param media the name of the media for which the size is sought * @return size of the media, or null if this media is not associated * with any size. */ @@ -187,11 +187,11 @@ public class MediaSize extends Size2DSyntax implements Attribute { *

      * This method is useful for clients which have only dimensions and * want to find a Media which corresponds to the dimensions. - * @param x - X dimension - * @param y - Y dimension. + * @param x X dimension + * @param y Y dimension. * @param units - * Unit conversion factor, e.g. Size2DSyntax.INCH or - * Size2DSyntax.MM + * Unit conversion factor, e.g. {@code Size2DSyntax.INCH} or + * {@code Size2DSyntax.MM} * @return MediaSizeName matching these dimensions, or null. * @exception IllegalArgumentException if {@code x <= 0}, * {@code y <= 0}, or {@code units < 1}. @@ -237,20 +237,20 @@ public class MediaSize extends Size2DSyntax implements Attribute { * To be equivalent, all of the following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class MediaSize. + * {@code object} is an instance of class MediaSize. *
      3. * This media size attribute's X dimension is equal to - * object's X dimension. + * {@code object}'s X dimension. *
      4. * This media size attribute's Y dimension is equal to - * object's Y dimension. + * {@code object}'s Y dimension. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this media size + * @return True if {@code object} is equivalent to this media size * attribute, false otherwise. */ public boolean equals(Object object) { @@ -276,7 +276,7 @@ public class MediaSize extends Size2DSyntax implements Attribute { * instance. *

      * For class MediaSize and any vendor-defined subclasses, the category - * name is "media-size". + * name is {@code "media-size"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java index f3e02845159..7f06e953572 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/MultipleDocumentHandling.java @@ -62,53 +62,53 @@ import javax.print.attribute.PrintJobAttribute; * specify two variations of this possibility. * *

      - * In the detailed explanations below, if "a" represents an + * In the detailed explanations below, if "{@code a}" represents an * instance of document data, then the result of processing the data in - * document "a" is a sequence of media sheets represented by - * "a(*)". + * document "{@code a}" is a sequence of media sheets represented by + * "{@code a(*)}". *

      * The standard MultipleDocumentHandling values are: *

        *
      • * {@link #SINGLE_DOCUMENT * SINGLE_DOCUMENT}. If a print job has multiple - * documents -- say, the document data is called a and - * b -- then the result of processing all the document data - * (a and then b) must be treated as a single sequence + * documents -- say, the document data is called {@code a} and + * {@code b} -- then the result of processing all the document data + * ({@code a} and then {@code b}) must be treated as a single sequence * of media sheets for finishing operations; that is, finishing would be - * performed on the concatenation of the sequences a(*),b(*). The + * performed on the concatenation of the sequences {@code a(*),b(*)}. The * printer must not force the data in each document instance to be formatted * onto a new print-stream page, nor to start a new impression on a new media * sheet. If more than one copy is made, the ordering of the sets of media * sheets resulting from processing the document data must be - * a(*),b(*),a(*),b(*),..., and the printer object must force - * each copy (a(*),b(*)) to start on a new media sheet. + * {@code a(*),b(*),a(*),b(*),...}, and the printer object must force + * each copy ({@code a(*),b(*)}) to start on a new media sheet. * *
      • * {@link #SEPARATE_DOCUMENTS_UNCOLLATED_COPIES * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES}. If a print job - * has multiple documents -- say, the document data is called a and - * b -- then the result of processing the data in each document + * has multiple documents -- say, the document data is called {@code a} and + * {@code b} -- then the result of processing the data in each document * instance must be treated as a single sequence of media sheets for finishing - * operations; that is, the sets a(*) and b(*) would + * operations; that is, the sets {@code a(*)} and {@code b(*)} would * each be finished separately. The printer must force each copy of the result * of processing the data in a single document to start on a new media sheet. * If more than one copy is made, the ordering of the sets of media sheets * resulting from processing the document data must be - * a(*),a(*),...,b(*),b(*).... + * {@code a(*),a(*),...,b(*),b(*)...}. * *
      • * {@link #SEPARATE_DOCUMENTS_COLLATED_COPIES * SEPARATE_DOCUMENTS_COLLATED_COPIES}. If a print job - * has multiple documents -- say, the document data is called a and - * b -- then the result of processing the data in each document + * has multiple documents -- say, the document data is called {@code a} and + * {@code b} -- then the result of processing the data in each document * instance must be treated as a single sequence of media sheets for finishing - * operations; that is, the sets a(*) and b(*) would + * operations; that is, the sets {@code a(*)} and {@code b(*)} would * each be finished separately. The printer must force each copy of the result * of processing the data in a single document to start on a new media sheet. * If more than one copy is made, the ordering of the sets of media sheets * resulting from processing the document data must be - * a(*),b(*),a(*),b(*),.... + * {@code a(*),b(*),a(*),b(*),...}. * *
      • * {@link #SINGLE_DOCUMENT_NEW_SHEET @@ -130,18 +130,18 @@ import javax.print.attribute.PrintJobAttribute; * {@link Finishings#STAPLE STAPLE} is specified, then: *
          *
        • - * With SINGLE_DOCUMENT, documents a and b are + * With SINGLE_DOCUMENT, documents {@code a} and {@code b} are * stapled together as a single document with no regard to new sheets. * *
        • - * With SINGLE_DOCUMENT_NEW_SHEET, documents a and b - * are stapled together as a single document, but document b + * With SINGLE_DOCUMENT_NEW_SHEET, documents {@code a} and {@code b} + * are stapled together as a single document, but document {@code b} * starts on a new sheet. * *
        • * With SEPARATE_DOCUMENTS_UNCOLLATED_COPIES and - * SEPARATE_DOCUMENTS_COLLATED_COPIES, documents a and - * b are stapled separately. + * SEPARATE_DOCUMENTS_COLLATED_COPIES, documents {@code a} and + * {@code b} are stapled separately. *
        *

        * Note: None of these values provide means to produce uncollated @@ -150,8 +150,8 @@ import javax.print.attribute.PrintJobAttribute; * To specify that, see the {@link SheetCollate SheetCollate} attribute. *

        * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @see Copies @@ -256,7 +256,7 @@ public class MultipleDocumentHandling extends EnumSyntax * instance. *

        * For class MultipleDocumentHandling and any vendor-defined subclasses, - * the category name is "multiple-document-handling". + * the category name is {@code "multiple-document-handling"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java index 73e07e8d124..50e0b10b7c9 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfDocuments.java @@ -35,7 +35,7 @@ import javax.print.attribute.PrintJobAttribute; * not. *

        * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -53,7 +53,7 @@ public final class NumberOfDocuments extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public NumberOfDocuments(int value) { super (value, 0, Integer.MAX_VALUE); @@ -65,17 +65,17 @@ public final class NumberOfDocuments extends IntegerSyntax * must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class NumberOfDocuments. + * {@code object} is an instance of class NumberOfDocuments. *
        3. - * This number of documents attribute's value and object's + * This number of documents attribute's value and {@code object}'s * value are equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this number of + * @return True if {@code object} is equivalent to this number of * documents attribute, false otherwise. */ public boolean equals(Object object) { @@ -102,7 +102,7 @@ public final class NumberOfDocuments extends IntegerSyntax * instance. *

        * For class NumberOfDocuments, the - * category name is "number-of-documents". + * category name is {@code "number-of-documents"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java index e73ef00be84..0a01f090bf3 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberOfInterveningJobs.java @@ -35,7 +35,7 @@ import javax.print.attribute.PrintJobAttribute; * scheduled order). *

        * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -52,7 +52,7 @@ public final class NumberOfInterveningJobs extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public NumberOfInterveningJobs(int value) { super(value, 0, Integer.MAX_VALUE); @@ -64,17 +64,17 @@ public final class NumberOfInterveningJobs extends IntegerSyntax * conditions must be true: *

          *
        1. - * object is not null. + * {@code object} is not null. *
        2. - * object is an instance of class NumberOfInterveningJobs. + * {@code object} is an instance of class NumberOfInterveningJobs. *
        3. * This number of intervening jobs attribute's value and - * object's value are equal. + * {@code object}'s value are equal. *
        * * @param object Object to compare to. * - * @return True if object is equivalent to this number of + * @return True if {@code object} is equivalent to this number of * intervening jobs attribute, false otherwise. */ public boolean equals(Object object) { @@ -101,7 +101,7 @@ public final class NumberOfInterveningJobs extends IntegerSyntax * instance. *

        * For class NumberOfInterveningJobs, the - * category name is "number-of-intervening-jobs". + * category name is {@code "number-of-intervening-jobs"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java index d029d82faa8..b6a965a7c76 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUp.java @@ -118,7 +118,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -135,7 +135,7 @@ public final class NumberUp extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 1. + * (Unchecked exception) Thrown if {@code value} is less than 1. */ public NumberUp(int value) { super (value, 1, Integer.MAX_VALUE); @@ -146,17 +146,17 @@ public final class NumberUp extends IntegerSyntax * object. To be equivalent, all of the following conditions must be true: *
        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class NumberUp. + * {@code object} is an instance of class NumberUp. *
      3. - * This number up attribute's value and object's value are + * This number up attribute's value and {@code object}'s value are * equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this number up + * @return True if {@code object} is equivalent to this number up * attribute, false otherwise. */ public boolean equals(Object object) { @@ -180,7 +180,7 @@ public final class NumberUp extends IntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class NumberUp, the category name is "number-up". + * For class NumberUp, the category name is {@code "number-up"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java index a7f1b98bc1f..e5107b8ca04 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/NumberUpSupported.java @@ -37,7 +37,7 @@ import javax.print.attribute.SupportedValuesAttribute; * included in an IPP "number-up-supported" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -57,12 +57,12 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * @param members Set members in array form. * * @exception NullPointerException - * (unchecked exception) Thrown if members is null or - * any element of members is null. + * (unchecked exception) Thrown if {@code members} is null or + * any element of {@code members} is null. * @exception IllegalArgumentException * (unchecked exception) Thrown if any element of - * members is not a length-one or length-two array. Also - * thrown if members is a zero-length array or if any + * {@code members} is not a length-one or length-two array. Also + * thrown if {@code members} is a zero-length array or if any * member of the set is less than 1. */ public NumberUpSupported(int[][] members) { @@ -91,7 +91,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than + * (Unchecked exception) Thrown if {@code member} is less than * 1. */ public NumberUpSupported(int member) { @@ -111,7 +111,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 1. */ public NumberUpSupported(int lowerBound, int upperBound) { @@ -130,17 +130,17 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class NumberUpSupported. + * {@code object} is an instance of class NumberUpSupported. *
      3. - * This number up supported attribute's members and object's + * This number up supported attribute's members and {@code object}'s * members are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this number up + * @return True if {@code object} is equivalent to this number up * supported attribute, false otherwise. */ public boolean equals(Object object) { @@ -167,7 +167,7 @@ public final class NumberUpSupported extends SetOfIntegerSyntax * instance. *

      * For class NumberUpSupported, the - * category name is "number-up-supported". + * category name is {@code "number-up-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java index a026baac5db..0ce78a5b390 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OrientationRequested.java @@ -36,17 +36,17 @@ import javax.print.attribute.PrintJobAttribute; * does not describe the orientation of the client-supplied print-stream * pages. *

      - * For some document formats (such as "application/postscript"), + * For some document formats (such as {@code "application/postscript"}), * the desired orientation of the print-stream pages is specified within the * document data. This information is generated by a device driver prior to * the submission of the print job. Other document formats (such as - * "text/plain") do not include the notion of desired orientation + * {@code "text/plain"}) do not include the notion of desired orientation * within the document data. In the latter case it is possible for the printer * to bind the desired orientation to the document data after it has been * submitted. It is expected that a printer would only support the * OrientationRequested attribute for some document formats (e.g., - * "text/plain" or "text/html") but not others (e.g. - * "application/postscript"). This is no different from any other + * {@code "text/plain"} or {@code "text/html"}) but not others (e.g. + * {@code "application/postscript"}). This is no different from any other * job template attribute, since a print job can always impose constraints * among the values of different job template attributes. * However, a special mention @@ -55,8 +55,8 @@ import javax.print.attribute.PrintJobAttribute; * formats. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -105,7 +105,7 @@ public final class OrientationRequested extends EnumSyntax * Finishings Finishings} attribute in cases where the * opposite edge is desired for finishing a portrait document on simple * finishing devices that have only one finishing position. Thus a - * "text/plain" portrait document can be stapled "on the + * {@code "text/plain"} portrait document can be stapled "on the * right" by a simple finishing device as is common use with some * Middle Eastern languages such as Hebrew. */ @@ -176,7 +176,7 @@ public final class OrientationRequested extends EnumSyntax * instance. *

      * For class OrientationRequested, the - * category name is "orientation-requested". + * category name is {@code "orientation-requested"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java index 5ebf19378fd..e9411371466 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/OutputDeviceAssigned.java @@ -42,7 +42,7 @@ import javax.print.attribute.PrintJobAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -58,10 +58,10 @@ public final class OutputDeviceAssigned extends TextSyntax * @param deviceName Device name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if deviceName is null. + * (unchecked exception) Thrown if {@code deviceName} is null. */ public OutputDeviceAssigned(String deviceName, Locale locale) { @@ -76,20 +76,20 @@ public final class OutputDeviceAssigned extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class OutputDeviceAssigned. + * {@code object} is an instance of class OutputDeviceAssigned. *
      3. * This output device assigned attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This output device assigned attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this output + * @return True if {@code object} is equivalent to this output * device assigned attribute, false otherwise. */ public boolean equals(Object object) { @@ -116,7 +116,7 @@ public final class OutputDeviceAssigned extends TextSyntax * instance. *

      * For class OutputDeviceAssigned, the - * category name is "output-device-assigned". + * category name is {@code "output-device-assigned"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java index b7f75af6ead..e1d31db38c1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PDLOverrideSupported.java @@ -35,8 +35,8 @@ import javax.print.attribute.PrintServiceAttribute; * specified as attributes outside the print data. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -116,7 +116,7 @@ public class PDLOverrideSupported extends EnumSyntax * instance. *

      * For class PDLOverrideSupported and any vendor-defined subclasses, the - * category name is "pdl-override-supported". + * category name is {@code "pdl-override-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java index 6038f0bb534..7e92d6db2c0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PageRanges.java @@ -44,13 +44,13 @@ import javax.print.attribute.PrintJobAttribute; * driver and this attribute would not be required. However, when printing an * archived document which has already been formatted, the end user may elect to * print just a subset of the pages contained in the document. In this case, if - * a page range of "n-m" is specified, the first page + * a page range of "n-m" is specified, the first page * to be printed will be page n. All subsequent pages of the document * will be printed through and including page m. *

      * If a PageRanges attribute is not specified for a print job, all pages of * the document will be printed. In other words, the default value for the - * PageRanges attribute is always {{1, Integer.MAX_VALUE}}. + * PageRanges attribute is always {@code {{1, Integer.MAX_VALUE}}}. *

      * The effect of a PageRanges attribute on a multidoc print job (a job with * multiple documents) depends on whether all the docs have the same page ranges @@ -99,7 +99,7 @@ import javax.print.attribute.PrintJobAttribute; * and IPP "page-ranges" attribute. See class {@link * javax.print.attribute.SetOfIntegerSyntax SetOfIntegerSyntax} for an * explanation of canonical array form. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author David Mendenhall * @author Alan Kaminsky @@ -119,12 +119,12 @@ public final class PageRanges extends SetOfIntegerSyntax * @param members Set members in array form. * * @exception NullPointerException - * (unchecked exception) Thrown if members is null or - * any element of members is null. + * (unchecked exception) Thrown if {@code members} is null or + * any element of {@code members} is null. * @exception IllegalArgumentException * (unchecked exception) Thrown if any element of - * members is not a length-one or length-two array. Also - * thrown if members is a zero-length array or if any + * {@code members} is not a length-one or length-two array. Also + * thrown if {@code members} is a zero-length array or if any * member of the set is less than 1. */ public PageRanges(int[][] members) { @@ -144,10 +144,10 @@ public final class PageRanges extends SetOfIntegerSyntax * @param members Set members in string form. * * @exception NullPointerException - * (unchecked exception) Thrown if members is null or - * any element of members is null. + * (unchecked exception) Thrown if {@code members} is null or + * any element of {@code members} is null. * @exception IllegalArgumentException - * (Unchecked exception) Thrown if members does not + * (Unchecked exception) Thrown if {@code members} does not * obey the proper syntax. Also * thrown if the constructed set-of-integer is a * zero-length array or if any @@ -182,7 +182,7 @@ public final class PageRanges extends SetOfIntegerSyntax * @param member Set member. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if member is less than + * (Unchecked exception) Thrown if {@code member} is less than * 1. */ public PageRanges(int member) { @@ -201,7 +201,7 @@ public final class PageRanges extends SetOfIntegerSyntax * * @exception IllegalArgumentException * (Unchecked exception) Thrown if a null range is specified or if a - * non-null range is specified with lowerBound less than + * non-null range is specified with {@code lowerBound} less than * 1. */ public PageRanges(int lowerBound, int upperBound) { @@ -219,17 +219,17 @@ public final class PageRanges extends SetOfIntegerSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PageRanges. + * {@code object} is an instance of class PageRanges. *
      3. - * This page ranges attribute's members and object's members + * This page ranges attribute's members and {@code object}'s members * are the same. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this page ranges + * @return True if {@code object} is equivalent to this page ranges * attribute, false otherwise. */ public boolean equals(Object object) { @@ -253,7 +253,7 @@ public final class PageRanges extends SetOfIntegerSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class PageRanges, the category name is "page-ranges". + * For class PageRanges, the category name is {@code "page-ranges"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java index 37d0ddbd5d7..397ad356837 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinute.java @@ -37,7 +37,7 @@ import javax.print.attribute.PrintServiceAttribute; * device that takes more than two minutes to process a page. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -54,7 +54,7 @@ public final class PagesPerMinute extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public PagesPerMinute(int value) { super(value, 0, Integer.MAX_VALUE); @@ -66,17 +66,17 @@ public final class PagesPerMinute extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PagesPerMinute. + * {@code object} is an instance of class PagesPerMinute. *
      3. - * This pages per minute attribute's value and object's + * This pages per minute attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this pages per + * @return True if {@code object} is equivalent to this pages per * minute attribute, false otherwise. */ public boolean equals(Object object) { @@ -102,7 +102,7 @@ public final class PagesPerMinute extends IntegerSyntax * instance. *

      * For class PagesPerMinute, the - * category name is "pages-per-minute". + * category name is {@code "pages-per-minute"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java index f139c5964ce..9af138bf5dd 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PagesPerMinuteColor.java @@ -48,7 +48,7 @@ import javax.print.attribute.PrintServiceAttribute; * attribute must also be present and have a value of SUPPORTED. *

      * IPP Compatibility: The integer value gives the IPP integer value. The - * category name returned by getName() gives the IPP attribute + * category name returned by {@code getName()} gives the IPP attribute * name. * * @author Alan Kaminsky @@ -65,7 +65,7 @@ public final class PagesPerMinuteColor extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public PagesPerMinuteColor(int value) { super(value, 0, Integer.MAX_VALUE); @@ -77,17 +77,17 @@ public final class PagesPerMinuteColor extends IntegerSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PagesPerMinuteColor. + * {@code object} is an instance of class PagesPerMinuteColor. *
      3. - * This pages per minute attribute's value and object's + * This pages per minute attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this pages per + * @return True if {@code object} is equivalent to this pages per * minute color attribute, false otherwise. */ public boolean equals(Object object) { @@ -114,7 +114,7 @@ public final class PagesPerMinuteColor extends IntegerSyntax * instance. *

      * For class PagesPerMinuteColor, the - * category name is "pages-per-minute-color". + * category name is {@code "pages-per-minute-color"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java index 4b3ff06d073..70d8acff70b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java @@ -42,8 +42,8 @@ import javax.print.attribute.PrintRequestAttribute; * attribute; it is an attribute in the Production Printing Extension * (PDF) * of IPP 1.1. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Phil Race. @@ -174,7 +174,7 @@ public final class PresentationDirection extends EnumSyntax * instance. *

      * For class PresentationDirection - * the category name is "presentation-direction". + * the category name is {@code "presentation-direction"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java index 6240965c68a..6ed83ff5842 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrintQuality.java @@ -35,8 +35,8 @@ import javax.print.attribute.PrintJobAttribute; * that specifies the print quality that the printer uses for the job. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author David Mendenhall @@ -123,7 +123,7 @@ public class PrintQuality extends EnumSyntax * instance. *

      * For class PrintQuality and any vendor-defined subclasses, the category - * name is "print-quality". + * name is {@code "print-quality"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java index 57813ec20b7..13b8ca7c33c 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterInfo.java @@ -33,15 +33,15 @@ import javax.print.attribute.PrintServiceAttribute; /** * Class PrinterInfo is a printing attribute class, a text attribute, that * provides descriptive information about a printer. This could include things - * like: "This printer can be used for printing color transparencies for - * HR presentations", or "Out of courtesy for others, please - * print only small (1-5 page) jobs at this printer", or even \ - * "This printer is going away on July 1, 1997, please find a new - * printer". + * like: {@code "This printer can be used for printing color transparencies for + * HR presentations"}, or {@code "Out of courtesy for others, please + * print only small (1-5 page) jobs at this printer"}, or even + * {@code "This printer is going away on July 1, 1997, please find a new + * printer"}. *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -57,10 +57,10 @@ public final class PrinterInfo extends TextSyntax * @param info Printer information string. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if info is null. + * (unchecked exception) Thrown if {@code info} is null. */ public PrinterInfo(String info, Locale locale) { super (info, locale); @@ -72,20 +72,20 @@ public final class PrinterInfo extends TextSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterInfo. + * {@code object} is an instance of class PrinterInfo. *
      3. * This printer info attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This printer info attribute's locale and object's + * This printer info attribute's locale and {@code object}'s * locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * info attribute, false otherwise. */ public boolean equals(Object object) { @@ -109,7 +109,7 @@ public final class PrinterInfo extends TextSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class PrinterInfo, the category name is "printer-info". + * For class PrinterInfo, the category name is {@code "printer-info"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java index b04c4bab5ec..39b4961399a 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterIsAcceptingJobs.java @@ -40,8 +40,8 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The IPP boolean value is "true" for ACCEPTING_JOBS * and "false" for NOT_ACCEPTING_JOBS. The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -116,7 +116,7 @@ public final class PrinterIsAcceptingJobs extends EnumSyntax * instance. *

      * For class PrinterIsAcceptingJobs, the - * category name is "printer-is-accepting-jobs". + * category name is {@code "printer-is-accepting-jobs"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java index 7675cb956d4..73056a85820 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterLocation.java @@ -33,11 +33,11 @@ import javax.print.attribute.PrintServiceAttribute; /** * Class PrinterLocation is a printing attribute class, a text attribute, that * identifies the location of the device. This could include things like: - * "in Room 123A, second floor of building XYZ". + * {@code "in Room 123A, second floor of building XYZ"}. *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -53,10 +53,10 @@ public final class PrinterLocation extends TextSyntax * @param location Printer location. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if location is null. + * (unchecked exception) Thrown if {@code location} is null. */ public PrinterLocation(String location, Locale locale) { super (location, locale); @@ -68,20 +68,20 @@ public final class PrinterLocation extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterLocation. + * {@code object} is an instance of class PrinterLocation. *
      3. * This printer location attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This printer location attribute's locale and object's + * This printer location attribute's locale and {@code object}'s * locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * location attribute, false otherwise. */ public boolean equals(Object object) { @@ -107,7 +107,7 @@ public final class PrinterLocation extends TextSyntax * instance. *

      * For class PrinterLocation, the - * category name is "printer-location". + * category name is {@code "printer-location"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java index c0538fae845..55a61ea44a3 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMakeAndModel.java @@ -35,7 +35,7 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -51,10 +51,10 @@ public final class PrinterMakeAndModel extends TextSyntax * @param makeAndModel Printer make and model string. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if makeAndModel is null. + * (unchecked exception) Thrown if {@code makeAndModel} is null. */ public PrinterMakeAndModel(String makeAndModel, Locale locale) { super (makeAndModel, locale); @@ -66,20 +66,20 @@ public final class PrinterMakeAndModel extends TextSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterMakeAndModel. + * {@code object} is an instance of class PrinterMakeAndModel. *
      3. * This printer make and model attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This printer make and model attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * make and model attribute, false otherwise. */ public boolean equals(Object object) { @@ -106,7 +106,7 @@ public final class PrinterMakeAndModel extends TextSyntax * instance. *

      * For class PrinterMakeAndModel, the - * category name is "printer-make-and-model". + * category name is {@code "printer-make-and-model"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java index d46412d2f9c..94388ca9469 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMessageFromOperator.java @@ -50,7 +50,7 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -66,10 +66,10 @@ public final class PrinterMessageFromOperator extends TextSyntax * @param message Message. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if message is null. + * (unchecked exception) Thrown if {@code message} is null. */ public PrinterMessageFromOperator(String message, Locale locale) { super (message, locale); @@ -81,21 +81,21 @@ public final class PrinterMessageFromOperator extends TextSyntax * following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class + * {@code object} is an instance of class * PrinterMessageFromOperator. *
      3. * This printer message from operator attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This printer message from operator attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * message from operator attribute, false otherwise. */ public boolean equals(Object object) { @@ -122,7 +122,7 @@ public final class PrinterMessageFromOperator extends TextSyntax * instance. *

      * For class PrinterMessageFromOperator, - * the category name is "printer-message-from-operator". + * the category name is {@code "printer-message-from-operator"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java index c982907badf..285a42574b0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfo.java @@ -46,8 +46,8 @@ import javax.print.attribute.PrintServiceAttribute; * about this general kind of printer rather than this specific printer. *

      * IPP Compatibility: The string form returned by - * toString() gives the IPP uri value. - * The category name returned by getName() + * {@code toString()} gives the IPP uri value. + * The category name returned by {@code getName()} * gives the IPP attribute name. * * @author Alan Kaminsky @@ -63,7 +63,7 @@ public final class PrinterMoreInfo extends URISyntax * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public PrinterMoreInfo(URI uri) { super (uri); @@ -75,17 +75,17 @@ public final class PrinterMoreInfo extends URISyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterMoreInfo. + * {@code object} is an instance of class PrinterMoreInfo. *
      3. - * This printer more info attribute's URI and object's URI + * This printer more info attribute's URI and {@code object}'s URI * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * more info attribute, false otherwise. */ public boolean equals(Object object) { @@ -111,7 +111,7 @@ public final class PrinterMoreInfo extends URISyntax * instance. *

      * For class PrinterMoreInfo, the - * category name is "printer-more-info". + * category name is {@code "printer-more-info"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java index 10b4e9acace..881b5cb8a14 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterMoreInfoManufacturer.java @@ -46,8 +46,8 @@ import javax.print.attribute.PrintServiceAttribute; * general kind of printer. *

      * IPP Compatibility: The string form returned by - * toString() gives the IPP uri value. - * The category name returned by getName() + * {@code toString()} gives the IPP uri value. + * The category name returned by {@code getName()} * gives the IPP attribute name. * * @author Alan Kaminsky @@ -64,7 +64,7 @@ public final class PrinterMoreInfoManufacturer extends URISyntax * @param uri URI. * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public PrinterMoreInfoManufacturer(URI uri) { super (uri); @@ -76,18 +76,18 @@ public final class PrinterMoreInfoManufacturer extends URISyntax * following conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class + * {@code object} is an instance of class * PrinterMoreInfoManufacturer. *
      3. * This printer more info manufacturer attribute's URI and - * object's URI are equal. + * {@code object}'s URI are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * more info manufacturer attribute, false otherwise. */ public boolean equals(Object object) { @@ -114,7 +114,7 @@ public final class PrinterMoreInfoManufacturer extends URISyntax * instance. *

      * For class PrinterMoreInfoManufacturer, the category name is - * "printer-more-info-manufacturer". + * {@code "printer-more-info-manufacturer"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java index a8b2487ad17..3bc293df02b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterName.java @@ -40,7 +40,7 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -55,10 +55,10 @@ public final class PrinterName extends TextSyntax * @param printerName Printer name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if printerName is null. + * (unchecked exception) Thrown if {@code printerName} is null. */ public PrinterName(String printerName, Locale locale) { super (printerName, locale); @@ -70,20 +70,20 @@ public final class PrinterName extends TextSyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterName. + * {@code object} is an instance of class PrinterName. *
      3. * This printer name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. - * This printer name attribute's locale and object's locale + * This printer name attribute's locale and {@code object}'s locale * are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * name attribute, false otherwise. */ public boolean equals(Object object) { @@ -109,7 +109,7 @@ public final class PrinterName extends TextSyntax * instance. *

      * For class PrinterName, the category - * name is "printer-name". + * name is {@code "printer-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java index 67d908103a2..408d2007324 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterResolution.java @@ -61,9 +61,9 @@ import javax.print.attribute.PrintJobAttribute; * PrintQuality attribute which often controls resolution. *

      * IPP Compatibility: The information needed to construct an IPP - * "printer-resolution" attribute can be obtained by calling + * {@code "printer-resolution"} attribute can be obtained by calling * methods on the PrinterResolution object. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author David Mendenhall * @author Alan Kaminsky @@ -81,8 +81,8 @@ public final class PrinterResolution extends ResolutionSyntax * @param feedResolution * Feed direction resolution. * @param units - * Unit conversion factor, e.g. ResolutionSyntax.DPI - * or ResolutionSyntax.DPCM. + * Unit conversion factor, e.g. {@code ResolutionSyntax.DPI} + * or {@code ResolutionSyntax.DPCM}. * * @exception IllegalArgumentException * (unchecked exception) Thrown if {@code crossFeedResolution < 1} or @@ -99,20 +99,20 @@ public final class PrinterResolution extends ResolutionSyntax * must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterResolution. + * {@code object} is an instance of class PrinterResolution. *
      3. * This attribute's cross feed direction resolution is equal to - * object's cross feed direction resolution. + * {@code object}'s cross feed direction resolution. *
      4. * This attribute's feed direction resolution is equal to - * object's feed direction resolution. + * {@code object}'s feed direction resolution. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this printer + * @return True if {@code object} is equivalent to this printer * resolution attribute, false otherwise. */ public boolean equals(Object object) { @@ -138,7 +138,7 @@ public final class PrinterResolution extends ResolutionSyntax * instance. *

      * For class PrinterResolution, the - * category name is "printer-resolution". + * category name is {@code "printer-resolution"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java index 961d82ec53d..4af01a6cda6 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterState.java @@ -39,8 +39,8 @@ import javax.print.attribute.PrintServiceAttribute; * in given printer state. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -130,7 +130,7 @@ implements PrintServiceAttribute { * Get the name of the category of which this attribute value is an * instance. *

      - * For class PrinterState, the category name is "printer-state". + * For class PrinterState, the category name is {@code "printer-state"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java index ece9a538397..cdcb8e56d88 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterStateReason.java @@ -56,10 +56,10 @@ import javax.print.attribute.Attribute; *

      * IPP Compatibility: * The string values returned by each individual {@link PrinterStateReason} and - * associated {@link Severity} object's toString() - * methods, concatenated together with a hyphen ("-") in + * associated {@link Severity} object's {@code toString()} + * methods, concatenated together with a hyphen ({@code "-"}) in * between, gives the IPP keyword value for a {@link PrinterStateReasons}. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -432,7 +432,7 @@ public class PrinterStateReason extends EnumSyntax implements Attribute { * instance. *

      * For class PrinterStateReason and any vendor-defined subclasses, the - * category name is "printer-state-reason". + * category name is {@code "printer-state-reason"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java index 9471b73481b..b2224d10bfe 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/PrinterURI.java @@ -38,8 +38,8 @@ import javax.print.attribute.PrintServiceAttribute; *

      * IPP Compatibility: This implements the * IPP printer-uri attribute. The string form returned by - * toString() gives the IPP printer-uri value. - * The category name returned by getName() + * {@code toString()} gives the IPP printer-uri value. + * The category name returned by {@code getName()} * gives the IPP attribute name. * * @author Robert Herriot @@ -56,7 +56,7 @@ public final class PrinterURI extends URISyntax * @param uri URI of the printer * * @exception NullPointerException - * (unchecked exception) Thrown if uri is null. + * (unchecked exception) Thrown if {@code uri} is null. */ public PrinterURI(URI uri) { super (uri); @@ -68,17 +68,17 @@ public final class PrinterURI extends URISyntax * true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class PrinterURI. + * {@code object} is an instance of class PrinterURI. *
      3. * This PrinterURI attribute's underlying URI and - * object's underlying URI are equal. + * {@code object}'s underlying URI are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this PrinterURI + * @return True if {@code object} is equivalent to this PrinterURI * attribute, false otherwise. */ public boolean equals(Object object) { @@ -104,7 +104,7 @@ public final class PrinterURI extends URISyntax * instance. *

      * For class PrinterURI and any vendor-defined subclasses, the category - * name is "printer-uri". + * name is {@code "printer-uri"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java index f335288bd9c..41a710cb624 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/QueuedJobCount.java @@ -34,7 +34,7 @@ import javax.print.attribute.PrintServiceAttribute; * PENDING, PENDING_HELD, PROCESSING, or PROCESSING_STOPPED. *

      * IPP Compatibility: The integer value gives the IPP integer value. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -51,7 +51,7 @@ public final class QueuedJobCount extends IntegerSyntax * @param value Integer value. * * @exception IllegalArgumentException - * (Unchecked exception) Thrown if value is less than 0. + * (Unchecked exception) Thrown if {@code value} is less than 0. */ public QueuedJobCount(int value) { super (value, 0, Integer.MAX_VALUE); @@ -63,17 +63,17 @@ public final class QueuedJobCount extends IntegerSyntax * mus be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class QueuedJobCount. + * {@code object} is an instance of class QueuedJobCount. *
      3. - * This queued job count attribute's value and object's + * This queued job count attribute's value and {@code object}'s * value are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this queued job + * @return True if {@code object} is equivalent to this queued job * count attribute, false otherwise. */ public boolean equals(Object object) { @@ -99,7 +99,7 @@ public final class QueuedJobCount extends IntegerSyntax * instance. *

      * For class QueuedJobCount, the - * category name is "queued-job-count". + * category name is {@code "queued-job-count"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java index 8597c3143eb..ac8dcd326b0 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/ReferenceUriSchemesSupported.java @@ -32,13 +32,13 @@ import javax.print.attribute.Attribute; * an enumeration, that indicates a "URI scheme," such as "http:" or "ftp:", * that a printer can use to retrieve print data stored at a URI location. * If a printer supports doc flavors with a print data representation class of - * "java.net.URL", the printer uses instances of class + * {@code "java.net.URL"}, the printer uses instances of class * ReferenceUriSchemesSupported to advertise the URI schemes it can accept. * The acceptable URI schemes are included as service attributes in the * lookup service; this lets clients search the * for printers that can get print data using a certain URI scheme. The * acceptable URI schemes can also be queried using the capability methods in - * interface PrintService. However, + * interface {@code PrintService}. However, * ReferenceUriSchemesSupported attributes are used solely for determining * acceptable URI schemes, they are never included in a doc's, * print request's, print job's, or print service's attribute set. @@ -52,8 +52,8 @@ import javax.print.attribute.Attribute; * can define them in a subclass of class ReferenceUriSchemesSupported. *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -171,7 +171,7 @@ public class ReferenceUriSchemesSupported *

      * For class ReferenceUriSchemesSupported and any vendor-defined * subclasses, the category name is - * "reference-uri-schemes-supported". + * {@code "reference-uri-schemes-supported"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java index 62bd3e03763..c0284c8a041 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/RequestingUserName.java @@ -47,7 +47,7 @@ import javax.print.attribute.PrintRequestAttribute; *

      * IPP Compatibility: The string value gives the IPP name value. The * locale gives the IPP natural language. The category name returned by - * getName() gives the IPP attribute name. + * {@code getName()} gives the IPP attribute name. * * @author Alan Kaminsky */ @@ -63,10 +63,10 @@ public final class RequestingUserName extends TextSyntax * @param userName User name. * @param locale Natural language of the text string. null * is interpreted to mean the default locale as returned - * by Locale.getDefault() + * by {@code Locale.getDefault()} * * @exception NullPointerException - * (unchecked exception) Thrown if userName is null. + * (unchecked exception) Thrown if {@code userName} is null. */ public RequestingUserName(String userName, Locale locale) { super (userName, locale); @@ -78,20 +78,20 @@ public final class RequestingUserName extends TextSyntax * conditions must be true: *

        *
      1. - * object is not null. + * {@code object} is not null. *
      2. - * object is an instance of class RequestingUserName. + * {@code object} is an instance of class RequestingUserName. *
      3. * This requesting user name attribute's underlying string and - * object's underlying string are equal. + * {@code object}'s underlying string are equal. *
      4. * This requesting user name attribute's locale and - * object's locale are equal. + * {@code object}'s locale are equal. *
      * * @param object Object to compare to. * - * @return True if object is equivalent to this requesting + * @return True if {@code object} is equivalent to this requesting * user name attribute, false otherwise. */ public boolean equals(Object object) { @@ -118,7 +118,7 @@ public final class RequestingUserName extends TextSyntax * instance. *

      * For class RequestingUserName, the - * category name is "requesting-user-name". + * category name is {@code "requesting-user-name"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java index 36df6b6f5d0..d9db96cf299 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Severity.java @@ -50,13 +50,13 @@ import javax.print.attribute.Attribute; * {@link PrinterState PrinterState} also changed. *

      * IPP Compatibility: - * Severity.toString() returns either "error", "warning", or + * {@code Severity.toString()} returns either "error", "warning", or * "report". The string values returned by * each individual {@link PrinterStateReason} and - * associated {@link Severity} object's toString() - * methods, concatenated together with a hyphen ("-") in + * associated {@link Severity} object's {@code toString()} + * methods, concatenated together with a hyphen ({@code "-"}) in * between, gives the IPP keyword value for a {@link PrinterStateReasons}. - * The category name returned by getName() gives the IPP + * The category name returned by {@code getName()} gives the IPP * attribute name. * * @author Alan Kaminsky @@ -146,7 +146,7 @@ public final class Severity extends EnumSyntax implements Attribute { * Get the name of the category of which this attribute value is an * instance. *

      - * For class Severit, the category name is "severity". + * For class Severit, the category name is {@code "severity"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java index 1d264a5964e..b497791f2a1 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/SheetCollate.java @@ -222,7 +222,7 @@ public final class SheetCollate extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class SheetCollate, the category name is "sheet-collate". + * For class SheetCollate, the category name is {@code "sheet-collate"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java index 664f07d03dc..a9c13c11282 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java +++ b/jdk/src/java.desktop/share/classes/javax/print/attribute/standard/Sides.java @@ -110,8 +110,8 @@ import javax.print.attribute.PrintJobAttribute; * *

      * IPP Compatibility: The category name returned by - * getName() is the IPP attribute name. The enumeration's - * integer value is the IPP enum value. The toString() method + * {@code getName()} is the IPP attribute name. The enumeration's + * integer value is the IPP enum value. The {@code toString()} method * returns the IPP string representation of the attribute value. * * @author Alan Kaminsky @@ -210,7 +210,7 @@ public final class Sides extends EnumSyntax * Get the name of the category of which this attribute value is an * instance. *

      - * For class Sides, the category name is "sides". + * For class Sides, the category name is {@code "sides"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java index 1f489026149..0732fb37231 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintEvent.java @@ -37,8 +37,8 @@ public class PrintEvent extends java.util.EventObject { /** * Constructs a PrintEvent object. * @param source is the source of the event - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintEvent (Object source) { super(source); diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java index d23e4c6a226..efec2a761ca 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java @@ -45,8 +45,8 @@ public class PrintJobAttributeEvent extends PrintEvent { * Constructs a PrintJobAttributeEvent object. * @param source the print job generating this event * @param attributes the attribute changes being reported - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintJobAttributeEvent (DocPrintJob source, PrintJobAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java index 64e6b6fa894..0f21e659a9b 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobAttributeListener.java @@ -38,7 +38,7 @@ public interface PrintJobAttributeListener { * One example of an occurrence triggering this event is if the * {@link javax.print.attribute.standard.JobState JobState} * attribute changed from - * PROCESSING to PROCESSING_STOPPED. + * {@code PROCESSING} to {@code PROCESSING_STOPPED}. * @param pjae the event. */ public void attributeUpdate(PrintJobAttributeEvent pjae) ; diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java index dca9b66640e..77424a07a91 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintJobEvent.java @@ -29,7 +29,7 @@ import javax.print.DocPrintJob; /** * - * Class PrintJobEvent encapsulates common events a print job + * Class {@code PrintJobEvent} encapsulates common events a print job * reports to let a listener know of progress in the processing of the * {@link DocPrintJob}. * @@ -86,12 +86,12 @@ public class PrintJobEvent extends PrintEvent { public static final int DATA_TRANSFER_COMPLETE = 106; /** - * Constructs a PrintJobEvent object. + * Constructs a {@code PrintJobEvent} object. * - * @param source a DocPrintJob object + * @param source a {@code DocPrintJob} object * @param reason an int specifying the reason. - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintJobEvent( DocPrintJob source, int reason) { @@ -109,12 +109,12 @@ public class PrintJobEvent extends PrintEvent { } /** - * Determines the DocPrintJob to which this print job + * Determines the {@code DocPrintJob} to which this print job * event pertains. * - * @return the DocPrintJob object that represents the + * @return the {@code DocPrintJob} object that represents the * print job that reports the events encapsulated by this - * PrintJobEvent. + * {@code PrintJobEvent}. * */ public DocPrintJob getPrintJob() { diff --git a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java index 9f1b6721854..06998afd354 100644 --- a/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java +++ b/jdk/src/java.desktop/share/classes/javax/print/event/PrintServiceAttributeEvent.java @@ -47,8 +47,8 @@ public class PrintServiceAttributeEvent extends PrintEvent { * * @param source the print job generating this event * @param attributes the attribute changes being reported - * @throws IllegalArgumentException if source is - * null. + * @throws IllegalArgumentException if {@code source} is + * {@code null}. */ public PrintServiceAttributeEvent(PrintService source, PrintServiceAttributeSet attributes) { diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java index e9e770c0e0d..716b9902331 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -321,31 +321,48 @@ public class AudioInputStream extends InputStream { */ @Override public long skip(long n) throws IOException { + if (n <= 0) { + return 0; + } // make sure not to skip fractional frames - if( (n%frameSize) != 0 ) { - n -= (n%frameSize); + final long reminder = n % frameSize; + if (reminder != 0) { + n -= reminder; } - if( frameLength != AudioSystem.NOT_SPECIFIED ) { + if (frameLength != AudioSystem.NOT_SPECIFIED) { // don't skip more than our set length in frames. - if( (n/frameSize) > (frameLength-framePos) ) { - n = (frameLength-framePos) * frameSize; + if ((n / frameSize) > (frameLength - framePos)) { + n = (frameLength - framePos) * frameSize; } } - long temp = stream.skip(n); + long remaining = n; + while (remaining > 0) { + // Some input streams like FileInputStream can return more bytes, + // when EOF is reached. + long ret = Math.min(stream.skip(remaining), remaining); + if (ret == 0) { + // EOF or not? we need to check. + if (stream.read() == -1) { + break; + } + ret = 1; + } else if (ret < 0) { + // the skip should not return negative value, but check it also + break; + } + remaining -= ret; + } + final long temp = n - remaining; // if no error, update our position. - if( temp%frameSize != 0 ) { - + if (temp % frameSize != 0) { // Throw an IOException if we've skipped a fractional number of frames throw new IOException("Could not skip an integer number of frames."); } - if( temp >= 0 ) { - framePos += temp/frameSize; - } + framePos += temp/frameSize; return temp; - } /** diff --git a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java index 2a6d98dd158..e567b392102 100644 --- a/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java +++ b/jdk/src/java.desktop/share/classes/javax/sound/sampled/AudioSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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,12 +25,14 @@ package javax.sound.sampled; +import java.io.EOFException; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URL; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Objects; @@ -688,8 +690,11 @@ public class AudioSystem { } } } - AudioFormat.Encoding encs2[] = encodings.toArray(new AudioFormat.Encoding[0]); - return encs2; + if (!encodings.contains(sourceEncoding)) { + encodings.addElement(sourceEncoding); + } + + return encodings.toArray(new AudioFormat.Encoding[encodings.size()]); } // $$fb 2002-04-12: fix for 4662082: behavior of AudioSystem.getTargetEncodings() methods doesn't match the spec @@ -710,30 +715,18 @@ public class AudioSystem { Objects.requireNonNull(sourceFormat); List codecs = getFormatConversionProviders(); - Vector encodings = new Vector<>(); - - int size = 0; - int index = 0; - AudioFormat.Encoding encs[] = null; + List encs = new ArrayList<>(); // gather from all the codecs - - for(int i=0; i codecs = getFormatConversionProviders(); @@ -781,6 +777,9 @@ public class AudioSystem { AudioInputStream sourceStream) { Objects.requireNonNull(targetEncoding); Objects.requireNonNull(sourceStream); + if (sourceStream.getFormat().getEncoding().equals(targetEncoding)) { + return sourceStream; + } List codecs = getFormatConversionProviders(); @@ -811,31 +810,27 @@ public class AudioSystem { Objects.requireNonNull(sourceFormat); List codecs = getFormatConversionProviders(); - Vector formats = new Vector<>(); - - int size = 0; - int index = 0; - AudioFormat fmts[] = null; + List formats = new ArrayList<>(); + boolean matchFound = false; // gather from all the codecs - - for(int i=0; i codecs = getFormatConversionProviders(); @@ -919,28 +917,17 @@ public class AudioSystem { * @see InputStream#markSupported * @see InputStream#mark */ - public static AudioFileFormat getAudioFileFormat(InputStream stream) + public static AudioFileFormat getAudioFileFormat(final InputStream stream) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(stream); - List providers = getAudioFileReaders(); - AudioFileFormat format = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - format = reader.getAudioFileFormat( stream ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioFileFormat(stream); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( format==null ) { - throw new UnsupportedAudioFileException("file is not a supported file type"); - } else { - return format; - } + throw new UnsupportedAudioFileException("Stream of unsupported format"); } /** @@ -956,28 +943,17 @@ public class AudioSystem { * @throws IOException if an input/output exception occurs * @throws NullPointerException if {@code url} is {@code null} */ - public static AudioFileFormat getAudioFileFormat(URL url) + public static AudioFileFormat getAudioFileFormat(final URL url) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(url); - List providers = getAudioFileReaders(); - AudioFileFormat format = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - format = reader.getAudioFileFormat( url ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioFileFormat(url); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( format==null ) { - throw new UnsupportedAudioFileException("file is not a supported file type"); - } else { - return format; - } + throw new UnsupportedAudioFileException("URL of unsupported format"); } /** @@ -993,28 +969,17 @@ public class AudioSystem { * @throws IOException if an I/O exception occurs * @throws NullPointerException if {@code file} is {@code null} */ - public static AudioFileFormat getAudioFileFormat(File file) + public static AudioFileFormat getAudioFileFormat(final File file) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(file); - List providers = getAudioFileReaders(); - AudioFileFormat format = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - format = reader.getAudioFileFormat( file ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioFileFormat(file); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( format==null ) { - throw new UnsupportedAudioFileException("file is not a supported file type"); - } else { - return format; - } + throw new UnsupportedAudioFileException("File of unsupported format"); } /** @@ -1038,28 +1003,17 @@ public class AudioSystem { * @see InputStream#markSupported * @see InputStream#mark */ - public static AudioInputStream getAudioInputStream(InputStream stream) + public static AudioInputStream getAudioInputStream(final InputStream stream) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(stream); - List providers = getAudioFileReaders(); - AudioInputStream audioStream = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - audioStream = reader.getAudioInputStream( stream ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioInputStream(stream); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( audioStream==null ) { - throw new UnsupportedAudioFileException("could not get audio input stream from input stream"); - } else { - return audioStream; - } + throw new UnsupportedAudioFileException("Stream of unsupported format"); } /** @@ -1075,28 +1029,17 @@ public class AudioSystem { * @throws IOException if an I/O exception occurs * @throws NullPointerException if {@code url} is {@code null} */ - public static AudioInputStream getAudioInputStream(URL url) + public static AudioInputStream getAudioInputStream(final URL url) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(url); - List providers = getAudioFileReaders(); - AudioInputStream audioStream = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - audioStream = reader.getAudioInputStream( url ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioInputStream(url); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( audioStream==null ) { - throw new UnsupportedAudioFileException("could not get audio input stream from input URL"); - } else { - return audioStream; - } + throw new UnsupportedAudioFileException("URL of unsupported format"); } /** @@ -1112,28 +1055,17 @@ public class AudioSystem { * @throws IOException if an I/O exception occurs * @throws NullPointerException if {@code file} is {@code null} */ - public static AudioInputStream getAudioInputStream(File file) + public static AudioInputStream getAudioInputStream(final File file) throws UnsupportedAudioFileException, IOException { Objects.requireNonNull(file); - List providers = getAudioFileReaders(); - AudioInputStream audioStream = null; - - for(int i = 0; i < providers.size(); i++ ) { - AudioFileReader reader = providers.get(i); + for (final AudioFileReader reader : getAudioFileReaders()) { try { - audioStream = reader.getAudioInputStream( file ); // throws IOException - break; - } catch (UnsupportedAudioFileException e) { - continue; + return reader.getAudioInputStream(file); + } catch (final UnsupportedAudioFileException ignored) { } } - - if( audioStream==null ) { - throw new UnsupportedAudioFileException("could not get audio input stream from input file"); - } else { - return audioStream; - } + throw new UnsupportedAudioFileException("File of unsupported format"); } /** @@ -1255,32 +1187,24 @@ public class AudioSystem { * @see #isFileTypeSupported * @see #getAudioFileTypes */ - public static int write(AudioInputStream stream, AudioFileFormat.Type fileType, - OutputStream out) throws IOException { + public static int write(final AudioInputStream stream, + final AudioFileFormat.Type fileType, + final OutputStream out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); Objects.requireNonNull(out); - List providers = getAudioFileWriters(); - int bytesWritten = 0; - boolean flag = false; - - for(int i=0; i < providers.size(); i++) { - AudioFileWriter writer = providers.get(i); + for (final AudioFileWriter writer : getAudioFileWriters()) { try { - bytesWritten = writer.write( stream, fileType, out ); // throws IOException - flag = true; - break; - } catch (IllegalArgumentException e) { - // thrown if this provider cannot write the sequence, try the next - continue; + return writer.write(stream, fileType, out); + } catch (final IllegalArgumentException ignored) { + // thrown if this provider cannot write the stream, try next } } - if(!flag) { - throw new IllegalArgumentException("could not write audio file: file type not supported: " + fileType); - } else { - return bytesWritten; - } + // "File type " + type + " not supported." + throw new IllegalArgumentException( + "could not write audio file: file type not supported: " + + fileType); } /** @@ -1300,32 +1224,23 @@ public class AudioSystem { * @see #isFileTypeSupported * @see #getAudioFileTypes */ - public static int write(AudioInputStream stream, AudioFileFormat.Type fileType, - File out) throws IOException { + public static int write(final AudioInputStream stream, + final AudioFileFormat.Type fileType, + final File out) throws IOException { Objects.requireNonNull(stream); Objects.requireNonNull(fileType); Objects.requireNonNull(out); - List providers = getAudioFileWriters(); - int bytesWritten = 0; - boolean flag = false; - - for(int i=0; i < providers.size(); i++) { - AudioFileWriter writer = providers.get(i); + for (final AudioFileWriter writer : getAudioFileWriters()) { try { - bytesWritten = writer.write( stream, fileType, out ); // throws IOException - flag = true; - break; - } catch (IllegalArgumentException e) { - // thrown if this provider cannot write the sequence, try the next - continue; + return writer.write(stream, fileType, out); + } catch (final IllegalArgumentException ignored) { + // thrown if this provider cannot write the stream, try next } } - if (!flag) { - throw new IllegalArgumentException("could not write audio file: file type not supported: " + fileType); - } else { - return bytesWritten; - } + throw new IllegalArgumentException( + "could not write audio file: file type not supported: " + + fileType); } // METHODS FOR INTERNAL IMPLEMENTATION USE diff --git a/jdk/src/java.desktop/share/classes/javax/swing/Action.java b/jdk/src/java.desktop/share/classes/javax/swing/Action.java index b1ebbec40a8..8a7ae6ea1db 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/Action.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/Action.java @@ -356,24 +356,41 @@ public interface Action extends ActionListener { public void putValue(String key, Object value); /** - * Sets the enabled state of the Action. When enabled, + * Sets the enabled state of the {@code Action}. When enabled, * any component associated with this object is active and - * able to fire this object's actionPerformed method. - * If the value has changed, a PropertyChangeEvent is sent + * able to fire this object's {@code actionPerformed} method. + * If the value has changed, a {@code PropertyChangeEvent} is sent * to listeners. * - * @param b true to enable this Action, false to disable it + * @param b true to enable this {@code Action}, false to disable it + * @see #accept */ public void setEnabled(boolean b); /** - * Returns the enabled state of the Action. When enabled, + * Returns the enabled state of the {@code Action}. When enabled, * any component associated with this object is active and - * able to fire this object's actionPerformed method. + * able to fire this object's {@code actionPerformed} method. * - * @return true if this Action is enabled + * @return true if this {@code Action} is enabled + * @see #accept */ public boolean isEnabled(); + /** + * Determines whether the action should be performed with the specified + * sender object. The {@code sender} can be {@code null}. + * The method must return false if the action is disabled. + *

      + * @param sender the object to check, can be null + * @return {@code true} if the action should be performed with the sender + * object, must be false if the action is disabled. + * @see isEnabled + * @see setEnabled + */ + default boolean accept(Object sender) { + return isEnabled(); + } + /** * Adds a PropertyChange listener. Containers and attached * components use these methods to register interest in this diff --git a/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java b/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java index e28f446a5f2..18f30579f4e 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java @@ -197,17 +197,17 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab if (!f.isMaximum()) { f.setNormalBounds(f.getBounds()); } - d.setComponentOrderCheckingEnabled(false); - c.remove(f); - c.add(desktopIcon); - d.setComponentOrderCheckingEnabled(true); - c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight()); if (findNext) { if (d.selectFrame(true) == null) { // The icon is the last frame. f.restoreSubcomponentFocus(); } } + d.setComponentOrderCheckingEnabled(false); + c.remove(f); + c.add(desktopIcon); + d.setComponentOrderCheckingEnabled(true); + c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight()); } /** diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java index 99a2fe8ab6a..e5d53e1cda3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JDesktopPane.java @@ -480,6 +480,7 @@ public class JDesktopPane extends JLayeredPane implements Accessible * @since 1.6 */ protected void addImpl(Component comp, Object constraints, int index) { + checkComponentAttributes(comp); super.addImpl(comp, constraints, index); if (componentOrderCheckingEnabled) { if (comp instanceof JInternalFrame || @@ -489,6 +490,12 @@ public class JDesktopPane extends JLayeredPane implements Accessible } } + private void checkComponentAttributes(Component comp) { + if (comp instanceof JInternalFrame && ((JInternalFrame) comp).isIcon()) { + ((JInternalFrame) comp).putClientProperty("wasIconOnce", Boolean.FALSE); + } + } + /** * {@inheritDoc} * @since 1.6 diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java index de917a34e00..184ca2c2d0b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/JTabbedPane.java @@ -2156,15 +2156,14 @@ public class JTabbedPane extends JComponent AccessibleStateSet states; states = parent.getAccessibleContext().getAccessibleStateSet(); states.add(AccessibleState.SELECTABLE); - int i = parent.indexOfTabComponent(tabComponent); - if (i == parent.getSelectedIndex()) { + if (getPageIndex() == parent.getSelectedIndex()) { states.add(AccessibleState.SELECTED); } return states; } public int getAccessibleIndexInParent() { - return parent.indexOfTabComponent(tabComponent); + return getPageIndex(); } public int getAccessibleChildrenCount() { @@ -2272,8 +2271,7 @@ public class JTabbedPane extends JComponent } public Rectangle getBounds() { - return parent.getUI(). - getTabBounds(parent, parent.indexOfTabComponent(tabComponent)); + return parent.getUI().getTabBounds(parent, getPageIndex()); } public void setBounds(Rectangle r) { @@ -2343,7 +2341,33 @@ public class JTabbedPane extends JComponent } private String getTitle() { - return getTitleAt(parent.indexOfComponent(component)); + return getTitleAt(getPageIndex()); + } + + /* + * getPageIndex() has three valid scenarios: + * - null component and null tabComponent: use indexOfcomponent + * - non-null component: use indexOfComponent + * - null component and non-null tabComponent: use indexOfTabComponent + * + * Note: It's valid to have have a titled tab with a null component, e.g. + * myPane.add("my title", null); + * but it's only useful to have one of those because indexOfComponent(null) + * will find the first one. + * + * Note: indexofTab(title) is not useful because there are cases, due to + * subclassing, where Page.title is not set and title is managed in a subclass + * and fetched with an overridden JTabbedPane.getTitleAt(index). + */ + private int getPageIndex() { + int index; + if (component != null || (component == null && tabComponent == null)) { + index = parent.indexOfComponent(component); + } else { + // component is null, tabComponent is non-null + index = parent.indexOfTabComponent(tabComponent); + } + return index; } } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java index 5c34dffb012..6a48eb423a3 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/SwingUtilities.java @@ -1704,9 +1704,9 @@ public class SwingUtilities implements SwingConstants } /** - * Invokes actionPerformed on action if - * action is enabled (and non-{@code null}). The command for the - * ActionEvent is determined by: + * Invokes {@code actionPerformed} on {@code action} if {@code action} + * is non-{@code null} and accepts the sender object. + * The command for the ActionEvent is determined by: *

        *
      1. If the action was registered via * registerKeyboardAction, then the command string @@ -1725,23 +1725,18 @@ public class SwingUtilities implements SwingConstants * @param modifiers action modifiers * @return {@code true} if {@code action} is non-{@code null} and * actionPerformed is invoked on it. + * @see javax.swing.Action#accept * * @since 1.3 */ public static boolean notifyAction(Action action, KeyStroke ks, KeyEvent event, Object sender, int modifiers) { - if (action == null) { - return false; - } - if (action instanceof UIAction) { - if (!((UIAction)action).isEnabled(sender)) { - return false; - } - } - else if (!action.isEnabled()) { + + if (action == null || !action.accept(sender)) { return false; } + Object commandO; boolean stayNull; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java b/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java index 5201a0c26a5..70fe30a37be 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/TransferHandler.java @@ -1695,13 +1695,10 @@ public class TransferHandler implements Serializable { super(name); } - public boolean isEnabled(Object sender) { - if (sender instanceof JComponent - && ((JComponent)sender).getTransferHandler() == null) { - return false; - } - - return true; + @Override + public boolean accept(Object sender) { + return !(sender instanceof JComponent + && ((JComponent)sender).getTransferHandler() == null); } private static final JavaSecurityAccess javaSecurityAccess = diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java index 3278d33e4a9..1fda40ee5df 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java @@ -319,13 +319,10 @@ public class BasicButtonListener implements MouseListener, MouseMotionListener, } } - public boolean isEnabled(Object sender) { - if(sender != null && (sender instanceof AbstractButton) && - !((AbstractButton)sender).getModel().isEnabled()) { - return false; - } else { - return true; - } + @Override + public boolean accept(Object sender) { + return !((sender instanceof AbstractButton) && + !((AbstractButton)sender).getModel().isEnabled()); } } -} +} \ No newline at end of file diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index 5a3f67da230..e08c8a3045f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -1719,7 +1719,8 @@ public class BasicComboBoxUI extends ComboBoxUI { return comboBox.getSelectedIndex(); } - public boolean isEnabled(Object c) { + @Override + public boolean accept(Object c) { if (getName() == HIDE) { return (c != null && ((JComboBox)c).isPopupVisible()); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java index c8a4d9d0a7a..e784d2d4b2a 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java @@ -646,7 +646,8 @@ public class BasicDesktopPaneUI extends DesktopPaneUI { } } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { if (sender instanceof JDesktopPane) { JDesktopPane dp = (JDesktopPane)sender; String action = getName(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java index 8f534ef786a..bcae2e3f8e8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java @@ -200,7 +200,8 @@ public class BasicInternalFrameUI extends InternalFrameUI } } - public boolean isEnabled(Object sender){ + @Override + public boolean accept(Object sender){ if (sender instanceof JInternalFrame) { JInternalFrame iFrame = (JInternalFrame)sender; if (iFrame.getUI() instanceof BasicInternalFrameUI) { @@ -1709,6 +1710,12 @@ public class BasicInternalFrameUI extends InternalFrameUI } else { parentBounds = null; } + if ((frame.getParent() != null) && frame.isIcon()) { + Boolean value = (Boolean) frame.getClientProperty("wasIconOnce"); + if (Boolean.FALSE.equals(value)) { + iconifyFrame(frame); + } + } if ((frame.getParent() != null) && !componentListenerAdded) { f.getParent().addComponentListener(componentListener); componentListenerAdded = true; diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java index ae8827a4f82..39585e86db8 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java @@ -2060,7 +2060,8 @@ public class BasicListUI extends ListUI } } - public boolean isEnabled(Object c) { + @Override + public boolean accept(Object c) { Object name = getName(); if (name == SELECT_PREVIOUS_COLUMN_CHANGE_LEAD || name == SELECT_NEXT_COLUMN_CHANGE_LEAD || diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java index 7231ae2a570..98afcc95679 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java @@ -312,7 +312,8 @@ public class BasicMenuUI extends BasicMenuItemUI } } - public boolean isEnabled(Object c) { + @Override + public boolean accept(Object c) { if (c instanceof JMenu) { return ((JMenu)c).isEnabled(); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java index 300e46a2e7b..714a06396c6 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicRootPaneUI.java @@ -256,7 +256,8 @@ public class BasicRootPaneUI extends RootPaneUI implements } } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { String key = getName(); if(key == POST_POPUP) { MenuElement[] elems = MenuSelectionManager @@ -278,7 +279,7 @@ public class BasicRootPaneUI extends RootPaneUI implements return false; } - if (sender != null && sender instanceof JRootPane) { + if (sender instanceof JRootPane) { JButton owner = ((JRootPane)sender).getDefaultButton(); return (owner != null && owner.getModel().isEnabled()); } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java index 2ec7e11ef71..a02d25f293b 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java @@ -855,7 +855,8 @@ public class BasicTableHeaderUI extends TableHeaderUI { super(name); } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { if (sender instanceof JTableHeader) { JTableHeader th = (JTableHeader)sender; TableColumnModel cm = th.getColumnModel(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java index 73fd9a51340..e6a3d0eb9b5 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTableUI.java @@ -676,7 +676,8 @@ public class BasicTableUI extends TableUI } } - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { String key = getName(); if (sender instanceof JTable && diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java index 7216dfe4a4b..b43423dbc02 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java @@ -4416,7 +4416,8 @@ public class BasicTreeUI extends TreeUI super(key); } - public boolean isEnabled(Object o) { + @Override + public boolean accept(Object o) { if (o instanceof JTree) { if (getName() == CANCEL_EDITING) { return ((JTree)o).isEditing(); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java index 6259171317b..b22941c8f6f 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java @@ -351,12 +351,16 @@ public class SynthDesktopPaneUI extends BasicDesktopPaneUI implements Container c = f.getParent(); JDesktopPane d = f.getDesktopPane(); boolean findNext = f.isSelected(); - - if (c == null) { + if (c == null || d == null) { return; } - desktopIcon = f.getDesktopIcon(); + if (!wasIcon(f)) { + Rectangle r = getBoundsForIconOf(f); + desktopIcon.setBounds(r.x, r.y, r.width, r.height); + desktopIcon.revalidate(); + setWasIcon(f, Boolean.TRUE); + } if (!f.isMaximum()) { f.setNormalBounds(f.getBounds()); diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java index bf2b9298973..a36117cda20 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java @@ -471,7 +471,7 @@ public class SynthToolBarUI extends BasicToolBarUI // be distributed among the "glue", if any int extraSpacePerGlue = 0; if (glueCount > 0) { - int minWidth = minimumLayoutSize(parent).width; + int minWidth = preferredLayoutSize(parent).width; extraSpacePerGlue = (tb.getWidth() - minWidth) / glueCount; if (extraSpacePerGlue < 0) extraSpacePerGlue = 0; } diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java index 0ca0fecb5a8..1625964b562 100644 --- a/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java +++ b/jdk/src/java.desktop/share/classes/javax/swing/text/AbstractWriter.java @@ -441,7 +441,7 @@ public abstract class AbstractWriter { --offsetIndent; } else { - indentLevel--; + indentLevel = indentLevel > 0 ? indentLevel-- : 0; } } diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java index efb0ea50077..a778ca6c769 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletClassLoader.java @@ -358,7 +358,7 @@ public class AppletClassLoader extends URLClassLoader { * #getResource(String)}.

        * * @param name the resource name - * @return an input stream for reading the resource, or null + * @return an input stream for reading the resource, or {@code null} * if the resource could not be found * @since 1.1 */ @@ -418,7 +418,7 @@ public class AppletClassLoader extends URLClassLoader { * #getResource(String)}.

        * * @param name the resource name - * @return an input stream for reading the resource, or null + * @return an input stream for reading the resource, or {@code null} * if the resource could not be found * @since 1.1 */ diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java index 0eba476fe82..192c0c84f2e 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletSecurity.java @@ -260,17 +260,17 @@ class AppletSecurity extends AWTSecurityManager { /** - * Throws a SecurityException if the + * Throws a {@code SecurityException} if the * calling thread is not allowed to access the package specified by * the argument. *

        - * This method is used by the loadClass method of class + * This method is used by the {@code loadClass} method of class * loaders. *

        - * The checkPackageAccess method for class - * SecurityManager calls - * checkPermission with the - * RuntimePermission("accessClassInPackage."+ pkgname) + * The {@code checkPackageAccess} method for class + * {@code SecurityManager} calls + * {@code checkPermission} with the + * {@code RuntimePermission("accessClassInPackage."+ pkgname)} * permission. * * @param pkgname the package name. @@ -302,8 +302,8 @@ class AppletSecurity extends AWTSecurityManager { /** * Tests if a client can get access to the AWT event queue. *

        - * This method calls checkPermission with the - * AWTPermission("accessEventQueue") permission. + * This method calls {@code checkPermission} with the + * {@code AWTPermission("accessEventQueue")} permission. * * @since 1.1 * @exception SecurityException if the caller does not have diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java index fab6685c1d6..932b517cc0a 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletThreadGroup.java @@ -51,7 +51,7 @@ public class AppletThreadGroup extends ThreadGroup { * @param parent the parent thread group. * @param name the name of the new thread group. * @exception NullPointerException if the thread group argument is - * null. + * {@code null}. * @exception SecurityException if the current thread cannot create a * thread in the specified thread group. * @see java.lang.SecurityException diff --git a/jdk/src/java.desktop/share/classes/sun/applet/Main.java b/jdk/src/java.desktop/share/classes/sun/applet/Main.java index d29ed5ffd23..681fb81c6db 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/Main.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,6 +107,7 @@ public class Main { private int run(String [] args) { // DECODE ARGS try { + System.out.println(lookup("deprecated")); if (args.length == 0) { usage(); return 0; @@ -229,7 +230,7 @@ public class Main { * * @param url a string which represents either a relative or absolute URL. * @return a URL when the passed in string can be interpreted according - * to the RFC, null otherwise. + * to the RFC, {@code null} otherwise. * @exception ParseException * Thrown when we are unable to construct a proper URL from the * passed in string. @@ -270,8 +271,8 @@ public class Main { * Invoke the debugger with the arguments passed in to appletviewer. * * @param args The arguments passed into the debugger. - * @return 0 if the debugger is invoked successfully, - * 1 otherwise. + * @return {@code 0} if the debugger is invoked successfully, + * {@code 1} otherwise. */ private int invokeDebugger(String [] args) { // CONSTRUCT THE COMMAND LINE diff --git a/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java b/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java index af1f3d5a609..f05729b972e 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/resources/MsgAppletViewer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ public class MsgAppletViewer extends ListResourceBundle { {"appletviewer.parse.warning.embed.requiresheight", "Warning: tag requires height attribute."}, {"appletviewer.parse.warning.embed.requireswidth", "Warning: tag requires width attribute."}, {"appletviewer.parse.warning.appnotLongersupported", "Warning: tag no longer supported, use instead:"}, + {"appletviewer.deprecated", "AppletViewer is deprecated."}, {"appletviewer.usage", "Usage: appletviewer url(s)\n\nwhere include:\n -debug Start the applet viewer in the Java debugger\n -encoding Specify character encoding used by HTML files\n -J Pass argument to the java interpreter\n\nThe -J option is non-standard and subject to change without notice."}, {"appletviewer.main.err.unsupportedopt", "Unsupported option: {0}"}, {"appletviewer.main.err.unrecognizedarg", "Unrecognized argument: {0}"}, diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java b/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java index a025ae85e5f..7d67cd6ae47 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java @@ -85,7 +85,7 @@ public final class AWTAccessor { /* * * Gets the bounds of this component in the form of a - * Rectangle object. The bounds specify this + * {@code Rectangle} object. The bounds specify this * component's width, height, and location relative to * its parent. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java b/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java index 95a1fb9ddb3..1ecef9162ca 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AWTAutoShutdown.java @@ -41,20 +41,20 @@ import sun.util.logging.PlatformLogger; * This class is to let AWT shutdown automatically when a user is done * with AWT. It tracks AWT state using the following parameters: *
          - *
        • peerMap - the map between the existing peer objects + *
        • {@code peerMap} - the map between the existing peer objects * and their associated targets - *
        • toolkitThreadBusy - whether the toolkit thread + *
        • {@code toolkitThreadBusy} - whether the toolkit thread * is waiting for a new native event to appear in its queue * or is dispatching an event - *
        • busyThreadSet - a set of all the event dispatch + *
        • {@code busyThreadSet} - a set of all the event dispatch * threads that are busy at this moment, i.e. those that are not * waiting for a new event to appear in their event queue. *

        * AWT is considered to be in ready-to-shutdown state when - * peerMap is empty and toolkitThreadBusy - * is false and busyThreadSet is empty. + * {@code peerMap} is empty and {@code toolkitThreadBusy} + * is false and {@code busyThreadSet} is empty. * The internal AWTAutoShutdown logic secures that the single non-daemon - * thread (blockerThread) is running when AWT is not in + * thread ({@code blockerThread}) is running when AWT is not in * ready-to-shutdown state. This blocker thread is to prevent AWT from * exiting since the toolkit thread is now daemon and all the event * dispatch threads are started only when needed. Once it is detected @@ -229,8 +229,8 @@ public final class AWTAutoShutdown implements Runnable { /** * Determine whether AWT is currently in ready-to-shutdown state. * AWT is considered to be in ready-to-shutdown state if - * peerMap is empty and toolkitThreadBusy - * is false and busyThreadSet is empty. + * {@code peerMap} is empty and {@code toolkitThreadBusy} + * is false and {@code busyThreadSet} is empty. * * @return true if AWT is in ready-to-shutdown state. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java index 9023251171d..b4bc32996b2 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/AppContext.java @@ -71,7 +71,7 @@ import java.util.function.Supplier; * * For example, here we have a Foo service, with its pre-AppContext * code:

        - *

        + * 
        {@code
          *    public class Foo {
          *        private static Foo defaultFoo = new Foo();
          *
        @@ -80,7 +80,8 @@ import java.util.function.Supplier;
          *        }
          *
          *    ... Foo service methods
        - *    }

        + * } + * }

        * * The problem with the above is that the Foo service is global in scope, * so that applets and other untrusted code can execute methods on the @@ -90,7 +91,7 @@ import java.util.function.Supplier; * executes it.

        * * Here's the Foo class written to use the AppContext:

        - *

        + * 
        {@code
          *    public class Foo {
          *        public static Foo getDefaultFoo() {
          *            Foo foo = (Foo)AppContext.getAppContext().get(Foo.class);
        @@ -102,7 +103,8 @@ import java.util.function.Supplier;
          *        }
          *
          *    ... Foo service methods
        - *    }

        + * } + * }

        * * Since a separate AppContext can exist for each ThreadGroup, trusted * and untrusted code have access to different Foo instances. This allows @@ -159,7 +161,7 @@ public final class AppContext { Collections.synchronizedMap(new IdentityHashMap()); /** - * Returns a set containing all AppContexts. + * Returns a set containing all {@code AppContext}s. */ public static Set getAppContexts() { synchronized (threadGroup2appContext) { @@ -187,8 +189,8 @@ public final class AppContext { private final ThreadGroup threadGroup; /** - * If any PropertyChangeListeners have been registered, - * the changeSupport field describes them. + * If any {@code PropertyChangeListeners} have been registered, + * the {@code changeSupport} field describes them. * * @see #addPropertyChangeListener * @see #removePropertyChangeListener @@ -633,7 +635,7 @@ public final class AppContext { * * @param key a key in the AppContext. * @return the value to which the key is mapped in this AppContext; - * null if the key is not mapped to any value. + * {@code null} if the key is not mapped to any value. * @see #put(Object, Object) * @since 1.2 */ @@ -670,19 +672,19 @@ public final class AppContext { } /** - * Maps the specified key to the specified - * value in this AppContext. Neither the key nor the - * value can be null. + * Maps the specified {@code key} to the specified + * {@code value} in this AppContext. Neither the key nor the + * value can be {@code null}. *

        - * The value can be retrieved by calling the get method + * The value can be retrieved by calling the {@code get} method * with a key that is equal to the original key. * * @param key the AppContext key. * @param value the value. * @return the previous value of the specified key in this - * AppContext, or null if it did not have one. + * AppContext, or {@code null} if it did not have one. * @exception NullPointerException if the key or value is - * null. + * {@code null}. * @see #get(Object) * @since 1.2 */ @@ -702,7 +704,7 @@ public final class AppContext { * * @param key the key that needs to be removed. * @return the value to which the key had been mapped in this AppContext, - * or null if the key did not have a mapping. + * or {@code null} if the key did not have a mapping. * @since 1.2 */ public Object remove(Object key) { @@ -746,7 +748,7 @@ public final class AppContext { * Returns an array of all the property change listeners * registered on this component. * - * @return all of this component's PropertyChangeListeners + * @return all of this component's {@code PropertyChangeListener}s * or an empty array if no property change * listeners are currently registered * @@ -825,7 +827,7 @@ public final class AppContext { * Returns an array of all the listeners which have been associated * with the named property. * - * @return all of the PropertyChangeListeners associated with + * @return all of the {@code PropertyChangeListeners} associated with * the named property or an empty array if no listeners have * been added * diff --git a/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java b/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java index ee0548a2904..747cf9e4124 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/DisplayChangedListener.java @@ -37,7 +37,7 @@ import java.util.EventListener; * screens. * * For win32, the listener object created from that class is then registered - * with the WToolkit object using its addDisplayChangeListener + * with the WToolkit object using its {@code addDisplayChangeListener} * method. When the display resolution is changed (which occurs, * in Windows, either by the user changing the properties of the * display through the control panel or other utility or by diff --git a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java index affe2bcb8e7..d096d8c5e7d 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java @@ -348,17 +348,17 @@ public abstract class EmbeddedFrame extends Frame /** * Synthesize native message to activate or deactivate EmbeddedFrame window - * depending on the value of parameter b. + * depending on the value of parameter {@code b}. * Peers should override this method if they are to implement * this functionality. - * @param doActivate if true, activates the window; + * @param doActivate if {@code true}, activates the window; * otherwise, deactivates the window */ public void synthesizeWindowActivation(boolean doActivate) {} /** * Moves this embedded frame to a new location. The top-left corner of - * the new location is specified by the x and y + * the new location is specified by the {@code x} and {@code y} * parameters relative to the native parent component. *

        * setLocation() and setBounds() for EmbeddedFrame really don't move it @@ -418,9 +418,9 @@ public abstract class EmbeddedFrame extends Frame /** * Moves and resizes this embedded frame. The new location of the top-left - * corner is specified by x and y parameters + * corner is specified by {@code x} and {@code y} parameters * relative to the native parent component. The new size is specified by - * width and height. + * {@code width} and {@code height}. *

        * setLocation() and setBounds() for EmbeddedFrame really don't move it * within the native parent. These methods always put embedded frame to @@ -437,8 +437,8 @@ public abstract class EmbeddedFrame extends Frame *

        * @param x the new x-coordinate relative to the parent component * @param y the new y-coordinate relative to the parent component - * @param width the new width of this embedded frame - * @param height the new height of this embedded frame + * @param width the new {@code width} of this embedded frame + * @param height the new {@code height} of this embedded frame * @see java.awt.Component#setBounds * @see #setLocationPrivate * @see #getLocationPrivate diff --git a/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java b/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java index 8ceb67e05b1..8131834b3c7 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/FwDispatcher.java @@ -48,7 +48,7 @@ public interface FwDispatcher { /** * Forwards a runnable to the delegate, which executes it on an appropriate thread. - * @param r - a runnable calling {@link EventQueue#dispatchEventImpl(java.awt.AWTEvent, Object)} + * @param r a runnable calling {@link EventQueue#dispatchEventImpl(java.awt.AWTEvent, Object)} */ void scheduleDispatch(Runnable r); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java b/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java index 5337b1956ea..67305e77efd 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/GlobalCursorManager.java @@ -153,7 +153,7 @@ public abstract class GlobalCursorManager { * updates:

        * * (1) InputEvent updates which are outdated are discarded by - * updateCursorImmediately(InputEvent).

        + * {@code updateCursorImmediately(InputEvent)}.

        * * (2) If 'useCache' is true, the native code is free to use a cached * value to determine the most specific, visible, enabled heavyweight diff --git a/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java b/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java index 1a203b83700..5ddeca23ef4 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/LightweightFrame.java @@ -112,7 +112,7 @@ public abstract class LightweightFrame extends Frame { * frame. Peers should override this method if they are to implement * this functionality. * - * @param activate if true, activates the frame; + * @param activate if {@code true}, activates the frame; * otherwise, deactivates the frame */ public void emulateActivation(boolean activate) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java b/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java index 7a6312aa99e..eec1fc93c66 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/PaintEventDispatcher.java @@ -40,7 +40,7 @@ public class PaintEventDispatcher { private static PaintEventDispatcher dispatcher; /** - * Sets the current PaintEventDispatcher. + * Sets the current {@code PaintEventDispatcher}. * * @param dispatcher PaintEventDispatcher */ @@ -52,7 +52,7 @@ public class PaintEventDispatcher { } /** - * Returns the currently active PaintEventDispatcher. This + * Returns the currently active {@code PaintEventDispatcher}. This * will never return null. * * @return PaintEventDispatcher @@ -67,9 +67,9 @@ public class PaintEventDispatcher { } /** - * Creates and returns the PaintEvent that should be + * Creates and returns the {@code PaintEvent} that should be * dispatched for the specified component. If this returns null - * no PaintEvent is dispatched. + * no {@code PaintEvent} is dispatched. *

        * WARNING: This is invoked from the native thread, be careful * what methods you end up invoking here. diff --git a/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java b/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java index 86723c5d015..e2624f26a0b 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/RepaintArea.java @@ -31,7 +31,7 @@ import java.awt.Rectangle; import java.awt.event.PaintEvent; /** - * The RepaintArea is a geometric construct created for the + * The {@code RepaintArea} is a geometric construct created for the * purpose of holding the geometry of several coalesced paint events. * This geometry is accessed synchronously, although it is written such * that painting may still be executed asynchronously. @@ -59,17 +59,17 @@ public class RepaintArea { /** - * Constructs a new RepaintArea + * Constructs a new {@code RepaintArea} * @since 1.3 */ public RepaintArea() { } /** - * Constructs a new RepaintArea initialized to match + * Constructs a new {@code RepaintArea} initialized to match * the values of the specified RepaintArea. * - * @param ra the RepaintArea from which to copy initial + * @param ra the {@code RepaintArea} from which to copy initial * values to a newly constructed RepaintArea * @since 1.3 */ @@ -82,12 +82,12 @@ public class RepaintArea { } /** - * Adds a Rectangle to this RepaintArea. + * Adds a {@code Rectangle} to this {@code RepaintArea}. * PAINT Rectangles are divided into mostly vertical and mostly horizontal. * Each group is unioned together. * UPDATE Rectangles are unioned. * - * @param r the specified Rectangle + * @param r the specified {@code Rectangle} * @param id possible values PaintEvent.UPDATE or PaintEvent.PAINT * @since 1.3 */ @@ -109,11 +109,11 @@ public class RepaintArea { /** - * Creates a new RepaintArea with the same geometry as this + * Creates a new {@code RepaintArea} with the same geometry as this * RepaintArea, then removes all of the geometry from this * RepaintArea and restores it to an empty RepaintArea. * - * @return ra a new RepaintArea having the same geometry as + * @return ra a new {@code RepaintArea} having the same geometry as * this RepaintArea. * @since 1.3 */ @@ -186,7 +186,7 @@ public class RepaintArea { * MAX_BENEFIT_RATIO times the benefit, then the vertical and horizontal unions are * painted separately. Otherwise the entire bounding rectangle is painted. * - * @param target Component to paint or update + * @param target Component to {@code paint} or {@code update} * @since 1.4 */ public void paint(Object target, boolean shouldClearRectBeforePaint) { @@ -248,7 +248,7 @@ public class RepaintArea { } /** - * Calls Component.update(Graphics) with given Graphics. + * Calls {@code Component.update(Graphics)} with given Graphics. */ protected void updateComponent(Component comp, Graphics g) { if (comp != null) { @@ -257,7 +257,7 @@ public class RepaintArea { } /** - * Calls Component.paint(Graphics) with given Graphics. + * Calls {@code Component.paint(Graphics)} with given Graphics. */ protected void paintComponent(Component comp, Graphics g) { if (comp != null) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java index 8130198e0d2..a1c89a41067 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/SunToolkit.java @@ -339,9 +339,9 @@ public abstract class SunToolkit extends Toolkit /** * Sets the synchronous status of focus requests on lightweight * components in the specified window to the specified value. - * If the boolean parameter is true then the focus + * If the boolean parameter is {@code true} then the focus * requests on lightweight components will be performed - * synchronously, if it is false, then asynchronously. + * synchronously, if it is {@code false}, then asynchronously. * By default, all windows have their lightweight request status * set to asynchronous. *

        @@ -521,7 +521,7 @@ public abstract class SunToolkit extends Toolkit /* * Execute a chunk of code on the Java event handler thread. The * method takes into account provided AppContext and sets - * SunToolkit.getDefaultToolkit() as a target of the + * {@code SunToolkit.getDefaultToolkit()} as a target of the * event. See 6451487 for detailes. * Does not wait for the execution to occur before returning to * the caller. @@ -1159,21 +1159,10 @@ public abstract class SunToolkit extends Toolkit return getStartupLocale(); } - private static DefaultMouseInfoPeer mPeer = null; - - @Override - public synchronized MouseInfoPeer getMouseInfoPeer() { - if (mPeer == null) { - mPeer = new DefaultMouseInfoPeer(); - } - return mPeer; - } - - /** * Returns whether default toolkit needs the support of the xembed * from embedding host(if any). - * @return true, if XEmbed is needed, false otherwise + * @return {@code true}, if XEmbed is needed, {@code false} otherwise */ public static boolean needsXEmbed() { String noxembed = AccessController. @@ -1196,7 +1185,7 @@ public abstract class SunToolkit extends Toolkit /** * Returns whether this toolkit needs the support of the xembed * from embedding host(if any). - * @return true, if XEmbed is needed, false otherwise + * @return {@code true}, if XEmbed is needed, {@code false} otherwise */ protected boolean needsXEmbedImpl() { return false; @@ -1215,8 +1204,8 @@ public abstract class SunToolkit extends Toolkit /** * Returns whether the modal exclusion API is supported by the current toolkit. - * When it isn't supported, calling setModalExcluded has no - * effect, and isModalExcluded returns false for all windows. + * When it isn't supported, calling {@code setModalExcluded} has no + * effect, and {@code isModalExcluded} returns false for all windows. * * @return true if modal exclusion is supported by the toolkit, false otherwise * @@ -1249,7 +1238,7 @@ public abstract class SunToolkit extends Toolkit * events, focus transfer and z-order will continue to work for the * window, it's owned windows and child components, even in the * presence of a modal dialog. - * For details on which Windows are normally blocked + * For details on which {@code Window}s are normally blocked * by modal dialog, see {@link java.awt.Dialog}. * Invoking this method when the modal exclusion API is not supported by * the current toolkit has no effect. @@ -1438,23 +1427,23 @@ public abstract class SunToolkit extends Toolkit * *

        This method allows to write tests without explicit timeouts * or wait for some event. Example: - * + *

        {@code
              * Frame f = ...;
              * f.setVisible(true);
              * ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
        -     * 
        +     * }
        * - *

        After realSync, f will be completely visible + *

        After realSync, {@code f} will be completely visible * on the screen, its getLocationOnScreen will be returning the * right result and it will be the focus owner. * *

        Another example: - * + *

        {@code
              * b.requestFocus();
              * ((SunToolkit)Toolkit.getDefaultToolkit()).realSync();
        -     * 
        +     * }
        * - *

        After realSync, b will be focus owner. + *

        After realSync, {@code b} will be focus owner. * *

        Notice that realSync isn't guaranteed to work if recurring * actions occur, such as if during processing of some event @@ -1529,8 +1518,8 @@ public abstract class SunToolkit extends Toolkit * sync of the native queue. The method should wait until native * requests are processed, all native events are processed and * corresponding Java events are generated. Should return - * true if some events were processed, - * false otherwise. + * {@code true} if some events were processed, + * {@code false} otherwise. */ protected abstract boolean syncNativeQueue(final long timeout); @@ -1547,8 +1536,8 @@ public abstract class SunToolkit extends Toolkit * Waits for the Java event queue to empty. Ensures that all * events are processed (including paint events), and that if * recursive events were generated, they are also processed. - * Should return true if more processing is - * necessary, false otherwise. + * Should return {@code true} if more processing is + * necessary, {@code false} otherwise. */ @SuppressWarnings("serial") protected final boolean waitForIdle(final long timeout) { @@ -1813,7 +1802,7 @@ public abstract class SunToolkit extends Toolkit } /** - * Returns the Window ancestor of the component comp. + * Returns the {@code Window} ancestor of the component {@code comp}. * @return Window ancestor of the component or component by itself if it is Window; * null, if component is not a part of window hierarchy */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java index 1714fea6113..e90e6004ad7 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/DataTransferer.java @@ -124,7 +124,7 @@ import java.util.stream.Stream; */ public abstract class DataTransferer { /** - * The DataFlavor representing a Java text encoding String + * The {@code DataFlavor} representing a Java text encoding String * encoded in UTF-8, where *

              *     representationClass = [B
        @@ -323,7 +323,7 @@ public abstract class DataTransferer {
              * @param flavors the data flavors
              * @param map the FlavorTable which contains mappings between
              *            DataFlavors and data formats
        -     * @throws NullPointerException if flavors or map is null
        +     * @throws NullPointerException if flavors or map is {@code null}
              */
             public SortedMap getFormatsForFlavors(DataFlavor[] flavors,
                                                                     FlavorTable map)
        @@ -478,7 +478,7 @@ public abstract class DataTransferer {
              * @param formats the data formats
              * @param map the FlavorTable which contains mappings between
              *            DataFlavors and data formats
        -     * @throws NullPointerException if formats or map is null
        +     * @throws NullPointerException if formats or map is {@code null}
              */
             public Set getFlavorsForFormatsAsSet(long[] formats, FlavorTable map) {
                 Set flavorSet = new HashSet<>(formats.length);
        @@ -509,13 +509,13 @@ public abstract class DataTransferer {
              * 2) the data translation for this mapping can be performed by the data
              * transfer subsystem.
              * The array will be sorted according to a
        -     * DataFlavorComparator created with the specified
        +     * {@code DataFlavorComparator} created with the specified
              * map as an argument.
              *
              * @param formats the data formats
              * @param map the FlavorTable which contains mappings between
              *            DataFlavors and data formats
        -     * @throws NullPointerException if formats or map is null
        +     * @throws NullPointerException if formats or map is {@code null}
              */
             public DataFlavor[] getFlavorsForFormatsAsArray(long[] formats,
                                                             FlavorTable map) {
        @@ -1805,21 +1805,21 @@ search:
         
             /**
              * Concatenates the data represented by two objects. Objects can be either
        -     * byte arrays or instances of InputStream. If both arguments
        +     * byte arrays or instances of {@code InputStream}. If both arguments
              * are byte arrays byte array will be returned. Otherwise an
        -     * InputStream will be returned.
        +     * {@code InputStream} will be returned.
              * 

        * Currently is only called from native code to prepend palette data to * platform-specific image data during image transfer on Win32. * * @param obj1 the first object to be concatenated. * @param obj2 the second object to be concatenated. - * @return a byte array or an InputStream which represents + * @return a byte array or an {@code InputStream} which represents * a logical concatenation of the two arguments. * @throws NullPointerException is either of the arguments is - * null + * {@code null} * @throws ClassCastException is either of the arguments is - * neither byte array nor an instance of InputStream. + * neither byte array nor an instance of {@code InputStream}. */ private Object concatData(Object obj1, Object obj2) { InputStream str1 = null; @@ -1962,7 +1962,7 @@ search: /** * Helper function to convert a Set of DataFlavors to a sorted array. - * The array will be sorted according to DataFlavorComparator. + * The array will be sorted according to {@code DataFlavorComparator}. */ public static DataFlavor[] setToSortedDataFlavorArray(Set flavorsSet) { DataFlavor[] flavors = new DataFlavor[flavorsSet.size()]; @@ -1993,7 +1993,7 @@ search: /** * Returns platform-specific mappings for the specified native. * If there are no platform-specific mappings for this native, the method - * returns an empty List. + * returns an empty {@code List}. */ public LinkedHashSet getPlatformMappingsForNative(String nat) { return new LinkedHashSet<>(); @@ -2002,7 +2002,7 @@ search: /** * Returns platform-specific mappings for the specified flavor. * If there are no platform-specific mappings for this flavor, the method - * returns an empty List. + * returns an empty {@code List}. */ public LinkedHashSet getPlatformMappingsForFlavor(DataFlavor df) { return new LinkedHashSet<>(); diff --git a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java index 3b743cbbaab..fe1baa3e631 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java @@ -68,8 +68,8 @@ public abstract class SunClipboard extends Clipboard private final Object CLIPBOARD_FLAVOR_LISTENER_KEY; /** - * A number of FlavorListeners currently registered - * on this clipboard across all AppContexts. + * A number of {@code FlavorListener}s currently registered + * on this clipboard across all {@code AppContext}s. */ private volatile int numberOfFlavorListeners = 0; @@ -262,11 +262,11 @@ public abstract class SunClipboard extends Clipboard /** * Clears the clipboard state (contents, owner and contents context) and * notifies the current owner that ownership is lost. Does nothing if the - * argument is not null and is not equal to the current + * argument is not {@code null} and is not equal to the current * contents context. * * @param disposedContext the AppContext that is disposed or - * null if the ownership is lost because another + * {@code null} if the ownership is lost because another * application acquired ownership. */ protected void lostOwnershipLater(final AppContext disposedContext) { @@ -405,10 +405,10 @@ public abstract class SunClipboard extends Clipboard protected abstract void unregisterClipboardViewerChecked(); /** - * Checks change of the DataFlavors and, if necessary, - * posts notifications on FlavorEvents to the + * Checks change of the {@code DataFlavor}s and, if necessary, + * posts notifications on {@code FlavorEvent}s to the * AppContexts' EDTs. - * The parameter formats is null iff we have just + * The parameter {@code formats} is null iff we have just * failed to get formats available on the clipboard. * * @param formats data formats that have just been retrieved from diff --git a/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java b/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java index 1f59869027d..78a316b0700 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/event/IgnorePaintEvent.java @@ -32,7 +32,7 @@ import java.awt.event.PaintEvent; * PaintEvents that are effectively ignored. This class is used only for * tagging. If a heavy weight peer is asked to handle an event of this * class it'll ignore it. This class is used by Swing. - * Look at javax.swing.SwingPaintEventDispatcher for more. + * Look at {@code javax.swing.SwingPaintEventDispatcher} for more. * */ @SuppressWarnings("serial") // JDK-implementation class diff --git a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java index 64d37c88e27..82a0dc1ef38 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order2.java @@ -89,7 +89,7 @@ final class Order2 extends Curve { /* * Return the count of the number of horizontal sections of the * specified quadratic Bezier curve. Put the parameters for the - * horizontal sections into the specified ret array. + * horizontal sections into the specified {@code ret} array. *

        * If we examine the parametric equation in t, we have: * Py(t) = C0*(1-t)^2 + 2*CP*t*(1-t) + C1*t^2 diff --git a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java index 9c9e5962aea..21363f63b1c 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/geom/Order3.java @@ -123,7 +123,7 @@ final class Order3 extends Curve { /* * Return the count of the number of horizontal sections of the * specified cubic Bezier curve. Put the parameters for the - * horizontal sections into the specified ret array. + * horizontal sections into the specified {@code ret} array. *

        * If we examine the parametric equation in t, we have: * Py(t) = C0(1-t)^3 + 3CP0 t(1-t)^2 + 3CP1 t^2(1-t) + C1 t^3 diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java b/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java index 88ee71163b1..fe533f4cbe0 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/ExecutableInputMethodManager.java @@ -57,11 +57,11 @@ import sun.awt.InputMethodSupport; import sun.awt.SunToolkit; /** - * ExecutableInputMethodManager is the implementation of the - * InputMethodManager class. It is runnable as a separate + * {@code ExecutableInputMethodManager} is the implementation of the + * {@code InputMethodManager} class. It is runnable as a separate * thread in the AWT environment.  - * InputMethodManager.getInstance() creates an instance of - * ExecutableInputMethodManager and executes it as a deamon + * {@code InputMethodManager.getInstance()} creates an instance of + * {@code ExecutableInputMethodManager} and executes it as a deamon * thread. * * @see InputMethodManager diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java index a5000b9836d..8b479d20957 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodManager.java @@ -59,10 +59,10 @@ import sun.misc.InnocuousThread; import sun.misc.ManagedLocalsThread; /** - * InputMethodManager is an abstract class that manages the input - * method environment of JVM. There is only one InputMethodManager + * {@code InputMethodManager} is an abstract class that manages the input + * method environment of JVM. There is only one {@code InputMethodManager} * instance in JVM that is executed under a separate daemon thread. - * InputMethodManager performs the following: + * {@code InputMethodManager} performs the following: *

          *
        • * Keeps track of the current input context.
        • @@ -87,7 +87,7 @@ import sun.misc.ManagedLocalsThread; * When more than one input method descriptor can be found or the only input * method descriptor found supports multiple locales, a menu item * is added to the window (manager) menu. This item label is obtained invoking - * getTriggerMenuString(). If null is returned by this method, it + * {@code getTriggerMenuString()}. If null is returned by this method, it * means that there is only input method or none in the environment. Frame and Dialog * invoke this method. * @@ -97,15 +97,15 @@ import sun.misc.ManagedLocalsThread; * *
        • * When the menu item of the window (manager) menu has been selected by the - * user, Frame/Dialog invokes notifyChangeRequest() to notify - * InputMethodManager that the user wants to switch input methods.
        • + * user, Frame/Dialog invokes {@code notifyChangeRequest()} to notify + * {@code InputMethodManager} that the user wants to switch input methods. * *
        • - * InputMethodManager displays a pop-up menu to choose an input method.
        • + * {@code InputMethodManager} displays a pop-up menu to choose an input method. * *
        • - * InputMethodManager notifies the current InputContext of - * the selected InputMethod.
        • + * {@code InputMethodManager} notifies the current {@code InputContext} of + * the selected {@code InputMethod}. *
        * *
          @@ -116,8 +116,8 @@ import sun.misc.ManagedLocalsThread; * *
        • * When the hot key combination is typed by the user, the component which has the input - * focus invokes notifyChangeRequestByHotKey() to notify - * InputMethodManager that the user wants to switch input methods.
        • + * focus invokes {@code notifyChangeRequestByHotKey()} to notify + * {@code InputMethodManager} that the user wants to switch input methods. * *
        • * This results in a popup menu and notification to the current input context, diff --git a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java index d64a5f06f7a..7a2c975918e 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/im/InputMethodPopupMenu.java @@ -46,7 +46,7 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; /** - * InputMethodPopupMenu provides the popup selection menu + * {@code InputMethodPopupMenu} provides the popup selection menu */ abstract class InputMethodPopupMenu implements ActionListener { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java b/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java index 95dd69f1ff9..a91ffbc5d29 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/BufferedImageDevice.java @@ -37,8 +37,8 @@ public class BufferedImageDevice extends GraphicsDevice } /** - * Returns the type of this GraphicsDevice. - * @return the type of this GraphicsDevice, which can + * Returns the type of this {@code GraphicsDevice}. + * @return the type of this {@code GraphicsDevice}, which can * either be TYPE_RASTER_SCREEN, TYPE_PRINTER or TYPE_IMAGE_BUFFER. * @see #TYPE_RASTER_SCREEN * @see #TYPE_PRINTER @@ -50,30 +50,30 @@ public class BufferedImageDevice extends GraphicsDevice /** * Returns the identification string associated with this - * GraphicsDevice. - * @return a String that is the identification - * of this GraphicsDevice. + * {@code GraphicsDevice}. + * @return a {@code String} that is the identification + * of this {@code GraphicsDevice}. */ public String getIDstring() { return ("BufferedImage"); } /** - * Returns all of the GraphicsConfiguration - * objects associated with this GraphicsDevice. - * @return an array of GraphicsConfiguration + * Returns all of the {@code GraphicsConfiguration} + * objects associated with this {@code GraphicsDevice}. + * @return an array of {@code GraphicsConfiguration} * objects that are associated with this - * GraphicsDevice. + * {@code GraphicsDevice}. */ public GraphicsConfiguration[] getConfigurations() { return new GraphicsConfiguration[] { gc }; } /** - * Returns the default GraphicsConfiguration - * associated with this GraphicsDevice. - * @return the default GraphicsConfiguration - * of this GraphicsDevice. + * Returns the default {@code GraphicsConfiguration} + * associated with this {@code GraphicsDevice}. + * @return the default {@code GraphicsConfiguration} + * of this {@code GraphicsDevice}. */ public GraphicsConfiguration getDefaultConfiguration() { return gc; diff --git a/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java b/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java index bb152835f55..c8f33d8d169 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/image/DataBufferNative.java @@ -31,7 +31,7 @@ import sun.java2d.SurfaceData; import java.awt.Rectangle; /** - * This class extends DataBuffer and allows access to + * This class extends {@code DataBuffer} and allows access to * native data via the DataBuffer methods. Note that, unlike other * DataBuffer classes, the data is not stored in this class but * has been created and stored elsewhere and this class is used diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java index fe349dc90b2..e20d40b2e47 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/DefaultShellFolder.java @@ -46,9 +46,9 @@ class DefaultShellFolder extends ShellFolder { /** * This method is implemented to make sure that no instances - * of ShellFolder are ever serialized. An instance of + * of {@code ShellFolder} are ever serialized. An instance of * this default implementation can always be represented with a - * java.io.File object instead. + * {@code java.io.File} object instead. * * @return a java.io.File replacement object. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java index cf1878a0a7a..90bf4d02389 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolder.java @@ -62,9 +62,9 @@ public abstract class ShellFolder extends File { /** * This method must be implemented to make sure that no instances - * of ShellFolder are ever serialized. If isFileSystem() returns - * true, then the object should be representable with an instance of - * java.io.File instead. If not, then the object is most likely + * of {@code ShellFolder} are ever serialized. If {@code isFileSystem()} returns + * {@code true}, then the object should be representable with an instance of + * {@code java.io.File} instead. If not, then the object is most likely * depending on some internal (native) state and cannot be serialized. * * @return a java.io.File replacement object, or null @@ -74,11 +74,11 @@ public abstract class ShellFolder extends File { /** * Returns the path for this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder. * * @return the path as a String for this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder * * @see java.io.File#getParent() @@ -97,11 +97,11 @@ public abstract class ShellFolder extends File { /** * Returns a File object representing this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder. * * @return a File object representing this object's parent, - * or null if this object does not name a parent + * or {@code null} if this object does not name a parent * folder * * @see java.io.File#getParentFile() @@ -250,8 +250,8 @@ public abstract class ShellFolder extends File { } /** - * @param key a String - * @return An Object matching the string key. + * @param key a {@code String} + * @return An Object matching the string {@code key}. * @see ShellFolderManager#get(String) */ public static Object get(String key) { @@ -259,7 +259,7 @@ public abstract class ShellFolder extends File { } /** - * Does dir represent a "computer" such as a node on the network, or + * Does {@code dir} represent a "computer" such as a node on the network, or * "My Computer" on the desktop. */ public static boolean isComputerNode(File dir) { diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java index 3926b558ba3..eba6b3af1d1 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderColumnInfo.java @@ -40,8 +40,8 @@ public class ShellFolderColumnInfo { private SortOrder sortOrder; private Comparator comparator; /** - * false (default) if the {@link #comparator} expects folders as arguments, - * and true if folder's column values. The first option is used default for comparison + * {@code false} (default) if the {@link #comparator} expects folders as arguments, + * and {@code true} if folder's column values. The first option is used default for comparison * on Windows and also for separating files from directories when sorting using * ShellFolderManager's inner comparator. */ diff --git a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java index 955ba3be986..e61b8122d0a 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java @@ -44,21 +44,21 @@ class ShellFolderManager { } /** - * @param key a String + * @param key a {@code String} * "fileChooserDefaultFolder": - * Returns a File - the default shellfolder for a new filechooser + * Returns a {@code File} - the default shellfolder for a new filechooser * "roots": - * Returns a File[] - containing the root(s) of the displayable hierarchy + * Returns a {@code File[]} - containing the root(s) of the displayable hierarchy * "fileChooserComboBoxFolders": - * Returns a File[] - an array of shellfolders representing the list to + * Returns a {@code File[]} - an array of shellfolders representing the list to * show by default in the file chooser's combobox * "fileChooserShortcutPanelFolders": - * Returns a File[] - an array of shellfolders representing well-known + * Returns a {@code File[]} - an array of shellfolders representing well-known * folders, such as Desktop, Documents, History, Network, Home, etc. * This is used in the shortcut panel of the filechooser on Windows 2000 * and Windows Me. * "fileChooserIcon ": - * Returns an Image - icon can be ListView, DetailsView, UpFolder, NewFolder or + * Returns an {@code Image} - icon can be ListView, DetailsView, UpFolder, NewFolder or * ViewMenu (Windows only). * * @return An Object matching the key string. @@ -90,7 +90,7 @@ class ShellFolderManager { } /** - * Does dir represent a "computer" such as a node on the network, or + * Does {@code dir} represent a "computer" such as a node on the network, or * "My Computer" on the desktop. */ public boolean isComputerNode(File dir) { diff --git a/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java b/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java index 45dcf92aef5..285245ed381 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java +++ b/jdk/src/java.desktop/share/classes/sun/font/BidiUtils.java @@ -48,8 +48,8 @@ public final class BidiUtils { * * @param levels the array to receive the character levels * @param start the starting offset into the array - * @throws IndexOutOfBoundsException if start is less than 0 or - * start + getLength() is greater than levels.length. + * @throws IndexOutOfBoundsException if {@code start} is less than 0 or + * {@code start + getLength()} is greater than {@code levels.length}. */ public static void getLevels(Bidi bidi, byte[] levels, int start) { int limit = start + bidi.getLength(); @@ -87,7 +87,7 @@ public final class BidiUtils { * Given level data, compute a a visual to logical mapping. * The leftmost (or topmost) character is at visual index zero. The * logical index of the character is derived from the visual index - * by the expression li = map[vi];. + * by the expression {@code li = map[vi];}. * @param levels the levels array * @return the mapping array from visual to logical */ @@ -148,7 +148,7 @@ public final class BidiUtils { /** * Return the inverse position map. The source array must map one-to-one (each value * is distinct and the values run from zero to the length of the array minus one). - * For example, if values[i] = j, then inverse[j] = i. + * For example, if {@code values[i] = j}, then {@code inverse[j] = i}. * @param values the source ordering array * @return the inverse array */ diff --git a/jdk/src/java.desktop/share/classes/sun/font/FileFont.java b/jdk/src/java.desktop/share/classes/sun/font/FileFont.java index 6b84a5fe288..60b2377c9da 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/FileFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/FileFont.java @@ -80,7 +80,7 @@ public abstract class FileFont extends PhysicalFont { protected NativeFont[] nativeFonts; protected char[] glyphToCharMap; /* - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened */ FileFont(String platname, Object nativeNames) throws FontFormatException { diff --git a/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java b/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java index f5c478fb517..5ea5095ace4 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java +++ b/jdk/src/java.desktop/share/classes/sun/font/FileFontStrike.java @@ -734,8 +734,8 @@ public class FileFontStrike extends PhysicalStrike { but if we eventually allow scalers to return NULL pointers this check might be actually useful. */ if (ptr == 0L) { - result.x = (int) Math.floor(pt.x); - result.y = (int) Math.floor(pt.y); + result.x = (int) Math.floor(pt.x+0.5f); + result.y = (int) Math.floor(pt.y+0.5f); result.width = result.height = 0; return; } @@ -743,8 +743,8 @@ public class FileFontStrike extends PhysicalStrike { topLeftX = StrikeCache.unsafe.getFloat(ptr+StrikeCache.topLeftXOffset); topLeftY = StrikeCache.unsafe.getFloat(ptr+StrikeCache.topLeftYOffset); - result.x = (int)Math.floor(pt.x + topLeftX); - result.y = (int)Math.floor(pt.y + topLeftY); + result.x = (int)Math.floor(pt.x + topLeftX + 0.5f); + result.y = (int)Math.floor(pt.y + topLeftY + 0.5f); result.width = StrikeCache.unsafe.getShort(ptr+StrikeCache.widthOffset) &0x0ffff; result.height = diff --git a/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java b/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java index 750e5022ca1..15174561c03 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java +++ b/jdk/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java @@ -520,14 +520,14 @@ public final class FontDesignMetrics extends FontMetrics { /** * Gets the advance widths of the first 256 characters in the - * Font. The advance is the + * {@code Font}. The advance is the * distance from the leftmost point to the rightmost point on the * character's baseline. Note that the advance of a - * String is not necessarily the sum of the advances + * {@code String} is not necessarily the sum of the advances * of its characters. * @return an array storing the advance widths of the - * characters in the Font - * described by this FontMetrics object. + * characters in the {@code Font} + * described by this {@code FontMetrics} object. */ // More efficient than base class implementation - reuses existing cache public int[] getWidths() { diff --git a/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java b/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java index a3c7378265d..1ca522e3517 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/PhysicalFont.java @@ -52,7 +52,7 @@ public abstract class PhysicalFont extends Font2D { /** * Opens the file (temporarily) and does basic verification. * Initializes the CMAP - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ PhysicalFont(String platname, Object nativeNames) diff --git a/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java b/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java index 485002ded79..52029dcc074 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java +++ b/jdk/src/java.desktop/share/classes/sun/font/ScriptRun.java @@ -35,10 +35,10 @@ package sun.font; /** - * ScriptRun is used to find runs of characters in - * the same script, as defined in the Script class. + * {@code ScriptRun} is used to find runs of characters in + * the same script, as defined in the {@code Script} class. * It implements a simple iterator over an array of characters. - * The iterator will assign COMMON and INHERITED + * The iterator will assign {@code COMMON} and {@code INHERITED} * characters to the same script as the preceding characters. If the * COMMON and INHERITED characters are first, they will be assigned to * the same script as the following characters. @@ -88,7 +88,7 @@ public final class ScriptRun } /** - * Construct a ScriptRun object which iterates over a subrange + * Construct a {@code ScriptRun} object which iterates over a subrange * of the given characetrs. * * @param chars the array of characters over which to iterate. @@ -145,10 +145,10 @@ public final class ScriptRun } /** - * Find the next script run. Returns false if there - * isn't another run, returns true if there is. + * Find the next script run. Returns {@code false} if there + * isn't another run, returns {@code true} if there is. * - * @return false if there isn't another run, true if there is. + * @return {@code false} if there isn't another run, {@code true} if there is. */ public boolean next() { int startSP = parenSP; // used to find the first new open character @@ -273,7 +273,7 @@ public final class ScriptRun * * @param scriptOne one of the script codes. * @param scriptTwo the other script code. - * @return true if the two scripts are the same. + * @return {@code true} if the two scripts are the same. * @see Script */ private static boolean sameScript(int scriptOne, int scriptTwo) { diff --git a/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java b/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java index 69f1d4babc2..92a7c306cdc 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java +++ b/jdk/src/java.desktop/share/classes/sun/font/StandardGlyphVector.java @@ -1261,20 +1261,20 @@ public class StandardGlyphVector extends GlyphVector { // internal use only for possible future extension /** - * A flag used with getLayoutFlags that indicates whether this GlyphVector uses + * A flag used with getLayoutFlags that indicates whether this {@code GlyphVector} uses * a vertical baseline. */ public static final int FLAG_USES_VERTICAL_BASELINE = 128; /** - * A flag used with getLayoutFlags that indicates whether this GlyphVector uses - * vertical glyph metrics. A GlyphVector can use vertical metrics on a + * A flag used with getLayoutFlags that indicates whether this {@code GlyphVector} uses + * vertical glyph metrics. A {@code GlyphVector} can use vertical metrics on a * horizontal line, or vice versa. */ public static final int FLAG_USES_VERTICAL_METRICS = 256; /** - * A flag used with getLayoutFlags that indicates whether this GlyphVector uses + * A flag used with getLayoutFlags that indicates whether this {@code GlyphVector} uses * the 'alternate orientation.' Glyphs have a default orientation given a * particular baseline and metrics orientation, this is the orientation appropriate * for left-to-right text. For example, the letter 'A' can have four orientations, diff --git a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java index 7668b6572a8..c04bfb9431f 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java +++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java @@ -189,7 +189,7 @@ public class TrueTypeFont extends FileFont { * - reads the names (full, family). * - determines the style of the font. * - initializes the CMAP - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public TrueTypeFont(String platname, Object nativeNames, int fIndex, diff --git a/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java b/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java index 39a1c08d0e0..44f4f58e334 100644 --- a/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java +++ b/jdk/src/java.desktop/share/classes/sun/font/Type1Font.java @@ -161,7 +161,7 @@ public class Type1Font extends FileFont { * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. - * @throws FontFormatException - if the font can't be opened + * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java b/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java index abd1eda118f..c7be5d5ab36 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/Spans.java @@ -41,7 +41,7 @@ public class Spans { /** * This class will sort and collapse its span * entries after this many span additions via - * the add method. + * the {@code add} method. */ private static final int kMaxAddsSinceSort = 256; @@ -52,7 +52,7 @@ public class Spans { private List mSpans = new Vector<>(kMaxAddsSinceSort); /** - * The number of Span + * The number of {@code Span} * instances that have been added * to this object without a sort * and collapse taking place. @@ -65,8 +65,8 @@ public class Spans { /** * Add a span covering the half open interval - * including start up to - * but not including end. + * including {@code start} up to + * but not including {@code end}. */ public void add(float start, float end) { @@ -82,10 +82,10 @@ public class Spans { /** * Add a span which covers the entire range. * This call is logically equivalent to - * add(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY) + * {@code add(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY)} * The result of making this call is that - * all future add calls are ignored - * and the intersects method always + * all future {@code add} calls are ignored + * and the {@code intersects} method always * returns true. */ public void addInfinite() { @@ -94,8 +94,8 @@ public class Spans { /** * Returns true if the span defined by the half-open - * interval from start up to, - * but not including, end intersects + * interval from {@code start} up to, + * but not including, {@code end} intersects * any of the spans defined by this instance. */ public boolean intersects(float start, float end) { @@ -231,8 +231,8 @@ public class Spans { /** * Create a half-open interval including - * start but not including - * end. + * {@code start} but not including + * {@code end}. */ Span(float start, float end) { mStart = start; @@ -240,7 +240,7 @@ public class Spans { } /** - * Return the start of the Span. + * Return the start of the {@code Span}. * The start is considered part of the * half-open interval. */ @@ -249,7 +249,7 @@ public class Spans { } /** - * Return the end of the Span. + * Return the end of the {@code Span}. * The end is not considered part of the * half-open interval. */ @@ -259,7 +259,7 @@ public class Spans { /** * Change the initial position of the - * Span. + * {@code Span}. */ final void setStart(float start) { mStart = start; @@ -267,18 +267,18 @@ public class Spans { /** * Change the terminal position of the - * Span. + * {@code Span}. */ final void setEnd(float end) { mEnd = end; } /** - * Attempt to alter this Span - * to include otherSpan without + * Attempt to alter this {@code Span} + * to include {@code otherSpan} without * altering this span's starting position. - * If otherSpan can be so consumed - * by this Span then true + * If {@code otherSpan} can be so consumed + * by this {@code Span} then {@code true} * is returned. */ boolean subsume(Span otherSpan) { @@ -304,7 +304,7 @@ public class Spans { /** * Return true if the passed in position * lies in the half-open interval defined - * by this Span. + * by this {@code Span}. */ boolean contains(float pos) { return mStart <= pos && pos < mEnd; @@ -337,11 +337,11 @@ public class Spans { } /** - * This class ranks a pair of Span + * This class ranks a pair of {@code Span} * instances. If the instances intersect they * are deemed equal otherwise they are ranked * by their relative position. Use - * SpanIntersection.instance to + * {@code SpanIntersection.instance} to * get the single instance of this class. */ static class SpanIntersection implements Comparator { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java b/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java index 01f0d00cb8f..53896a81894 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/StateTrackable.java @@ -129,9 +129,9 @@ package sun.java2d; * time period of the modifications would be small in most cases * and the 2 changes of state would each require synchronization. *

          - * In comparison the act of setting the curTracker + * In comparison the act of setting the {@code curTracker} * reference to null in the usage pattern above effectively invalidates - * all outstanding Tracker objects as soon as possible + * all outstanding {@code Tracker} objects as soon as possible * after the change to the data and requires very little code and no * synchronization to implement. *

          diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java index 3cb7207ad2b..869271d1e0c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java @@ -2759,8 +2759,8 @@ public final class SunGraphics2D } /** - * Intersects destRect with clip and - * overwrites destRect with the result. + * Intersects {@code destRect} with {@code clip} and + * overwrites {@code destRect} with the result. * Returns false if the intersection was empty, true otherwise. */ private boolean clipTo(Rectangle destRect, Rectangle clip) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java index 679f801d2e4..ce14dfa569d 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphicsEnvironment.java @@ -166,7 +166,7 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment /** * Create and return the screen device with the specified number. The - * device with number 0 will be the default device (returned + * device with number {@code 0} will be the default device (returned * by {@link #getDefaultScreenDevice()}. * * @param screennum the number of the screen to create diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java b/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java index 8250d09a43d..4de1a1fc576 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/SurfaceData.java @@ -922,8 +922,8 @@ public abstract class SurfaceData } /** - * Returns the type of this Transparency. - * @return the field type of this Transparency, which is + * Returns the type of this {@code Transparency}. + * @return the field type of this {@code Transparency}, which is * either OPAQUE, BITMASK or TRANSLUCENT. */ public int getTransparency() { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java index 9aa35132772..18cb441c571 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.java @@ -110,7 +110,7 @@ public final class MarlinCache implements MarlinConst { MarlinCache(final RendererContext rdrCtx) { this.rdrCtx = rdrCtx; - rowAAChunk = new OffHeapArray(rdrCtx, INITIAL_CHUNK_ARRAY); + rowAAChunk = new OffHeapArray(rdrCtx.cleanerObj, INITIAL_CHUNK_ARRAY); // 64K touchedTile = touchedTile_initial; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java index 43dee2477ed..96437cd2f56 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/OffHeapArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * 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,14 +25,9 @@ package sun.java2d.marlin; -import java.lang.ref.PhantomReference; -import java.lang.ref.ReferenceQueue; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Vector; import static sun.java2d.marlin.MarlinConst.logUnsafeMalloc; -import sun.awt.util.ThreadGroupUtils; import jdk.internal.misc.Unsafe; +import jdk.internal.ref.CleanerFactory; /** * @@ -45,36 +40,9 @@ final class OffHeapArray { // size of int / float static final int SIZE_INT; - // RendererContext reference queue - private static final ReferenceQueue rdrQueue - = new ReferenceQueue(); - // reference list - private static final Vector refList - = new Vector(32); - static { unsafe = Unsafe.getUnsafe(); SIZE_INT = Unsafe.ARRAY_INT_INDEX_SCALE; - - // Mimics Java2D Disposer: - AccessController.doPrivileged( - (PrivilegedAction) () -> { - /* - * The thread must be a member of a thread group - * which will not get GCed before VM exit. - * Make its parent the top-level thread group. - */ - final ThreadGroup rootTG - = ThreadGroupUtils.getRootThreadGroup(); - final Thread t = new Thread(rootTG, new OffHeapDisposer(), - "MarlinRenderer Disposer"); - t.setContextClassLoader(null); - t.setDaemon(true); - t.setPriority(Thread.MAX_PRIORITY); - t.start(); - return null; - } - ); } /* members */ @@ -89,12 +57,12 @@ final class OffHeapArray { this.used = 0; if (logUnsafeMalloc) { MarlinUtils.logInfo(System.currentTimeMillis() - + ": OffHeapArray.allocateMemory = " + + ": OffHeapArray.allocateMemory = " + len + " to addr = " + this.address); } - // Create the phantom reference to ensure freeing off-heap memory: - refList.add(new OffHeapReference(parent, this)); + // Register a cleaning function to ensure freeing off-heap memory: + CleanerFactory.cleaner().register(parent, () -> this.free()); } /* @@ -117,7 +85,7 @@ final class OffHeapArray { unsafe.freeMemory(this.address); if (logUnsafeMalloc) { MarlinUtils.logInfo(System.currentTimeMillis() - + ": OffHeapEdgeArray.free = " + + ": OffHeapArray.freeMemory = " + this.length + " at addr = " + this.address); } @@ -126,41 +94,4 @@ final class OffHeapArray { void fill(final byte val) { unsafe.setMemory(this.address, this.length, val); } - - static final class OffHeapReference extends PhantomReference { - - private final OffHeapArray array; - - OffHeapReference(final Object parent, final OffHeapArray edges) { - super(parent, rdrQueue); - this.array = edges; - } - - void dispose() { - // free off-heap blocks - this.array.free(); - } - } - - static final class OffHeapDisposer implements Runnable { - @Override - public void run() { - final Thread currentThread = Thread.currentThread(); - OffHeapReference ref; - - // check interrupted: - for (; !currentThread.isInterrupted();) { - try { - ref = (OffHeapReference)rdrQueue.remove(); - ref.dispose(); - - refList.remove(ref); - - } catch (InterruptedException ie) { - MarlinUtils.logException("OffHeapDisposer interrupted:", - ie); - } - } - } - } } diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java index f59785cd92f..aacd8b2062d 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java @@ -514,7 +514,7 @@ final class Renderer implements PathConsumer2D, MarlinConst { Renderer(final RendererContext rdrCtx) { this.rdrCtx = rdrCtx; - this.edges = new OffHeapArray(rdrCtx, INITIAL_EDGES_CAPACITY); // 96K + this.edges = new OffHeapArray(rdrCtx.cleanerObj, INITIAL_EDGES_CAPACITY); // 96K this.curve = rdrCtx.curve; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java index a767651f5d5..f9524c88870 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java @@ -68,6 +68,8 @@ final class RendererContext implements MarlinConst { * @see MarlinRenderingEngine#REF_TYPE */ final Object reference; + // Smallest object used as Cleaner's parent reference + final Object cleanerObj = new Object(); // dirty flag indicating an exception occured during pipeline in pathTo() boolean dirty = false; // dynamic array caches kept using weak reference (low memory footprint) @@ -187,10 +189,10 @@ final class RendererContext implements MarlinConst { if (USE_CACHE_HARD_REF) { // update hard reference: hardRefArrayCaches = holder; + } else { + // update weak reference: + refArrayCaches = new WeakReference(holder); } - - // update weak reference: - refArrayCaches = new WeakReference(holder); } } return holder; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java index 1aa48411f04..2946eda28f0 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Stroker.java @@ -87,6 +87,7 @@ final class Stroker implements PathConsumer2D, MarlinConst { private int joinStyle; private float lineWidth2; + private float invHalfLineWidth2Sq; private final float[] offset0 = new float[2]; private final float[] offset1 = new float[2]; @@ -158,6 +159,7 @@ final class Stroker implements PathConsumer2D, MarlinConst { this.out = pc2d; this.lineWidth2 = lineWidth / 2f; + this.invHalfLineWidth2Sq = 1f / (2f * lineWidth2 * lineWidth2); this.capStyle = capStyle; this.joinStyle = joinStyle; @@ -252,11 +254,11 @@ final class Stroker implements PathConsumer2D, MarlinConst { // The sign of the dot product of mx,my and omx,omy is equal to the // the sign of the cosine of ext // (ext is the angle between omx,omy and mx,my). - double cosext = omx * mx + omy * my; + final float cosext = omx * mx + omy * my; // If it is >=0, we know that abs(ext) is <= 90 degrees, so we only // need 1 curve to approximate the circle section that joins omx,omy // and mx,my. - final int numCurves = cosext >= 0 ? 1 : 2; + final int numCurves = (cosext >= 0f) ? 1 : 2; switch (numCurves) { case 1: @@ -302,14 +304,22 @@ final class Stroker implements PathConsumer2D, MarlinConst { final float mx, final float my, boolean rev) { - float cosext2 = (omx * mx + omy * my) / (2f * lineWidth2 * lineWidth2); + final float cosext2 = (omx * mx + omy * my) * invHalfLineWidth2Sq; + + // check round off errors producing cos(ext) > 1 and a NaN below + // cos(ext) == 1 implies colinear segments and an empty join anyway + if (cosext2 >= 0.5f) { + // just return to avoid generating a flat curve: + return; + } + // cv is the length of P1-P0 and P2-P3 divided by the radius of the arc // (so, cv assumes the arc has radius 1). P0, P1, P2, P3 are the points that // define the bezier curve we're computing. // It is computed using the constraints that P1-P0 and P3-P2 are parallel // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. - float cv = (float) ((4.0 / 3.0) * sqrt(0.5-cosext2) / - (1.0 + sqrt(cosext2+0.5))); + float cv = (float) ((4.0 / 3.0) * sqrt(0.5 - cosext2) / + (1.0 + sqrt(cosext2 + 0.5))); // if clockwise, we need to negate cv. if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) cv = -cv; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java index 16f719a0cbf..94b0e2f1e59 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/marlin/Version.java @@ -27,7 +27,7 @@ package sun.java2d.marlin; public final class Version { - private static final String version = "marlin-0.7.2-Unsafe-OpenJDK"; + private static final String version = "marlin-0.7.3-Unsafe-OpenJDK"; public static String getVersion() { return version; diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java index 02f9b4cef29..601658b11f5 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/opengl/OGLUtilities.java @@ -81,7 +81,7 @@ class OGLUtilities { * * In order to avoid deadlock, it is important that the given Runnable * does not attempt to acquire the AWT lock, as that will be handled - * automatically as part of the rq.flushAndInvokeNow() step. + * automatically as part of the {@code rq.flushAndInvokeNow()} step. * * @param g the Graphics object for the corresponding destination surface; * if null, the step making a context current to the destination surface @@ -134,7 +134,7 @@ class OGLUtilities { * * In order to avoid deadlock, it is important that the given Runnable * does not attempt to acquire the AWT lock, as that will be handled - * automatically as part of the rq.flushAndInvokeNow() step. + * automatically as part of the {@code rq.flushAndInvokeNow()} step. * * @param config the GraphicsConfiguration object whose "shared" * context will be made current during this operation; if this value is @@ -297,7 +297,7 @@ class OGLUtilities { * @return a constant that describes the surface associated with the * given Graphics object; if the given Graphics object is invalid (i.e. * is not associated with an OpenGL surface) this method will return - * OGLUtilities.UNDEFINED + * {@code OGLUtilities.UNDEFINED} */ public static int getOGLSurfaceType(Graphics g) { if (!(g instanceof SunGraphics2D)) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java index a7e181e9d2a..728a5823e4d 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/DrawImage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -955,6 +955,12 @@ public class DrawImage implements DrawImagePipe { comp = CompositeType.SrcNoEa; } + if (srcData == dstData && sx == dx && sy == dy + && CompositeType.SrcNoEa.equals(comp)) { + // Performance optimization. We skip the Blit/BlitBG if we know that + // it will be noop. + return; + } if (!isBgOperation(srcData, bgColor)) { Blit blit = Blit.getFromCache(srcType, comp, dstType); blit.Blit(srcData, dstData, sg.composite, clipRegion, diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java index 723fdaaf97e..95a7aa46674 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/Region.java @@ -104,11 +104,11 @@ public class Region { } /** - * Adds the dimension dim to the coordinate - * start with appropriate clipping. If - * dim is non-positive then the method returns + * Adds the dimension {@code dim} to the coordinate + * {@code start} with appropriate clipping. If + * {@code dim} is non-positive then the method returns * the start coordinate. If the sum overflows an integer - * data type then the method returns Integer.MAX_VALUE. + * data type then the method returns {@code Integer.MAX_VALUE}. */ public static int dimAdd(int start, int dim) { if (dim <= 0) return start; @@ -179,9 +179,9 @@ public class Region { * * @param s a non-null Shape object specifying the geometry enclosing * the pixels of interest - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired */ public static Region getInstance(Shape s, AffineTransform at) { return getInstance(WHOLE_REGION, false, s, at); @@ -205,9 +205,9 @@ public class Region { * clip the geometry to * @param s a non-null Shape object specifying the geometry enclosing * the pixels of interest - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired */ public static Region getInstance(Region devBounds, Shape s, AffineTransform at) @@ -238,9 +238,9 @@ public class Region { * normalization * @param s a non-null Shape object specifying the geometry enclosing * the pixels of interest - * @param at an optional AffineTransform to be applied to the + * @param at an optional {@code AffineTransform} to be applied to the * coordinates as they are returned in the iteration, or - * null if untransformed coordinates are desired + * {@code null} if untransformed coordinates are desired */ public static Region getInstance(Region devBounds, boolean normalize, Shape s, AffineTransform at) @@ -363,7 +363,7 @@ public class Region { * Sets the rectangle of interest for storing and returning * region bands. The rectangle is specified in x, y, width, height * format and appropriate clipping is performed as per the method - * dimAdd. + * {@code dimAdd}. *

          * This method can also be used to initialize a simple rectangular * region. @@ -637,7 +637,7 @@ public class Region { * object with the specified Region object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getIntersection(B); then a point will + * {@code C = A.getIntersection(B);} then a point will * be contained in {@code C} iff it is contained in both * {@code A} and {@code B}. *

          @@ -666,7 +666,7 @@ public class Region { * object with the specified Region object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getUnion(B); then a point will + * {@code C = A.getUnion(B);} then a point will * be contained in {@code C} iff it is contained in either * {@code A} or {@code B}. *

          @@ -693,7 +693,7 @@ public class Region { * specified Region object subtracted from this object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getDifference(B); then a point will + * {@code C = A.getDifference(B);} then a point will * be contained in {@code C} iff it is contained in * {@code A} but not contained in {@code B}. *

          @@ -717,7 +717,7 @@ public class Region { * object with the specified Region object. *

          * If {@code A} and {@code B} are both Region Objects and - * C = A.getExclusiveOr(B); then a point will + * {@code C = A.getExclusiveOr(B);} then a point will * be contained in {@code C} iff it is contained in either * {@code A} or {@code B}, but not if it is contained in both. *

          diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java index f9dc262f17c..d33db33ec5c 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pipe/RenderQueue.java @@ -115,7 +115,7 @@ public abstract class RenderQueue { /** * Attempts to lock the queue. If successful, this method returns true, * indicating that the caller is responsible for calling - * unlock; otherwise this method returns false. + * {@code unlock}; otherwise this method returns false. */ public final boolean tryLock() { return SunToolkit.awtTryLock(); diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java index 386e4ea4377..c7855d6b9e9 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Dasher.java @@ -28,9 +28,9 @@ package sun.java2d.pisces; import sun.awt.geom.PathConsumer2D; /** - * The Dasher class takes a series of linear commands - * (moveTo, lineTo, close and - * end) and breaks them into smaller segments according to a + * The {@code Dasher} class takes a series of linear commands + * ({@code moveTo}, {@code lineTo}, {@code close} and + * {@code end}) and breaks them into smaller segments according to a * dash pattern array and a starting dash phase. * *

          Issues: in J2Se, a zero length dash segment as drawn as a very @@ -60,11 +60,11 @@ final class Dasher implements sun.awt.geom.PathConsumer2D { private float[] curCurvepts; /** - * Constructs a Dasher. + * Constructs a {@code Dasher}. * - * @param out an output PathConsumer2D. - * @param dash an array of floats containing the dash pattern - * @param phase a float containing the dash phase + * @param out an output {@code PathConsumer2D}. + * @param dash an array of {@code float}s containing the dash pattern + * @param phase a {@code float} containing the dash phase */ public Dasher(PathConsumer2D out, float[] dash, float phase) { if (phase < 0) { diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java index 38a7fc2baf6..592348c0043 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Helpers.java @@ -239,18 +239,18 @@ final class Helpers { // QuadCurve2D don't provide them. /** * Subdivides the cubic curve specified by the coordinates - * stored in the src array at indices srcoff - * through (srcoff + 7) and stores the + * stored in the {@code src} array at indices {@code srcoff} + * through ({@code srcoff} + 7) and stores the * resulting two subdivided curves into the two result arrays at the * corresponding indices. - * Either or both of the left and right - * arrays may be null or a reference to the same array - * as the src array. + * Either or both of the {@code left} and {@code right} + * arrays may be {@code null} or a reference to the same array + * as the {@code src} array. * Note that the last point in the first subdivided curve is the * same as the first point in the second subdivided curve. Thus, - * it is possible to pass the same array for left - * and right and to use offsets, such as rightoff - * equals (leftoff + 6), in order + * it is possible to pass the same array for {@code left} + * and {@code right} and to use offsets, such as {@code rightoff} + * equals ({@code leftoff} + 6), in order * to avoid allocating extra storage for this common point. * @param src the array holding the coordinates for the source curve * @param srcoff the offset into the array of the beginning of the diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java index 6d4a4c75ac5..4480286fae8 100644 --- a/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java +++ b/jdk/src/java.desktop/share/classes/sun/java2d/pisces/Stroker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -99,16 +99,16 @@ final class Stroker implements PathConsumer2D { private final PolyStack reverse = new PolyStack(); /** - * Constructs a Stroker. + * Constructs a {@code Stroker}. * - * @param pc2d an output PathConsumer2D. + * @param pc2d an output {@code PathConsumer2D}. * @param lineWidth the desired line width in pixels * @param capStyle the desired end cap style, one of - * CAP_BUTT, CAP_ROUND or - * CAP_SQUARE. + * {@code CAP_BUTT}, {@code CAP_ROUND} or + * {@code CAP_SQUARE}. * @param joinStyle the desired line join style, one of - * JOIN_MITER, JOIN_ROUND or - * JOIN_BEVEL. + * {@code JOIN_MITER}, {@code JOIN_ROUND} or + * {@code JOIN_BEVEL}. * @param miterLimit the desired miter limit */ public Stroker(PathConsumer2D pc2d, @@ -193,11 +193,11 @@ final class Stroker implements PathConsumer2D { // The sign of the dot product of mx,my and omx,omy is equal to the // the sign of the cosine of ext // (ext is the angle between omx,omy and mx,my). - double cosext = omx * mx + omy * my; + final float cosext = omx * mx + omy * my; // If it is >=0, we know that abs(ext) is <= 90 degrees, so we only // need 1 curve to approximate the circle section that joins omx,omy // and mx,my. - final int numCurves = cosext >= 0 ? 1 : 2; + final int numCurves = (cosext >= 0f) ? 1 : 2; switch (numCurves) { case 1: @@ -242,14 +242,22 @@ final class Stroker implements PathConsumer2D { final float mx, final float my, boolean rev) { - float cosext2 = (omx * mx + omy * my) / (2 * lineWidth2 * lineWidth2); + final float cosext2 = (omx * mx + omy * my) / (2f * lineWidth2 * lineWidth2); + + // check round off errors producing cos(ext) > 1 and a NaN below + // cos(ext) == 1 implies colinear segments and an empty join anyway + if (cosext2 >= 0.5f) { + // just return to avoid generating a flat curve: + return; + } + // cv is the length of P1-P0 and P2-P3 divided by the radius of the arc // (so, cv assumes the arc has radius 1). P0, P1, P2, P3 are the points that // define the bezier curve we're computing. // It is computed using the constraints that P1-P0 and P3-P2 are parallel // to the arc tangents at the endpoints, and that |P1-P0|=|P3-P2|. - float cv = (float) ((4.0 / 3.0) * sqrt(0.5-cosext2) / - (1.0 + sqrt(cosext2+0.5))); + float cv = (float) ((4.0 / 3.0) * sqrt(0.5 - cosext2) / + (1.0 + sqrt(cosext2 + 0.5))); // if clockwise, we need to negate cv. if (rev) { // rev is equivalent to isCW(omx, omy, mx, my) cv = -cv; diff --git a/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java b/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java index a08c06bac58..3b29183e2f4 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java +++ b/jdk/src/java.desktop/share/classes/sun/print/DialogOwner.java @@ -82,7 +82,7 @@ public final class DialogOwner * instance. *

          * For class DialogOwner the category name is - * "dialog-owner". + * {@code "dialog-owner"}. * * @return Attribute category name. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java index 1b00d4b7851..2e4bea56f55 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PSPathGraphics.java @@ -72,8 +72,8 @@ class PSPathGraphics extends PathGraphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -115,19 +115,19 @@ class PSPathGraphics extends PathGraphics { } /** - * Renders the text specified by the specified String, - * using the current Font and Paint attributes - * in the Graphics2D context. + * Renders the text specified by the specified {@code String}, + * using the current {@code Font} and {@code Paint} attributes + * in the {@code Graphics2D} context. * The baseline of the first character is at position * (xy) in the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script systems + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script systems * such as Hebrew and Arabic, the glyphs can be rendered from right to * left, in which case the coordinate supplied is the location of the * leftmost character on the baseline. - * @param str the String to be rendered - * @param x, y the coordinates where the String + * @param str the {@code String} to be rendered + * @param x, y the coordinates where the {@code String} * should be rendered * @see #setPaint * @see java.awt.Graphics#setColor @@ -248,16 +248,16 @@ class PSPathGraphics extends PathGraphics { } /** - * The various drawImage() methods for - * WPathGraphics are all decomposed - * into an invocation of drawImageToPlatform. + * The various {@code drawImage()} methods for + * {@code WPathGraphics} are all decomposed + * into an invocation of {@code drawImageToPlatform}. * The portion of the passed in image defined by - * srcX, srcY, srcWidth, and srcHeight + * {@code srcX, srcY, srcWidth, and srcHeight} * is transformed by the supplied AffineTransform and * drawn using PS to the printer context. * * @param image The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform Used to transform the image before drawing. * This can be null. * @param bgcolor This color is drawn where the image has transparent @@ -730,7 +730,7 @@ class PSPathGraphics extends PathGraphics { /* - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in current user space. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java index ad30841d0a7..b22fe72880d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PSPrinterJob.java @@ -116,14 +116,14 @@ public class PSPrinterJob extends RasterPrinterJob { /* Class Constants */ /** - * Passed to the setFillMode + * Passed to the {@code setFillMode} * method this value forces fills to be * done using the even-odd fill rule. */ protected static final int FILL_EVEN_ODD = 1; /** - * Passed to the setFillMode + * Passed to the {@code setFillMode} * method this value forces fills to be * done using the non-zero winding rule. */ @@ -294,14 +294,14 @@ public class PSPrinterJob extends RasterPrinterJob { /** * This string holds the PostScript operator to * be used to fill a path. It can be changed - * by the setFillMode method. + * by the {@code setFillMode} method. */ private String mFillOpStr = WINDING_FILL_STR; /** * This string holds the PostScript operator to * be used to clip to a path. It can be changed - * by the setFillMode method. + * by the {@code setFillMode} method. */ private String mClipOpStr = WINDING_CLIP_STR; @@ -876,14 +876,14 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Convert the 24 bit BGR image buffer represented by - * image to PostScript. The image is drawn at - * (destX, destY) in device coordinates. + * {@code image} to PostScript. The image is drawn at + * {@code (destX, destY)} in device coordinates. * The image is scaled into a square of size - * specified by destWidth and - * destHeight. The portion of the + * specified by {@code destWidth} and + * {@code destHeight}. The portion of the * source image copied into that square is specified - * by srcX, srcY, - * srcWidth, and srcHeight. + * by {@code srcX}, {@code srcY}, + * {@code srcWidth}, and srcHeight. */ protected void drawImageBGR(byte[] bgrData, float destX, float destY, @@ -1026,14 +1026,14 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Examine the metrics captured by the - * PeekGraphics instance and + * {@code PeekGraphics} instance and * if capable of directly converting this * print job to the printer's control language * or the native OS's graphics primitives, then - * return a PSPathGraphics to perform + * return a {@code PSPathGraphics} to perform * that conversion. If there is not an object * capable of the conversion then return - * null. Returning null + * {@code null}. Returning {@code null} * causes the print job to be rasterized. */ @@ -1349,8 +1349,8 @@ public class PSPrinterJob extends RasterPrinterJob { } /** * Set the current path rule to be either - * FILL_EVEN_ODD (using the - * even-odd file rule) or FILL_WINDING + * {@code FILL_EVEN_ODD} (using the + * even-odd file rule) or {@code FILL_WINDING} * (using the non-zero winding rule.) */ protected void setFillMode(int fillRule) { @@ -1375,7 +1375,7 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Set the printer's current color to be that - * defined by color + * defined by {@code color} */ protected void setColor(Color color) { mLastColor = color; @@ -1418,7 +1418,7 @@ public class PSPrinterJob extends RasterPrinterJob { /** * Generate PostScript to move the current pen - * position to (x, y). + * position to {@code (x, y)}. */ protected void moveTo(float x, float y) { @@ -1437,7 +1437,7 @@ public class PSPrinterJob extends RasterPrinterJob { } /** * Generate PostScript to draw a line from the - * current pen position to (x, y). + * current pen position to {@code (x, y)}. */ protected void lineTo(float x, float y) { @@ -1861,7 +1861,7 @@ public class PSPrinterJob extends RasterPrinterJob { } /** - * Given a Java2D PathIterator instance, + * Given a Java2D {@code PathIterator} instance, * this method translates that into a PostScript path.. */ void convertToPSPath(PathIterator pathIter) { @@ -1926,7 +1926,7 @@ public class PSPrinterJob extends RasterPrinterJob { } /* - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in current user space. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java index 467ed39fe9d..c36f8cb9f78 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PathGraphics.java @@ -177,9 +177,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws the outline of the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width. + * {@code x} and x + width. * The top and bottom edges are at - * y and y + height. + * {@code y} and y + height. * The rectangle is drawn using the graphics context's current color. * @param x the x coordinate * of the rectangle to be drawn. @@ -211,12 +211,12 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -251,7 +251,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -271,9 +271,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -296,9 +296,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -320,8 +320,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -359,8 +359,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -368,7 +368,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -403,8 +403,8 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -412,7 +412,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -478,16 +478,16 @@ public abstract class PathGraphics extends ProxyGraphics2D { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -500,7 +500,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** * Draws the outline of a polygon defined by the specified - * Polygon object. + * {@code Polygon} object. * @param p the polygon to draw. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -513,19 +513,19 @@ public abstract class PathGraphics extends ProxyGraphics2D { * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ @@ -1089,7 +1089,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { } /** - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in device coordinates. */ @@ -1097,7 +1097,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { /* * Set the clipping path to that defined by - * the passed in PathIterator. + * the passed in {@code PathIterator}. */ protected abstract void deviceClip(PathIterator pathIter); @@ -1326,16 +1326,16 @@ public abstract class PathGraphics extends ProxyGraphics2D { /** - * The various drawImage() methods for - * PathGraphics are all decomposed - * into an invocation of drawImageToPlatform. + * The various {@code drawImage()} methods for + * {@code PathGraphics} are all decomposed + * into an invocation of {@code drawImageToPlatform}. * The portion of the passed in image defined by - * srcX, srcY, srcWidth, and srcHeight + * {@code srcX, srcY, srcWidth, and srcHeight} * is transformed by the supplied AffineTransform and * drawn using PS to the printer context. * * @param img The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform Used to transform the image before drawing. * This can be null. * @param bgcolor This color is drawn where the image has transparent @@ -1373,7 +1373,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -1405,9 +1405,9 @@ public abstract class PathGraphics extends ProxyGraphics2D { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -1450,11 +1450,11 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param bgcolor the background color to paint under the @@ -1507,7 +1507,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1517,7 +1517,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * the image may be cached separately and generated from the original * data in a separate image production sequence. * @param img the specified image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param x the x coordinate. * @param y the y coordinate. * @param width the width of the rectangle. @@ -1566,7 +1566,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1628,7 +1628,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1642,7 +1642,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * mapped to the second destination coordinate. The subimage is * scaled and flipped as needed to preserve those mappings. * @param img the specified image to be drawn - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param dx1 the x coordinate of the first corner of the * destination rectangle. * @param dy1 the y coordinate of the first corner of the @@ -1767,7 +1767,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and composite attributes. Note that the result is * undefined, if the given transform is noninvertible. * @param img The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform The transformation from image space into user space. * @param obs The image observer to be notified as more of the image * is converted. @@ -1809,7 +1809,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * * @param op The filter to be applied to the image before drawing. * @param img The BufferedImage to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param x,y The location in user space where the image should be drawn. * @see #transform * @see #setTransform @@ -1853,7 +1853,7 @@ public abstract class PathGraphics extends ProxyGraphics2D { * and composite attributes. Note that the result is * undefined, if the given transform is noninvertible. * @param img The image to be drawn. - * This method does nothing if img is null. + * This method does nothing if {@code img} is null. * @param xform The transformation from image space into user space. * @see #transform * @see #setTransform diff --git a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java index 0e33bf191eb..b76321d84a3 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PeekGraphics.java @@ -162,8 +162,8 @@ public class PeekGraphics extends Graphics2D /* The Delegated Graphics Methods */ /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -444,7 +444,7 @@ public class PeekGraphics extends Graphics2D /** * Gets the current clipping area. - * @return a Shape object representing the + * @return a {@code Shape} object representing the * current clipping area. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -459,12 +459,12 @@ public class PeekGraphics extends Graphics2D /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects which implement the Shape + * Not all objects which implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects which are guaranteed to be - * supported are Shape objects which are - * obtained via the getClip method and via - * Rectangle objects. + * {@code Shape} objects which are guaranteed to be + * supported are {@code Shape} objects which are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -477,16 +477,16 @@ public class PeekGraphics extends Graphics2D /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -520,12 +520,12 @@ public class PeekGraphics extends Graphics2D /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -551,7 +551,7 @@ public class PeekGraphics extends Graphics2D *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -573,9 +573,9 @@ public class PeekGraphics extends Graphics2D /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -597,9 +597,9 @@ public class PeekGraphics extends Graphics2D /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -621,8 +621,8 @@ public class PeekGraphics extends Graphics2D /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -665,8 +665,8 @@ public class PeekGraphics extends Graphics2D * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -674,7 +674,7 @@ public class PeekGraphics extends Graphics2D *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -701,8 +701,8 @@ public class PeekGraphics extends Graphics2D /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -710,7 +710,7 @@ public class PeekGraphics extends Graphics2D *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -767,16 +767,16 @@ public class PeekGraphics extends Graphics2D * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -796,19 +796,19 @@ public class PeekGraphics extends Graphics2D * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) * @since 1.0 @@ -931,7 +931,7 @@ public class PeekGraphics extends Graphics2D * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -976,9 +976,9 @@ public class PeekGraphics extends Graphics2D * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -1027,7 +1027,7 @@ public class PeekGraphics extends Graphics2D * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -1078,7 +1078,7 @@ public class PeekGraphics extends Graphics2D * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1127,7 +1127,7 @@ public class PeekGraphics extends Graphics2D * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1199,7 +1199,7 @@ public class PeekGraphics extends Graphics2D * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1304,10 +1304,10 @@ public class PeekGraphics extends Graphics2D /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

          - * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1316,12 +1316,12 @@ public class PeekGraphics extends Graphics2D * may not run to completion for a long period of time. *

          * Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update @@ -1735,7 +1735,7 @@ public class PeekGraphics extends Graphics2D } /** - * Return true if the Rectangle rect + * Return true if the Rectangle {@code rect} * intersects the area into which the application * has drawn. */ diff --git a/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java b/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java index 9b5aae6899d..7f023f30d1d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PeekMetrics.java @@ -52,9 +52,9 @@ public class PeekMetrics { private boolean mHasImages; /** - * Return true if the application + * Return {@code true} if the application * has done any drawing with a Paint that - * is not an instance of Color + * is not an instance of {@code Color} */ public boolean hasNonSolidColors() { return mHasNonSolidColors; @@ -119,7 +119,7 @@ public class PeekMetrics { /** * The application is drawing text - * defined by TextLayout + * defined by {@code TextLayout} * so record the needed information. */ public void drawText(Graphics2D g, TextLayout textLayout) { @@ -164,7 +164,7 @@ public class PeekMetrics { /** * Record information about drawing done - * with the supplied Paint. + * with the supplied {@code Paint}. */ private void checkPaint(Paint paint) { @@ -179,7 +179,7 @@ public class PeekMetrics { /** * Record information about drawing done - * with the supplied Composite. + * with the supplied {@code Composite}. */ private void checkAlpha(Composite composite) { diff --git a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java index 9b7de159322..975e52ab86d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java +++ b/jdk/src/java.desktop/share/classes/sun/print/PrintJob2D.java @@ -928,23 +928,23 @@ public class PrintJob2D extends PrintJob implements Printable, Runnable { /** * Prints the page at the specified index into the specified * {@link Graphics} context in the specified - * format. A PrinterJob calls the - * Printable interface to request that a page be + * format. A {@code PrinterJob} calls the + * {@code Printable} interface to request that a page be * rendered into the context specified by - * graphics. The format of the page to be drawn is - * specified by pageFormat. The zero based index - * of the requested page is specified by pageIndex. + * {@code graphics}. The format of the page to be drawn is + * specified by {@code pageFormat}. The zero based index + * of the requested page is specified by {@code pageIndex}. * If the requested page does not exist then this method returns * NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned. - * The Graphics class or subclass implements the + * The {@code Graphics} class or subclass implements the * {@link java.awt.PrintGraphics} interface to provide additional - * information. If the Printable object + * information. If the {@code Printable} object * aborts the print job then it throws a {@link PrinterException}. * @param graphics the context into which the page is drawn * @param pageFormat the size and orientation of the page being drawn * @param pageIndex the zero based index of the page to be drawn * @return PAGE_EXISTS if the page is rendered successfully - * or NO_SUCH_PAGE if pageIndex specifies a + * or NO_SUCH_PAGE if {@code pageIndex} specifies a * non-existent page. * @exception java.awt.print.PrinterException * thrown when the print job is terminated. diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java index 9bb3bd254c1..eefb49ee75a 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics.java @@ -63,8 +63,8 @@ public class ProxyGraphics extends Graphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. */ @@ -73,28 +73,28 @@ public class ProxyGraphics extends Graphics { } /** - * Creates a new Graphics object based on this - * Graphics object, but with a new translation and clip area. - * The new Graphics object has its origin + * Creates a new {@code Graphics} object based on this + * {@code Graphics} object, but with a new translation and clip area. + * The new {@code Graphics} object has its origin * translated to the specified point (xy). * Its clip area is determined by the intersection of the original * clip area with the specified rectangle. The arguments are all * interpreted in the coordinate system of the original - * Graphics object. The new graphics context is + * {@code Graphics} object. The new graphics context is * identical to the original, except in two respects: *

          *

            *
          • * The new graphics context is translated by (xy). - * That is to say, the point (00) in the + * That is to say, the point ({@code 0}, {@code 0}) in the * new graphics context is the same as (xy) in * the original graphics context. *
          • * The new graphics context has an additional clipping rectangle, in * addition to whatever (translated) clipping rectangle it inherited * from the original graphics context. The origin of the new clipping - * rectangle is at (00), and its size - * is specified by the width and height + * rectangle is at ({@code 0}, {@code 0}), and its size + * is specified by the {@code width} and {@code height} * arguments. *
          *

          @@ -231,12 +231,12 @@ public class ProxyGraphics extends Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. + * cleared using {@code setClip(null)}, this method returns + * {@code null}. * The coordinates in the rectangle are relative to the coordinate * system origin of this graphics context. * @return the bounding rectangle of the current clipping area, - * or null if no clip is set. + * or {@code null} if no clip is set. * @see java.awt.Graphics#getClip * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -252,7 +252,7 @@ public class ProxyGraphics extends Graphics { * The resulting clipping area is the intersection of the current * clipping area and the specified rectangle. If there is no * current clipping area, either because the clip has never been - * set, or the clip has been cleared using setClip(null), + * set, or the clip has been cleared using {@code setClip(null)}, * the specified rectangle becomes the new clip. * This method sets the user clip, which is independent of the * clipping associated with device bounds and window visibility. @@ -293,10 +293,10 @@ public class ProxyGraphics extends Graphics { * This method returns the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns - * null. - * @return a Shape object representing the - * current clipping area, or null if + * cleared using {@code setClip(null)}, this method returns + * {@code null}. + * @return a {@code Shape} object representing the + * current clipping area, or {@code null} if * no clip is set. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -310,15 +310,15 @@ public class ProxyGraphics extends Graphics { /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects that implement the Shape + * Not all objects that implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects that are guaranteed to be - * supported are Shape objects that are - * obtained via the getClip method and via - * Rectangle objects. This method sets the + * {@code Shape} objects that are guaranteed to be + * supported are {@code Shape} objects that are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. This method sets the * user clip, which is independent of the clipping associated * with device bounds and window visibility. - * @param clip the Shape to use to set the clip + * @param clip the {@code Shape} to use to set the clip * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -330,16 +330,16 @@ public class ProxyGraphics extends Graphics { /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -368,12 +368,12 @@ public class ProxyGraphics extends Graphics { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -391,9 +391,9 @@ public class ProxyGraphics extends Graphics { /** * Draws the outline of the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width. + * {@code x} and x + width. * The top and bottom edges are at - * y and y + height. + * {@code y} and y + height. * The rectangle is drawn using the graphics context's current color. * @param x the x coordinate * of the rectangle to be drawn. @@ -415,7 +415,7 @@ public class ProxyGraphics extends Graphics { *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -434,9 +434,9 @@ public class ProxyGraphics extends Graphics { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -455,9 +455,9 @@ public class ProxyGraphics extends Graphics { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -520,8 +520,8 @@ public class ProxyGraphics extends Graphics { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -557,8 +557,8 @@ public class ProxyGraphics extends Graphics { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -566,7 +566,7 @@ public class ProxyGraphics extends Graphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -598,8 +598,8 @@ public class ProxyGraphics extends Graphics { /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -607,7 +607,7 @@ public class ProxyGraphics extends Graphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -659,16 +659,16 @@ public class ProxyGraphics extends Graphics { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -680,7 +680,7 @@ public class ProxyGraphics extends Graphics { /** * Draws the outline of a polygon defined by the specified - * Polygon object. + * {@code Polygon} object. * @param p the polygon to draw. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -693,19 +693,19 @@ public class ProxyGraphics extends Graphics { * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) */ @@ -805,7 +805,7 @@ public class ProxyGraphics extends Graphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -835,9 +835,9 @@ public class ProxyGraphics extends Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -877,7 +877,7 @@ public class ProxyGraphics extends Graphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -913,7 +913,7 @@ public class ProxyGraphics extends Graphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -953,7 +953,7 @@ public class ProxyGraphics extends Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1014,7 +1014,7 @@ public class ProxyGraphics extends Graphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1068,10 +1068,10 @@ public class ProxyGraphics extends Graphics { /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

          - * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1080,12 +1080,12 @@ public class ProxyGraphics extends Graphics { * may not run to completion for a long period of time. *

          * Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update @@ -1103,8 +1103,8 @@ public class ProxyGraphics extends Graphics { } /** - * Returns a String object representing this - * Graphics object's value. + * Returns a {@code String} object representing this + * {@code Graphics} object's value. * @return a string representation of this graphics context. */ public String toString() { @@ -1113,7 +1113,7 @@ public class ProxyGraphics extends Graphics { /** * @deprecated As of JDK version 1.1, - * replaced by getClipBounds(). + * replaced by {@code getClipBounds()}. */ @Deprecated public Rectangle getClipRect() { @@ -1144,8 +1144,8 @@ public class ProxyGraphics extends Graphics { * This method refers to the user clip, which is independent of the * clipping associated with device bounds and window visibility. * If no clip has previously been set, or if the clip has been - * cleared using setClip(null), this method returns the - * specified Rectangle. + * cleared using {@code setClip(null)}, this method returns the + * specified {@code Rectangle}. * @param r the rectangle where the current clipping area is * copied to. Any current values in this rectangle are * overwritten. diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java index 57f8ec876b3..6ded8e98eab 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyGraphics2D.java @@ -111,8 +111,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /* The Delegated Graphics Methods */ /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -380,7 +380,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Gets the current clipping area. - * @return a Shape object representing the + * @return a {@code Shape} object representing the * current clipping area. * @see java.awt.Graphics#getClipBounds * @see java.awt.Graphics#clipRect @@ -395,12 +395,12 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Sets the current clipping area to an arbitrary clip shape. - * Not all objects which implement the Shape + * Not all objects which implement the {@code Shape} * interface can be used to set the clip. The only - * Shape objects which are guaranteed to be - * supported are Shape objects which are - * obtained via the getClip method and via - * Rectangle objects. + * {@code Shape} objects which are guaranteed to be + * supported are {@code Shape} objects which are + * obtained via the {@code getClip} method and via + * {@code Rectangle} objects. * @see java.awt.Graphics#getClip() * @see java.awt.Graphics#clipRect * @see java.awt.Graphics#setClip(int, int, int, int) @@ -413,16 +413,16 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Copies an area of the component by a distance specified by - * dx and dy. From the point specified - * by x and y, this method + * {@code dx} and {@code dy}. From the point specified + * by {@code x} and {@code y}, this method * copies downwards and to the right. To copy an area of the * component to the left or upwards, specify a negative value for - * dx or dy. + * {@code dx} or {@code dy}. * If a portion of the source rectangle lies outside the bounds * of the component, or is obscured by another window or component, - * copyArea will be unable to copy the associated + * {@code copyArea} will be unable to copy the associated * pixels. The area that is omitted can be refreshed by calling - * the component's paint method. + * the component's {@code paint} method. * @param x the x coordinate of the source rectangle. * @param y the y coordinate of the source rectangle. * @param width the width of the source rectangle. @@ -454,12 +454,12 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Fills the specified rectangle. * The left and right edges of the rectangle are at - * x and x + width - 1. + * {@code x} and x + width - 1. * The top and bottom edges are at - * y and y + height - 1. + * {@code y} and y + height - 1. * The resulting rectangle covers an area - * width pixels wide by - * height pixels tall. + * {@code width} pixels wide by + * {@code height} pixels tall. * The rectangle is filled using the graphics context's current color. * @param x the x coordinate * of the rectangle to be filled. @@ -482,7 +482,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { *

          * Beginning with Java 1.1, the background color * of offscreen images may be system dependent. Applications should - * use setColor followed by fillRect to + * use {@code setColor} followed by {@code fillRect} to * ensure that an offscreen image is cleared to a specific color. * @param x the x coordinate of the rectangle to clear. * @param y the y coordinate of the rectangle to clear. @@ -502,9 +502,9 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Draws an outlined round-cornered rectangle using this graphics * context's current color. The left and right edges of the rectangle - * are at x and x + width, + * are at {@code x} and x + width, * respectively. The top and bottom edges of the rectangle are at - * y and y + height. + * {@code y} and y + height. * @param x the x coordinate of the rectangle to be drawn. * @param y the y coordinate of the rectangle to be drawn. * @param width the width of the rectangle to be drawn. @@ -524,9 +524,9 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Fills the specified rounded corner rectangle with the current color. * The left and right edges of the rectangle - * are at x and x + width - 1, + * are at {@code x} and x + width - 1, * respectively. The top and bottom edges of the rectangle are at - * y and y + height - 1. + * {@code y} and y + height - 1. * @param x the x coordinate of the rectangle to be filled. * @param y the y coordinate of the rectangle to be filled. * @param width the width of the rectangle to be filled. @@ -546,8 +546,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Draws the outline of an oval. * The result is a circle or ellipse that fits within the - * rectangle specified by the x, y, - * width, and height arguments. + * rectangle specified by the {@code x}, {@code y}, + * {@code width}, and {@code height} arguments. *

          * The oval covers an area that is * width + 1 pixels wide @@ -585,8 +585,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * Draws the outline of a circular or elliptical arc * covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees, using the current color. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees, using the current color. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -594,7 +594,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -619,8 +619,8 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Fills a circular or elliptical arc covering the specified rectangle. *

          - * The resulting arc begins at startAngle and extends - * for arcAngle degrees. + * The resulting arc begins at {@code startAngle} and extends + * for {@code arcAngle} degrees. * Angles are interpreted such that 0 degrees * is at the 3 o'clock position. * A positive value indicates a counter-clockwise rotation @@ -628,7 +628,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { *

          * The center of the arc is the center of the rectangle whose origin * is (xy) and whose size is specified by the - * width and height arguments. + * {@code width} and {@code height} arguments. *

          * The resulting arc covers an area * width + 1 pixels wide @@ -672,16 +672,16 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * arrays of x and y coordinates. * Each pair of (xy) coordinates defines a point. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#fillPolygon * @see java.awt.Graphics#drawPolyline @@ -696,19 +696,19 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * Fills a closed polygon defined by * arrays of x and y coordinates. *

          - * This method draws the polygon defined by nPoint line + * This method draws the polygon defined by {@code nPoint} line * segments, where the first nPoint - 1 * line segments are line segments from * (xPoints[i - 1], yPoints[i - 1]) * to (xPoints[i], yPoints[i]), for - * 1 ≤ i ≤ nPoints. + * 1 ≤ i ≤ {@code nPoints}. * The figure is automatically closed by drawing a line connecting * the final point to the first point, if those points are different. *

          * The area inside the polygon is defined using an * even-odd fill rule, also known as the alternating rule. - * @param xPoints a an array of x coordinates. - * @param yPoints a an array of y coordinates. + * @param xPoints a an array of {@code x} coordinates. + * @param yPoints a an array of {@code y} coordinates. * @param nPoints a the total number of points. * @see java.awt.Graphics#drawPolygon(int[], int[], int) * @since 1.0 @@ -796,7 +796,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -828,9 +828,9 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies - * the image observer by calling its imageUpdate method. + * the image observer by calling its {@code imageUpdate} method. *

          * A scaled version of an image will not necessarily be * available immediately just because an unscaled version of the @@ -872,7 +872,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * and converted for the current output device. *

          * If the image has not yet been completely loaded, then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. * @param img the specified image to be drawn. @@ -923,7 +923,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * entire image has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -978,7 +978,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1038,7 +1038,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * image area to be drawn has not yet been scaled, dithered, and converted * for the current output device. * If the current output representation is not yet complete then - * drawImage returns false. As more of + * {@code drawImage} returns {@code false}. As more of * the image becomes available, the process that draws the image notifies * the specified image observer. *

          @@ -1106,7 +1106,7 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { } /** - * Return true if drawing img will + * Return true if drawing {@code img} will * invoke a Java2D bug (#4258675). The bug in question * occurs when a draw image call with a background color * parameter tries to render a sheared @@ -1126,14 +1126,14 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { } /** - * Return a new BufferedImage + * Return a new {@code BufferedImage} * that contains a copy of the provided - * Image where its + * {@code Image} where its * transparent pixels have been replaced by - * bgcolor. If the new - * BufferedImage can not be created, + * {@code bgcolor}. If the new + * {@code BufferedImage} can not be created, * probably because the original image has not - * finished loading, then null is + * finished loading, then {@code null} is * returned. */ private BufferedImage getBufferedImageCopy(Image img, Color bgcolor) { @@ -1232,10 +1232,10 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { /** * Disposes of this graphics context and releases * any system resources that it is using. - * A Graphics object cannot be used after - * disposehas been called. + * A {@code Graphics} object cannot be used after + * {@code dispose} has been called. *

          - * When a Java program runs, a large number of Graphics + * When a Java program runs, a large number of {@code Graphics} * objects can be created within a short time frame. * Although the finalization process of the garbage collector * also disposes of the same system resources, it is preferable @@ -1244,12 +1244,12 @@ public class ProxyGraphics2D extends Graphics2D implements PrinterGraphics { * may not run to completion for a long period of time. *

          * Graphics objects which are provided as arguments to the - * paint and update methods + * {@code paint} and {@code update} methods * of components are automatically released by the system when * those methods return. For efficiency, programmers should - * call dispose when finished using - * a Graphics object only if it was created - * directly from a component or another Graphics object. + * call {@code dispose} when finished using + * a {@code Graphics} object only if it was created + * directly from a component or another {@code Graphics} object. * @see java.awt.Graphics#finalize * @see java.awt.Component#paint * @see java.awt.Component#update diff --git a/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java b/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java index f46caed3ea3..49480707019 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java +++ b/jdk/src/java.desktop/share/classes/sun/print/ProxyPrintGraphics.java @@ -54,8 +54,8 @@ public class ProxyPrintGraphics extends ProxyGraphics } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. */ @@ -65,8 +65,8 @@ public class ProxyPrintGraphics extends ProxyGraphics /** - * Creates a new Graphics object based on this - * Graphics object, but with a new translation and + * Creates a new {@code Graphics} object based on this + * {@code Graphics} object, but with a new translation and * clip area. * Refer to * {@link sun.print.ProxyGraphics#create(int, int, int, int)} diff --git a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java index 585e6e495b8..1ffb6a18e1d 100644 --- a/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java +++ b/jdk/src/java.desktop/share/classes/sun/print/RasterPrinterJob.java @@ -431,7 +431,7 @@ public abstract class RasterPrinterJob extends PrinterJob { /* * A convenience method which returns the default service - * for 2D PrinterJobs. + * for 2D {@code PrinterJob}s. * May return null if there is no suitable default (although there * may still be 2D services available). * @return default 2D print service, or null. @@ -495,9 +495,9 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Associate this PrinterJob with a new PrintService. * - * Throws PrinterException if the specified service - * cannot support the Pageable and - * Printable interfaces necessary to support 2D printing. + * Throws {@code PrinterException} if the specified service + * cannot support the {@code Pageable} and + * {@code Printable} interfaces necessary to support 2D printing. * @param service print service which supports 2D printing. * * @throws PrinterException if the specified service does not support @@ -694,17 +694,17 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Display a dialog to the user allowing the modification of a * PageFormat instance. - * The page argument is used to initialize controls + * The {@code page} argument is used to initialize controls * in the page setup dialog. * If the user cancels the dialog, then the method returns the - * original page object unmodified. + * original {@code page} object unmodified. * If the user okays the dialog then the method returns a new * PageFormat object with the indicated changes. - * In either case the original page object will + * In either case the original {@code page} object will * not be modified. * @param page the default PageFormat presented to the user * for modification - * @return the original page object if the dialog + * @return the original {@code page} object if the dialog * is cancelled, or a new PageFormat object containing * the format indicated by the user if the dialog is * acknowledged @@ -2350,14 +2350,14 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Examine the metrics captured by the - * PeekGraphics instance and + * {@code PeekGraphics} instance and * if capable of directly converting this * print job to the printer's control language * or the native OS's graphics primitives, then - * return a PathGraphics to perform + * return a {@code PathGraphics} to perform * that conversion. If there is not an object * capable of the conversion then return - * null. Returning null + * {@code null}. Returning {@code null} * causes the print job to be rasterized. */ protected Graphics2D createPathGraphics(PeekGraphics graphics, @@ -2372,11 +2372,11 @@ public abstract class RasterPrinterJob extends PrinterJob { /** * Create and return an object that will * gather and hold metrics about the print - * job. This method is passed a Graphics2D + * job. This method is passed a {@code Graphics2D} * object that can be used as a proxy for the * object gathering the print job matrics. The * method is also supplied with the instance - * controlling the print job, printerJob. + * controlling the print job, {@code printerJob}. */ protected PeekGraphics createPeekGraphics(Graphics2D graphics, PrinterJob printerJob) { diff --git a/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java b/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java index 98aa04c06c4..d87801fc683 100644 --- a/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java +++ b/jdk/src/java.desktop/share/classes/sun/swing/UIAction.java @@ -87,7 +87,7 @@ public abstract class UIAction implements Action { * Cover method for isEnabled(null). */ public final boolean isEnabled() { - return isEnabled(null); + return accept(null); } /** @@ -96,7 +96,8 @@ public abstract class UIAction implements Action { * * @param sender Widget enabled state is being asked for, may be null. */ - public boolean isEnabled(Object sender) { + @Override + public boolean accept(Object sender) { return true; } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java index 42dd34e6943..ecee8ade0bc 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java @@ -118,8 +118,8 @@ public abstract class UNIXToolkit extends SunToolkit * Load a native Gtk stock icon. * * @param longname a desktop property name. This contains icon name, size - * and orientation, e.g. "gtk.icon.gtk-add.4.rtl" - * @return an Image for the icon, or null if the + * and orientation, e.g. {@code "gtk.icon.gtk-add.4.rtl"} + * @return an {@code Image} for the icon, or {@code null} if the * icon could not be loaded */ protected Object lazilyLoadGTKIcon(String longname) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java index a476628e7c5..72aeb67a3f9 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java @@ -55,7 +55,7 @@ class MotifDnDDragSourceProtocol extends XDragSourceProtocol /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) { return new MotifDnDDragSourceProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java index e71236a6ff9..8d63906a664 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java @@ -62,7 +62,7 @@ class MotifDnDDropTargetProtocol extends XDropTargetProtocol { /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDropTargetProtocol createInstance(XDropTargetProtocolListener listener) { return new MotifDnDDropTargetProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java index e4d5b23ca76..470da61093f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/Native.java @@ -63,7 +63,7 @@ class Native { /** * Set of helper function to read data of different PLATFORM types - * from memory pointer by ptr + * from memory pointer by {@code ptr} * Note, names of types in function are NATIVE PLATFORM types * and they have the same size as they would have in C compiler * on the same platform. @@ -93,7 +93,7 @@ class Native { putByte(ptr+index, data); } /** - * Converts length bytes of data pointed by data into byte array + * Converts length bytes of data pointed by {@code data} into byte array * Returns null if data is zero * @param data native pointer to native memory * @param length size in bytes of native memory @@ -143,7 +143,7 @@ class Native { } /** - * Converts length usnigned bytes of data pointed by data into + * Converts length usnigned bytes of data pointed by {@code data} into * short array * Returns null if data is zero * @param data native pointer to native memory @@ -297,8 +297,8 @@ class Native { } /** * Stores to C long data(four bytes) - * Note: data has long type - * to be able to keep 64-bit C long data + * Note: {@code data} has {@code long} type + * to be able to keep 64-bit C {@code long} data */ static void putLong(long ptr, long data) { if (XlibWrapper.dataModel == 32) { @@ -320,7 +320,7 @@ class Native { } /** * Stores Java long[] array into memory. Memory location is treated as array - * of native longs + * of native {@code long}s */ static void put(long ptr, long[] arr) { for (int i = 0; i < arr.length; i ++, ptr += getLongSize()) { @@ -330,7 +330,7 @@ class Native { /** * Stores Java Vector of Longs into memory. Memory location is treated as array - * of native longs + * of native {@code long}s */ static void putLong(long ptr, Vector arr) { for (int i = 0; i < arr.size(); i ++, ptr += getLongSize()) { @@ -340,7 +340,7 @@ class Native { /** * Stores Java Vector of Longs into memory. Memory location is treated as array - * of native longs. Array is stored in reverse order + * of native {@code long}s. Array is stored in reverse order */ static void putLongReverse(long ptr, Vector arr) { for (int i = arr.size()-1; i >= 0; i--, ptr += getLongSize()) { @@ -348,7 +348,7 @@ class Native { } } /** - * Converts length bytes of data pointed by data into byte array + * Converts length bytes of data pointed by {@code data} into byte array * Returns null if data is zero * @param data native pointer to native memory * @param length size in longs(platform dependent) of native memory @@ -393,7 +393,7 @@ class Native { } /** - * Allocates memory for array of native longs of the size length + * Allocates memory for array of native {@code long}s of the size {@code length} */ static long allocateLongArray(int length) { return unsafe.allocateMemory(getLongSize() * length); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java index eeb46347b56..117e3865241 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtom.java @@ -29,28 +29,31 @@ package sun.awt.X11; * XAtom is a class that allows you to create and modify X Window properties. * An X Atom is an identifier for a property that you can set on any X Window. * Standard X Atom are defined by X11 and these atoms are defined in this class - * for convenience. Common X Atoms like XA_WM_NAME are used to communicate with the + * for convenience. Common X Atoms like {@code XA_WM_NAME} are used to communicate with the * Window manager to let it know the Window name. The use and protocol for these * atoms are defined in the Inter client communications converntions manual. * User specified XAtoms are defined by specifying a name that gets Interned - * by the XServer and an XAtom object is returned. An XAtom can also be created - * by using a pre-exisiting atom like XA_WM_CLASS. A display has to be specified - * in order to create an XAtom.

          + * by the XServer and an {@code XAtom} object is returned. An {@code XAtom} can also be created + * by using a pre-exisiting atom like {@code XA_WM_CLASS}. A {@code display} has to be specified + * in order to create an {@code XAtom}.

          * - * Once an XAtom instance is created, you can call get and set property methods to + * Once an {@code XAtom} instance is created, you can call get and set property methods to * set the values for a particular window.

          * * * Example usage : To set the window name for a top level:

          - * - * XAtom xa = new XAtom(display,XAtom.XA_WM_NAME);

          - * xa.setProperty(window,"Hello World");

          - *

          - *

          - * To get the cut buffer :

          - *

          - * XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);

          - * String selection = xa.getProperty(root_window);

          + *

          {@code
          + * XAtom xa = new XAtom(display,XAtom.XA_WM_NAME);
          + * xa.setProperty(window,"Hello World");
          + * }
          + *

          + *

          + * To get the cut buffer: + *

          {@code
          + * XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);
          + * String selection = xa.getProperty(root_window);
          + * }
          + * * @author Bino George * @since 1.5 */ @@ -237,7 +240,7 @@ public final class XAtom { } /** This constructor will create an instance of XAtom that is specified - * by the predefined XAtom specified by u latom + * by the predefined XAtom specified by u {@code latom} * * @param display X display to use. * @param atom a predefined XAtom. @@ -250,7 +253,7 @@ public final class XAtom { } /** This constructor will create the instance, - * and if autoIntern is true intern a new XAtom that is specified + * and if {@code autoIntern} is true intern a new XAtom that is specified * by the supplied name. * * @param display X display to use @@ -450,7 +453,7 @@ public final class XAtom { /** * Gets uninterpreted set of data from property and stores them in data_ptr. - * Property type is type, property is current atom. + * Property type is {@code type}, property is current atom. * Property format is 32. Property 'delete' is false. * Returns boolean if requested type, format, length match returned values * and returned data pointer is not null. @@ -505,7 +508,7 @@ public final class XAtom { /** * Sets uninterpreted set of data into property from data_ptr. - * Property type is type, property is current atom. + * Property type is {@code type}, property is current atom. * Property format is 32. Mode is PropModeReplace. length is a number * of items pointer by data_ptr. */ @@ -526,7 +529,7 @@ public final class XAtom { /** * Sets uninterpreted set of data into property from data_ptr. - * Property type is type, property is current atom. + * Property type is {@code type}, property is current atom. * Property format is 8. Mode is PropModeReplace. length is a number * of bytes pointer by data_ptr. */ @@ -784,7 +787,7 @@ public final class XAtom { } /** - * Sets property on the window to the value window_value + * Sets property on the {@code window} to the value {@code window_value} * Property is assumed to be of type WINDOW/32 */ public void setWindowProperty(long window, long window_value) { @@ -807,7 +810,7 @@ public final class XAtom { } /** - * Gets property on the window. Property is assumed to be + * Gets property on the {@code window}. Property is assumed to be * of type WINDOW/32. */ public long getWindowProperty(long window) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java index a998850eb4c..624c7040694 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAtomList.java @@ -41,7 +41,7 @@ class XAtomList { /** * Creates instance of XAtomList and initializes it with - * the contents pointer by data. + * the contents pointer by {@code data}. * Uses default display to initialize atoms. */ public XAtomList(long data, int count) { @@ -90,7 +90,7 @@ class XAtomList { } /** - * Returns true if this list contains the atom atom + * Returns true if this list contains the atom {@code atom} */ public boolean contains(XAtom atom) { return atoms.contains(atom); @@ -119,8 +119,8 @@ class XAtomList { } /** - * Returns a subset of a list which is intersection of this set and set build by mapping mask in - * mapping. + * Returns a subset of a list which is intersection of this set and set build by mapping {@code mask} in + * {@code mapping}. */ public XAtomList subset(int mask, Map mapping) { XAtomList res = new XAtomList(); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java index 94cb9fdacaf..c8534aa36e3 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XBaseWindow.java @@ -170,7 +170,7 @@ public class XBaseWindow { } /** - * Creates window using parameters params + * Creates window using parameters {@code params} * If params contain flag DELAYED doesn't do anything. * Note: Descendants can call this method to create the window * at the time different to instance construction. @@ -316,7 +316,7 @@ public class XBaseWindow { } /** - * Creates window with parameters specified by params + * Creates window with parameters specified by {@code params} * @see #init */ private final void create(XCreateWindowParams params) { @@ -691,7 +691,7 @@ public class XBaseWindow { XToolkit.awtLock(); try { XAtom xa = XAtom.get(XAtom.XA_WM_CLASS); - xa.setProperty8(getWindow(), cl[0] + '\0' + cl[1]); + xa.setProperty8(getWindow(), cl[0] + '\0' + cl[1] + '\0'); } finally { XToolkit.awtUnlock(); } diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java index e1331c7fdd0..82715e73ff2 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java @@ -680,7 +680,7 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget * Gets the font metrics for the specified font. * @param font the font for which font metrics is to be * obtained - * @return the font metrics for font + * @return the font metrics for {@code font} * @see #getFont * @see java.awt.peer.ComponentPeer#getFontMetrics(Font) * @see Toolkit#getFontMetrics(Font) @@ -724,8 +724,8 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget /* * The method changes the cursor. - * @param cursor - a new cursor to change to. - * @param ignoreSubComponents - if {@code true} is passed then + * @param cursor a new cursor to change to. + * @param ignoreSubComponents if {@code true} is passed then * the new cursor will be installed on window. * if {@code false} is passed then * subsequent components will try to handle diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java index abe706a3652..72a34cf85f8 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDesktopPeer.java @@ -39,7 +39,7 @@ import java.util.List; /** - * Concrete implementation of the interface DesktopPeer for + * Concrete implementation of the interface {@code DesktopPeer} for * the Gnome desktop on Linux and Unix platforms. * * @see DesktopPeer diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java index 26265be30bc..fc60ec97fa8 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDragSourceProtocol.java @@ -55,7 +55,7 @@ class XDnDDragSourceProtocol extends XDragSourceProtocol { /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDragSourceProtocol createInstance(XDragSourceProtocolListener listener) { return new XDnDDragSourceProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java index e1698a424b8..f2e7b62c9f1 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDnDDropTargetProtocol.java @@ -70,7 +70,7 @@ class XDnDDropTargetProtocol extends XDropTargetProtocol { /** * Creates an instance associated with the specified listener. * - * @throws NullPointerException if listener is null. + * @throws NullPointerException if listener is {@code null}. */ static XDropTargetProtocol createInstance(XDropTargetProtocolListener listener) { return new XDnDDropTargetProtocol(listener); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java index 48e611b627a..c8ecb422611 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceProtocol.java @@ -74,7 +74,7 @@ abstract class XDragSourceProtocol { * Initializes a drag operation with the specified supported drop actions, * contents and data formats. * - * @param actions a bitwise mask of DnDConstants that represent + * @param actions a bitwise mask of {@code DnDConstants} that represent * the supported drop actions. * @param contents the contents for the drag operation. * @param formats an array of Atoms that represent the supported data formats. diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java index 9b37a429125..1bbae4f91f9 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbedServerTester.java @@ -570,7 +570,7 @@ public class XEmbedServerTester implements XEventDispatcher { } } /** - * Checks if the event is already in a list at position >= position + * Checks if the {@code event} is already in a list at position >= {@code position} */ private int checkEventList(int position, int event) { if (position == -1) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java index 97a997958ec..6f7b733c82f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRepaintArea.java @@ -33,7 +33,7 @@ import sun.awt.AWTAccessor; import sun.awt.RepaintArea; /** - * The RepaintArea is a geometric construct created for the + * The {@code RepaintArea} is a geometric construct created for the * purpose of holding the geometry of several coalesced paint events. * This geometry is accessed synchronously, although it is written such * that painting may still be executed asynchronously. @@ -43,7 +43,7 @@ import sun.awt.RepaintArea; final class XRepaintArea extends RepaintArea { /** - * Calls Component.update(Graphics) with given Graphics. + * Calls {@code Component.update(Graphics)} with given Graphics. */ protected void updateComponent(Component comp, Graphics g) { if (comp != null) { @@ -54,7 +54,7 @@ final class XRepaintArea extends RepaintArea { } /** - * Calls Component.paint(Graphics) with given Graphics. + * Calls {@code Component.paint(Graphics)} with given Graphics. */ protected void paintComponent(Component comp, Graphics g) { if (comp != null) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java index 6d8473cb47c..368d034687e 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java @@ -31,6 +31,7 @@ import sun.awt.AWTAccessor; import sun.awt.SunToolkit; import sun.awt.UNIXToolkit; import sun.awt.X11GraphicsConfig; +import sun.awt.X11GraphicsEnvironment; class XRobotPeer implements RobotPeer { @@ -64,7 +65,14 @@ class XRobotPeer implements RobotPeer { @Override public void mouseMove(int x, int y) { - mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y)); + X11GraphicsEnvironment x11ge = (X11GraphicsEnvironment) + GraphicsEnvironment.getLocalGraphicsEnvironment(); + if(x11ge.runningXinerama()) { + Rectangle sb = xgc.getBounds(); + mouseMoveImpl(xgc, xgc.scaleUp(x + sb.x), xgc.scaleUp(y + sb.y)); + } else { + mouseMoveImpl(xgc, xgc.scaleUp(x), xgc.scaleUp(y)); + } } @Override diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java index 2fb074855d5..0a9a70487df 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XSelection.java @@ -110,7 +110,7 @@ final class XSelection { /* * Returns the XSelection object for the specified selection atom or - * null if none exists. + * {@code null} if none exists. */ static XSelection getSelection(XAtom atom) { return table.get(atom); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java index 72bbc348045..84defe3a912 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XStateProtocol.java @@ -30,7 +30,7 @@ public interface XStateProtocol { /** * Returns whether or not the protocol supports the transition to the state - * represented by state. State contains encoded state + * represented by {@code state}. {@code State} contains encoded state * as a bit mask of state defined in java.awt.Frame */ boolean supportsState(int state); diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java index 428d1d27d55..9efe70b17c4 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextAreaPeer.java @@ -127,7 +127,7 @@ final class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { int end = target.getSelectionEnd(); // Fix for 5100200 // Restoring Motif behaviour - // Since the end position of the selected text can be greater then the length of the text, + // Since the end position of the selected text can be greater than the length of the text, // so we should set caret to max position of the text setCaretPosition(Math.min(end, text.length())); if (end > start) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java index b936b6bb26a..9df078e9d1f 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java @@ -83,7 +83,7 @@ final class XTextFieldPeer extends XComponentPeer implements TextFieldPeer { int end = target.getSelectionEnd(); // Fix for 5100200 // Restoring Motif behaviour - // Since the end position of the selected text can be greater then the length of the text, + // Since the end position of the selected text can be greater than the length of the text, // so we should set caret to max position of the text setCaretPosition(Math.min(end, text.length())); if (end > start) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java index 7297ef72287..d79df149f6d 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java @@ -407,7 +407,7 @@ public final class XToolkit extends UNIXToolkit implements Runnable { /** * Returns whether there is last remembered cursor position. The * position is remembered from X mouse events on our peers. The - * position is stored in p. + * position is stored in {@code p}. * @return true, if there is remembered last cursor position, * false otherwise */ @@ -1680,11 +1680,11 @@ public final class XToolkit extends UNIXToolkit implements Runnable { /** * Callback from the native side indicating some, or all, of the * desktop properties have changed and need to be reloaded. - * data is the byte array directly from the x server and + * {@code data} is the byte array directly from the x server and * may be in little endian format. *

          * NB: This could be called from any thread if triggered by - * loadXSettings. It is called from the System EDT + * {@code loadXSettings}. It is called from the System EDT * if triggered by an XSETTINGS change. */ void parseXSettings(int screen_XXX_ignored,Map updatedSettings) { @@ -1941,16 +1941,16 @@ public final class XToolkit extends UNIXToolkit implements Runnable { static native void wakeup_poll(); /** - * Registers a Runnable which run() method will be called + * Registers a Runnable which {@code run()} method will be called * once on the toolkit thread when a specified interval of time elapses. * - * @param task a Runnable which run method will be called - * on the toolkit thread when interval milliseconds + * @param task a Runnable which {@code run} method will be called + * on the toolkit thread when {@code interval} milliseconds * elapse * @param interval an interal in milliseconds * - * @throws NullPointerException if task is null - * @throws IllegalArgumentException if interval is not positive + * @throws NullPointerException if {@code task} is {@code null} + * @throws IllegalArgumentException if {@code interval} is not positive */ static void schedule(Runnable task, long interval) { if (task == null) { diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java index 77fb29d3a97..862508ccfcf 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java @@ -1622,7 +1622,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, * @param transientForWindow the top-level window * @param updateChain specifies if next/prevTransientFor fields are * to be updated - * @param allStates if set to true then TRANSIENT_FOR hint + * @param allStates if set to {@code true} then TRANSIENT_FOR hint * is set regardless of the state of window and transientForWindow, * otherwise it is set only if both are in the same state */ diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java b/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java index 59fb9a08ad2..812255ea850 100644 --- a/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java +++ b/jdk/src/java.desktop/unix/classes/sun/awt/XSettings.java @@ -44,13 +44,13 @@ public class XSettings { /** - * Update these settings with data obtained from + * Update these settings with {@code data} obtained from * XSETTINGS manager. * * @param data settings data obtained from - * _XSETTINGS_SETTINGS window property of the + * {@code _XSETTINGS_SETTINGS} window property of the * settings manager. - * @return a Map of changed settings. + * @return a {@code Map} of changed settings. */ public Map update(byte[] data) { return (new Update(data)).update(); @@ -84,10 +84,10 @@ public class XSettings { /** * Construct an Update object for the data read from - * _XSETTINGS_SETTINGS property of the XSETTINGS + * {@code _XSETTINGS_SETTINGS} property of the XSETTINGS * selection owner. * - * @param data _XSETTINGS_SETTINGS contents. + * @param data {@code _XSETTINGS_SETTINGS} contents. */ Update(byte[] data) { this.data = data; diff --git a/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java index ca225f6df5a..b30b6459c3b 100644 --- a/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java +++ b/jdk/src/java.desktop/unix/classes/sun/font/NativeFont.java @@ -64,7 +64,7 @@ public class NativeFont extends PhysicalFont { /** * Verifies native font is accessible. - * @throws FontFormatException - if the font can't be located. + * @throws FontFormatException if the font can't be located. */ public NativeFont(String platName, boolean bitmapDelegate) throws FontFormatException { diff --git a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c index 07588c80f5e..00d04814e86 100644 --- a/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c +++ b/jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c @@ -221,8 +221,10 @@ wcstombsdmp(wchar_t *wcs, int len) } /* TODO: check return values... Handle invalid characters properly... */ - if (wcstombs(mbs, wcs, n) == (size_t)-1) + if (wcstombs(mbs, wcs, n) == (size_t)-1) { + free(mbs); return NULL; + } return mbs; } diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java index 4773934e39e..a13c1ff1d50 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/Win32GraphicsConfig.java @@ -94,7 +94,7 @@ public class Win32GraphicsConfig extends GraphicsConfiguration /** * @deprecated as of JDK version 1.3 - * replaced by getConfig() + * replaced by {@code getConfig()} */ @Deprecated public Win32GraphicsConfig(GraphicsDevice device, int visualnum) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java index 8e32e39acc8..dab4129ade5 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java @@ -350,12 +350,12 @@ final class Win32ShellFolder2 extends ShellFolder { /** * This method is implemented to make sure that no instances - * of ShellFolder are ever serialized. If isFileSystem() returns - * true, then the object is representable with an instance of - * java.io.File instead. If not, then the object depends + * of {@code ShellFolder} are ever serialized. If {@code isFileSystem()} returns + * {@code true}, then the object is representable with an instance of + * {@code java.io.File} instead. If not, then the object depends * on native PIDL state and should not be serialized. * - * @return a java.io.File replacement object. If the folder + * @return a {@code java.io.File} replacement object. If the folder * is a not a normal directory, then returns the first non-removable * drive (normally "C:\"). */ @@ -718,7 +718,7 @@ final class Win32ShellFolder2 extends ShellFolder { /** * @return An array of shell folders that are children of this shell folder * object. The array will be empty if the folder is empty. Returns - * null if this shellfolder does not denote a directory. + * {@code null} if this shellfolder does not denote a directory. */ public File[] listFiles(final boolean includeHiddenFiles) { SecurityManager security = System.getSecurityManager(); @@ -1091,7 +1091,7 @@ final class Win32ShellFolder2 extends ShellFolder { } /** - * Gets an icon from the Windows system icon list as an Image + * Gets an icon from the Windows system icon list as an {@code Image} */ static Image getSystemIcon(SystemIcon iconType) { long hIcon = getSystemIcon(iconType.getIconID()); @@ -1101,7 +1101,7 @@ final class Win32ShellFolder2 extends ShellFolder { } /** - * Gets an icon from the Windows system icon list as an Image + * Gets an icon from the Windows system icon list as an {@code Image} */ static Image getShell32Icon(int iconID, boolean getLargeIcon) { boolean useVGAColors = true; // Will be ignored on XP and later diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java index e87379a58f0..b01d04443df 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java @@ -225,24 +225,24 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { private static File[] roots; /** - * @param key a String + * @param key a {@code String} * "fileChooserDefaultFolder": - * Returns a File - the default shellfolder for a new filechooser + * Returns a {@code File} - the default shellfolder for a new filechooser * "roots": - * Returns a File[] - containing the root(s) of the displayable hierarchy + * Returns a {@code File[]} - containing the root(s) of the displayable hierarchy * "fileChooserComboBoxFolders": - * Returns a File[] - an array of shellfolders representing the list to + * Returns a {@code File[]} - an array of shellfolders representing the list to * show by default in the file chooser's combobox * "fileChooserShortcutPanelFolders": - * Returns a File[] - an array of shellfolders representing well-known + * Returns a {@code File[]} - an array of shellfolders representing well-known * folders, such as Desktop, Documents, History, Network, Home, etc. * This is used in the shortcut panel of the filechooser on Windows 2000 * and Windows Me. * "fileChooserIcon ": - * Returns an Image - icon can be ListView, DetailsView, UpFolder, NewFolder or + * Returns an {@code Image} - icon can be ListView, DetailsView, UpFolder, NewFolder or * ViewMenu (Windows only). * "optionPaneIcon iconName": - * Returns an Image - icon from the system icon list + * Returns an {@code Image} - icon from the system icon list * * @return An Object matching the key string. */ @@ -415,7 +415,7 @@ final class Win32ShellFolderManager2 extends ShellFolderManager { } /** - * Does dir represent a "computer" such as a node on the network, or + * Does {@code dir} represent a "computer" such as a node on the network, or * "My Computer" on the desktop. */ public boolean isComputerNode(final File dir) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java index c3d68c7442c..b745e9d41ae 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WDesktopPeer.java @@ -34,7 +34,7 @@ import java.net.URI; /** - * Concrete implementation of the interface DesktopPeer for + * Concrete implementation of the interface {@code DesktopPeer} for * the Windows platform. * * @see DesktopPeer diff --git a/jdk/src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WMouseInfoPeer.java similarity index 82% rename from jdk/src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java rename to jdk/src/java.desktop/windows/classes/sun/awt/windows/WMouseInfoPeer.java index 9ac06c4b8bf..e5bef4fe1b9 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/DefaultMouseInfoPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WMouseInfoPeer.java @@ -23,18 +23,24 @@ * questions. */ -package sun.awt; +package sun.awt.windows; +import java.awt.GraphicsEnvironment; import java.awt.Point; import java.awt.Window; import java.awt.peer.MouseInfoPeer; -public final class DefaultMouseInfoPeer implements MouseInfoPeer { +public final class WMouseInfoPeer implements MouseInfoPeer { + + static { + // initialize screen devices for the mouse coordinates scaling + GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); + } /** * Package-private constructor to prevent instantiation. */ - DefaultMouseInfoPeer() { + WMouseInfoPeer() { } public native int fillPointWithCoords(Point point); diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java index f892a88bf6c..b7508fc290e 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java @@ -116,8 +116,8 @@ final class WPathGraphics extends PathGraphics { } /** - * Creates a new Graphics object that is - * a copy of this Graphics object. + * Creates a new {@code Graphics} object that is + * a copy of this {@code Graphics} object. * @return a new graphics context that is a copy of * this graphics context. * @since 1.0 @@ -375,19 +375,19 @@ final class WPathGraphics extends PathGraphics { } /** - * Renders the text specified by the specified String, - * using the current Font and Paint attributes - * in the Graphics2D context. + * Renders the text specified by the specified {@code String}, + * using the current {@code Font} and {@code Paint} attributes + * in the {@code Graphics2D} context. * The baseline of the first character is at position * (xy) in the User Space. - * The rendering attributes applied include the Clip, - * Transform, Paint, Font and - * Composite attributes. For characters in script systems + * The rendering attributes applied include the {@code Clip}, + * {@code Transform}, {@code Paint}, {@code Font} and + * {@code Composite} attributes. For characters in script systems * such as Hebrew and Arabic, the glyphs can be rendered from right to * left, in which case the coordinate supplied is the location of the * leftmost character on the baseline. - * @param str the String to be rendered - * @param x, y the coordinates where the String + * @param str the {@code String} to be rendered + * @param x, y the coordinates where the {@code String} * should be rendered * @see #setPaint * @see java.awt.Graphics#setColor @@ -914,11 +914,11 @@ final class WPathGraphics extends PathGraphics { } /** - * The various drawImage() methods for - * WPathGraphics are all decomposed - * into an invocation of drawImageToPlatform. + * The various {@code drawImage()} methods for + * {@code WPathGraphics} are all decomposed + * into an invocation of {@code drawImageToPlatform}. * The portion of the passed in image defined by - * srcX, srcY, srcWidth, and srcHeight + * {@code srcX, srcY, srcWidth, and srcHeight} * is transformed by the supplied AffineTransform and * drawn using GDI to the printer context. * @@ -1379,7 +1379,7 @@ final class WPathGraphics extends PathGraphics { /** * Have the printing application redraw everything that falls - * within the page bounds defined by region. + * within the page bounds defined by {@code region}. */ @Override public void redrawRegion(Rectangle2D region, double scaleX, double scaleY, @@ -1479,7 +1479,7 @@ final class WPathGraphics extends PathGraphics { } /* - * Fill the path defined by pathIter + * Fill the path defined by {@code pathIter} * with the specified color. * The path is provided in device coordinates. */ @@ -1495,7 +1495,7 @@ final class WPathGraphics extends PathGraphics { /* * Set the printer device's clip to be the - * path defined by pathIter + * path defined by {@code pathIter} * The path is provided in device coordinates. */ @Override @@ -1719,7 +1719,7 @@ final class WPathGraphics extends PathGraphics { /** - * Given a Java2D PathIterator instance, + * Given a Java2D {@code PathIterator} instance, * this method translates that into a Window's path * in the printer device context. */ diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java index 3506e4e6331..89c28502411 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java @@ -336,13 +336,13 @@ public final class WPrinterJob extends RasterPrinterJob /** * The last color set into the print device context or - * null if no color has been set. + * {@code null} if no color has been set. */ private Color mLastColor; /** * The last text color set into the print device context or - * null if no color has been set. + * {@code null} if no color has been set. */ private Color mLastTextColor; @@ -402,17 +402,17 @@ public final class WPrinterJob extends RasterPrinterJob /** * Display a dialog to the user allowing the modification of a * PageFormat instance. - * The page argument is used to initialize controls + * The {@code page} argument is used to initialize controls * in the page setup dialog. * If the user cancels the dialog, then the method returns the - * original page object unmodified. + * original {@code page} object unmodified. * If the user okays the dialog then the method returns a new * PageFormat object with the indicated changes. - * In either case the original page object will + * In either case the original {@code page} object will * not be modified. * @param page the default PageFormat presented to the user * for modification - * @return the original page object if the dialog + * @return the original {@code page} object if the dialog * is cancelled, or a new PageFormat object containing * the format indicated by the user if the dialog is * acknowledged @@ -588,8 +588,8 @@ public final class WPrinterJob extends RasterPrinterJob /** * Associate this PrinterJob with a new PrintService. * - * Throws PrinterException if the specified service - * cannot support the Pageable and + * Throws {@code PrinterException} if the specified service + * cannot support the {@code Pageable} and * Printable interfaces necessary to support 2D printing. * @param service print service which supports 2D printing. * @@ -763,14 +763,14 @@ public final class WPrinterJob extends RasterPrinterJob /** * Examine the metrics captured by the - * PeekGraphics instance and + * {@code PeekGraphics} instance and * if capable of directly converting this * print job to the printer's control language * or the native OS's graphics primitives, then - * return a PathGraphics to perform + * return a {@code PathGraphics} to perform * that conversion. If there is not an object * capable of the conversion then return - * null. Returning null + * {@code null}. Returning {@code null} * causes the print job to be rasterized. */ @@ -976,9 +976,9 @@ public final class WPrinterJob extends RasterPrinterJob /** * Set the current polgon fill rule into the printer device context. - * The fillRule should + * The {@code fillRule} should * be one of the following Windows constants: - * ALTERNATE or WINDING. + * {@code ALTERNATE} or {@code WINDING}. */ protected void setPolyFillMode(int fillRule) { setPolyFillMode(getPrintDC(), fillRule); @@ -986,7 +986,7 @@ public final class WPrinterJob extends RasterPrinterJob /* * Create a Window's solid brush for the color specified - * by (red, green, blue). Once the brush + * by {@code (red, green, blue)}. Once the brush * is created, select it in the current printing device * context and free the old brush. */ @@ -1146,7 +1146,7 @@ public final class WPrinterJob extends RasterPrinterJob } /** - * Draw the string text to the printer's + * Draw the string {@code text} to the printer's * device context at the specified position. */ protected void textOut(String str, float x, float y, @@ -1166,7 +1166,7 @@ public final class WPrinterJob extends RasterPrinterJob } /** - * Draw the glyphs glyphs to the printer's + * Draw the glyphs {@code glyphs} to the printer's * device context at the specified position. */ protected void glyphsOut(int []glyphs, float x, float y, @@ -1208,15 +1208,15 @@ public final class WPrinterJob extends RasterPrinterJob /** * Draw the 24 bit BGR image buffer represented by - * image to the GDI device context - * printDC. The image is drawn at - * (destX, destY) in device coordinates. + * {@code image} to the GDI device context + * {@code printDC}. The image is drawn at + * {@code (destX, destY)} in device coordinates. * The image is scaled into a square of size - * specified by destWidth and - * destHeight. The portion of the + * specified by {@code destWidth} and + * {@code destHeight}. The portion of the * source image copied into that square is specified - * by srcX, srcY, - * srcWidth, and srcHeight. + * by {@code srcX}, {@code srcY}, + * {@code srcWidth}, and srcHeight. */ protected void drawImage3ByteBGR(byte[] image, float destX, float destY, @@ -1412,37 +1412,37 @@ public final class WPrinterJob extends RasterPrinterJob /** * Begin a Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void beginPath(long printDC); /** * End a Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void endPath(long printDC); /** * Close a subpath in a Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void closeFigure(long printDC); /** * Fill a defined Window's rendering path in the device - * context printDC. + * context {@code printDC}. */ protected native void fillPath(long printDC); /** - * Move the Window's pen position to (x,y) - * in the device context printDC. + * Move the Window's pen position to {@code (x,y)} + * in the device context {@code printDC}. */ protected native void moveTo(long printDC, float x, float y); /** * Draw a line from the current pen position to - * (x,y) in the device context printDC. + * {@code (x,y)} in the device context {@code printDC}. */ protected native void lineTo(long printDC, float x, float y); @@ -1453,17 +1453,17 @@ public final class WPrinterJob extends RasterPrinterJob /** * Set the current polgon fill rule into the device context - * printDC. The fillRule should + * {@code printDC}. The {@code fillRule} should * be one of the following Windows constants: - * ALTERNATE or WINDING. + * {@code ALTERNATE} or {@code WINDING}. */ protected native void setPolyFillMode(long printDC, int fillRule); /** * Create a Window's solid brush for the color specified - * by (red, green, blue). Once the brush + * by {@code (red, green, blue)}. Once the brush * is created, select it in the device - * context printDC and free the old brush. + * context {@code printDC} and free the old brush. */ protected native void selectSolidBrush(long printDC, int red, int green, int blue); @@ -1471,14 +1471,14 @@ public final class WPrinterJob extends RasterPrinterJob /** * Return the x coordinate of the current pen * position in the device context - * printDC. + * {@code printDC}. */ protected native int getPenX(long printDC); /** * Return the y coordinate of the current pen * position in the device context - * printDC. + * {@code printDC}. */ protected native int getPenY(long printDC); @@ -1537,8 +1537,8 @@ public final class WPrinterJob extends RasterPrinterJob /** - * Draw the string text into the device - * context printDC at the specified + * Draw the string {@code text} into the device + * context {@code printDC} at the specified * position. */ protected native void textOut(long printDC, String text, @@ -1550,15 +1550,15 @@ public final class WPrinterJob extends RasterPrinterJob /** * Draw the DIB compatible image buffer represented by - * image to the GDI device context - * printDC. The image is drawn at - * (destX, destY) in device coordinates. + * {@code image} to the GDI device context + * {@code printDC}. The image is drawn at + * {@code (destX, destY)} in device coordinates. * The image is scaled into a square of size - * specified by destWidth and - * destHeight. The portion of the + * specified by {@code destWidth} and + * {@code destHeight}. The portion of the * source image copied into that square is specified - * by srcX, srcY, - * srcWidth, and srcHeight. + * by {@code srcX}, {@code srcY}, + * {@code srcWidth}, and srcHeight. * Note that the image isn't completely compatible with DIB format. * At the very least it needs to be padded so each scanline is * DWORD aligned. Also we "flip" the image to make it a bottom-up DIB. diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java index fed3e231731..c7c463a8754 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java @@ -558,6 +558,16 @@ public final class WToolkit extends SunToolkit implements Runnable { return WKeyboardFocusManagerPeer.getInstance(); } + private static WMouseInfoPeer wPeer = null; + + @Override + public synchronized MouseInfoPeer getMouseInfoPeer() { + if (wPeer == null) { + wPeer = new WMouseInfoPeer(); + } + return wPeer; + } + private native void setDynamicLayoutNative(boolean b); @Override @@ -587,7 +597,7 @@ public final class WToolkit extends SunToolkit implements Runnable { } /** - * Returns true if this frame state is supported. + * Returns {@code true} if this frame state is supported. */ @Override public boolean isFrameStateSupported(int state) { diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java index 09b564f194e..b2828e2503f 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java @@ -180,7 +180,7 @@ final class WTrayIconPeer extends WObjectPeer implements TrayIconPeer { /* * Updates/adds the icon in/to the system tray. - * @param doUpdate if true, updates the icon, + * @param doUpdate if {@code true}, updates the icon, * otherwise, adds the icon */ native void updateNativeIcon(boolean doUpdate); diff --git a/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java b/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java index 9b9be888933..7a5c29c7c73 100644 --- a/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java +++ b/jdk/src/java.desktop/windows/classes/sun/font/NativeFont.java @@ -41,7 +41,7 @@ public class NativeFont extends PhysicalFont { /** * Verifies native font is accessible. - * @throws FontFormatException - if the font can't be located. + * @throws FontFormatException if the font can't be located. */ public NativeFont(String platName, boolean isBitmapDelegate) throws FontFormatException { diff --git a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java index 48f1dce490c..4b112b9fcc7 100644 --- a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java +++ b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DScreenUpdateManager.java @@ -140,8 +140,8 @@ public class D3DScreenUpdateManager extends ScreenUpdateManager * method returns GDI surface (we don't want to have two swap chains) * @param isResize whether this surface is being created in response to * a component resize event. This determines whether a repaint event will - * be issued after a surface is created: it will be if isResize - * is true. + * be issued after a surface is created: it will be if {@code isResize} + * is {@code true}. * @return surface data to be use for onscreen rendering */ @Override diff --git a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp index ac1acd491dd..0b670639783 100644 --- a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -508,8 +508,10 @@ D3DBlitTextureToSurface(D3DContext *d3dc, RETURN_STATUS_IF_NULL(srcOps->pResource, E_FAIL); RETURN_STATUS_IF_NULL(dstOps->pResource, E_FAIL); - if ((pSrc = srcOps->pResource->GetTexture()) == NULL || - FAILED(res = d3dc->BeginScene(STATE_TEXTUREOP) || + pSrc = srcOps->pResource->GetTexture(); + RETURN_STATUS_IF_NULL(pSrc, E_FAIL); + + if (FAILED(res = d3dc->BeginScene(STATE_TEXTUREOP) || FAILED(res = d3dc->SetTexture(pSrc)))) { J2dRlsTraceLn(J2D_TRACE_ERROR, diff --git a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp index 7bd843b93e6..4dde51b98e4 100644 --- a/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -355,7 +355,7 @@ D3DTR_UpdateCachedDestination(D3DContext *d3dc, D3DSDOps *dstOps, jint dx1, dy1, dx2, dy2; D3DResource *pCachedDestTexRes; IDirect3DSurface9 *pCachedDestSurface, *pDst; - HRESULT res; + HRESULT res = S_OK; if (isCachedDestValid && INSIDE(gx1, gy1, gx2, gy2, cachedDestBounds)) { // glyph is already within the cached destination bounds; no need diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp index e43f6ea3f5f..90cef5303cf 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp @@ -33,12 +33,12 @@ extern "C" { /* - * Class: sun_awt_DefaultMouseInfoPeer + * Class: sun_awt_windows_WMouseInfoPeer * Method: isWindowUnderMouse * Signature: (Ljava/awt/Window)Z */ JNIEXPORT jboolean JNICALL -Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse(JNIEnv *env, jclass cls, +Java_sun_awt_windows_WMouseInfoPeer_isWindowUnderMouse(JNIEnv *env, jclass cls, jobject window) { POINT pt; @@ -73,12 +73,12 @@ Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse(JNIEnv *env, jclass cls, } /* - * Class: sun_awt_DefaultMouseInfoPeer + * Class: sun_awt_windows_WMouseInfoPeer * Method: fillPointWithCoords * Signature: (Ljava/awt/Point)I */ JNIEXPORT jint JNICALL -Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls, jobject point) +Java_sun_awt_windows_WMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls, jobject point) { static jclass pointClass = NULL; static jfieldID xID, yID; @@ -95,7 +95,8 @@ Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords(JNIEnv *env, jclass cls, j env->DeleteLocalRef(pointClassLocal); } - int screen = AwtWin32GraphicsDevice::GetDefaultDeviceIndex(); + HMONITOR monitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); + int screen = AwtWin32GraphicsDevice::GetScreenFromHMONITOR(monitor); Devices::InstanceAccess devices; AwtWin32GraphicsDevice *device = devices->GetDevice(screen); diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp index b70048a9122..05273d41bad 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp @@ -686,6 +686,9 @@ JNIEXPORT jlong JNICALL Java_sun_awt_shell_Win32ShellFolder2_getLinkLocation case STRRET_WSTR : wstr = strret.pOleStr; break; + + default: + return NULL; } IShellLinkW* psl; diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp index a36db45b72f..d5224df0b62 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp @@ -2605,6 +2605,9 @@ AwtComponent::GetJavaModifiers() if (HIBYTE(::GetKeyState(VK_MENU)) != 0) { modifiers |= java_awt_event_InputEvent_ALT_DOWN_MASK; } + if (HIBYTE(::GetKeyState(VK_RMENU)) != 0) { + modifiers |= java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK; + } if (HIBYTE(::GetKeyState(VK_MBUTTON)) != 0) { modifiers |= java_awt_event_InputEvent_BUTTON2_DOWN_MASK; } @@ -5231,6 +5234,8 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) message = WM_MBUTTONDOWN; break; case java_awt_event_MouseEvent_BUTTON2: message = WM_RBUTTONDOWN; break; + default: + return; } break; } @@ -5242,6 +5247,8 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent) message = WM_MBUTTONUP; break; case java_awt_event_MouseEvent_BUTTON2: message = WM_RBUTTONUP; break; + default: + return; } break; } @@ -7302,4 +7309,4 @@ void ReleaseDCList(HWND hwnd, DCList &list) { removedDCs = removedDCs->next; delete tmpDCList; } -} \ No newline at end of file +} diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp index 21a4b0074ce..454a2fe74e4 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -388,7 +388,7 @@ void CheckFontSmoothingSettings(HWND hWnd) { } BOOL fontSmoothing = FALSE, settingsChanged; - UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder; + UINT fontSmoothingType=0, fontSmoothingContrast=0, subPixelOrder=0; if (firstTime) { SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fontSmoothing, 0); diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp index a8d7fd1bcb6..6a7e49dcce3 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -270,7 +270,7 @@ AwtFont* AwtFont::Create(JNIEnv *env, jobject font, jint angle, jfloat awScale) cfnum = 0; } - LPCWSTR wName; + LPCWSTR wName = NULL; awtFont = new AwtFont(cfnum, env, font); @@ -1202,7 +1202,7 @@ void AwtFontCache::IncRefCount(HFONT hFont){ } LONG AwtFontCache::IncRefCount(Item* item){ - LONG newVal; + LONG newVal = 0; if(NULL != item){ newVal = InterlockedIncrement((long*)&item->refCount); @@ -1211,7 +1211,7 @@ LONG AwtFontCache::IncRefCount(Item* item){ } LONG AwtFontCache::DecRefCount(Item* item){ - LONG newVal; + LONG newVal = 0; if(NULL != item){ newVal = InterlockedDecrement((long*)&item->refCount); diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp index e9a4167a6e1..ed8311ff3b3 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp @@ -156,7 +156,7 @@ AwtFrame* AwtFrame::Create(jobject self, jobject parent) PDATA pData; HWND hwndParent = NULL; - AwtFrame* frame; + AwtFrame* frame = NULL; jclass cls = NULL; jclass inputMethodWindowCls = NULL; jobject target = NULL; @@ -993,7 +993,9 @@ MsgRouting AwtFrame::WmActivate(UINT nState, BOOL fMinimized, HWND opposite) AwtComponent::SetFocusedWindow(GetHWnd()); } else { - if (!::IsWindow(AwtWindow::GetModalBlocker(opposite))) { + if (::IsWindow(AwtWindow::GetModalBlocker(opposite))) { + return mrConsume; + } else { // If deactivation happens because of press on grabbing // window - this is nonsense, since grabbing window is // assumed to have focus and watch for deactivation. But diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp index d755d5fc68d..722151cd864 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Label.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,15 +146,16 @@ void AwtLabel::DoPaint(HDC hDC, RECT& r) jint alignment = env->GetIntField(target, AwtLabel::alignmentID); switch (alignment) { - case java_awt_Label_LEFT: - x = r.left + 2; - break; case java_awt_Label_CENTER: x = (r.left + r.right - size.cx) / 2; break; case java_awt_Label_RIGHT: x = r.right - 2 - size.cx; break; + case java_awt_Label_LEFT: + default: + x = r.left + 2; + break; } /* draw string */ if (isEnabled()) { diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp index d904da8774b..53057bb4dbd 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1108,7 +1108,7 @@ Java_sun_awt_windows_WPrinterJob_initPrinter(JNIEnv *env, jobject self) { // check for collation HGLOBAL hDevNames = AwtPrintControl::getPrintHDName(env, self); if (hDevNames != NULL) { - DWORD dmFields; + DWORD dmFields = 0; DEVNAMES *devnames = (DEVNAMES *)::GlobalLock(hDevNames); if (devnames != NULL) { diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp index eaa8bca03d4..de60f0ed702 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,6 +129,7 @@ AwtTextComponent* AwtTextComponent::Create(jobject peer, jobject parent, BOOL is scroll_style = WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL; break; case java_awt_TextArea_SCROLLBARS_BOTH: + default: scroll_style = WS_VSCROLL | WS_HSCROLL | ES_AUTOVSCROLL | ES_AUTOHSCROLL; break; diff --git a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java index 24c848800fd..8d0083ff807 100644 --- a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java +++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java @@ -519,9 +519,13 @@ public class ManagementFactory { * {@code MBeanServerConnection} where * {@link java.io.IOException IOException} may be thrown * when the communication problem occurs with the connector server. - * An application remotely accesses the platform MXBeans using - * proxy should prepare to catch {@code IOException} as if - * accessing with the {@code MBeanServerConnector} interface. + * If thrown, {@link java.io.IOException IOException} will be wrappped in + * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException}. + * An application remotely accessing the platform MXBeans using + * proxy should prepare to catch {@code UndeclaredThrowableException} and + * handle its {@linkplain java.lang.reflect.UndeclaredThrowableException#getCause() cause} + * as if that cause had been thrown by the {@code MBeanServerConnection} + * interface. * *

        • When a client application is designed to remotely access MXBeans * for a running virtual machine whose version is different than @@ -530,7 +534,11 @@ public class ManagementFactory { * {@link java.io.InvalidObjectException InvalidObjectException} * which is thrown when an MXBean proxy receives a name of an * enum constant which is missing in the enum class loaded in - * the client application.
        • + * the client application. If thrown, + * {@link java.io.InvalidObjectException InvalidObjectException} will be + * wrappped in + * {@link java.lang.reflect.UndeclaredThrowableException UndeclaredThrowableException}. + * * *
        • {@link javax.management.MBeanServerInvocationHandler * MBeanServerInvocationHandler} or its diff --git a/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg b/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg index c120c5e3242..bd5539a0210 100644 --- a/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg +++ b/jdk/src/jdk.crypto.pkcs11/solaris/conf/security/sunpkcs11-solaris.cfg @@ -18,5 +18,6 @@ attributes = compatibility disabledMechanisms = { CKM_DSA_KEY_PAIR_GEN + SecureRandom } diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 08a1eb94c28..1b7cc2da8b5 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -315,6 +315,9 @@ javax/sound/midi/Gervill/SoftProvider/GetDevice.java generic-all ############################################################################ # jdk_imageio +javax/imageio/plugins/shared/CanWriteSequence.java generic-all +javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java generic-all +javax/imageio/plugins/tiff/WriteToSequenceAfterAbort.java generic-all ############################################################################ @@ -372,9 +375,6 @@ com/sun/jdi/GetLocalVariables4Test.sh windows-all # 8062512 java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.java generic-all -# 8076458 -java/util/stream/test/org/openjdk/tests/java/util/stream/FlatMapOpTest.java generic-all - # 8130337 java/util/stream/test/org/openjdk/tests/java/util/stream/IntPrimitiveOpsTests.java generic-all diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups index e608d9d98b5..f621295f82d 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -78,6 +78,7 @@ jdk_lang = \ sun/reflect \ jdk/lambda \ jdk/internal/misc \ + jdk/internal/ref \ vm # All of the java.util package diff --git a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java index b94644d1fd1..f6c82e21c3b 100644 --- a/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java +++ b/jdk/test/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * 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,8 +24,6 @@ /* * @test * @bug 8028994 - * @ignore 8147477 - * @ignore 8147494 * @author Staffan Larsen * @library /lib/testlibrary * @modules jdk.attach/sun.tools.attach @@ -73,7 +71,7 @@ public class CheckOrigin { Map env = pb.environment(); // "UseCMSGC" should be ignored. - env.put("_JAVA_OPTIONS", "-XX:+TraceExceptions -XX:+UseCMSGC"); + env.put("_JAVA_OPTIONS", "-XX:+CheckJNICalls -XX:+UseCMSGC"); // "UseGOneGC" should be ignored. env.put("JAVA_TOOL_OPTIONS", "-XX:+IgnoreUnrecognizedVMOptions " + "-XX:+PrintVMOptions -XX:+UseGOneGC"); @@ -101,7 +99,7 @@ public class CheckOrigin { // Set on the command line checkOrigin("UseCodeAging", Origin.VM_CREATION); // Set in _JAVA_OPTIONS - checkOrigin("TraceExceptions", Origin.ENVIRON_VAR); + checkOrigin("CheckJNICalls", Origin.ENVIRON_VAR); // Set in JAVA_TOOL_OPTIONS checkOrigin("IgnoreUnrecognizedVMOptions", Origin.ENVIRON_VAR); checkOrigin("PrintVMOptions", Origin.ENVIRON_VAR); diff --git a/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java b/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java index 5512e4febb5..bf2252832f8 100644 --- a/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java +++ b/jdk/test/java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java @@ -23,12 +23,12 @@ /* @test - @bug 6562853 - @summary Tests that focus transfered directy to window w/o transfering it to frame. - @author Oleg Sukhodolsky: area=awt.focus - @library ../../regtesthelpers - @build Util - @run main TranserFocusToWindow + @bug 6562853 7035459 + @summary Tests that focus transfered directy to window w/o transfering it to frame. + @author Oleg Sukhodolsky: area=awt.focus + @library ../../regtesthelpers + @build Util + @run main TranserFocusToWindow */ import java.awt.Button; @@ -44,10 +44,13 @@ import test.java.awt.regtesthelpers.Util; public class TranserFocusToWindow { + private static final int WIDTH = 300; + private static final int HEIGHT = 200; + public static void main(String[] args) { Robot robot = Util.createRobot(); Frame owner_frame = new Frame("Owner frame"); - owner_frame.setBounds(0, 0, 200, 200); + owner_frame.setBounds(0, 0, WIDTH, HEIGHT); owner_frame.setVisible(true); Util.waitForIdle(robot); @@ -55,7 +58,7 @@ public class TranserFocusToWindow Button btn1 = new Button("button for focus"); window.add(btn1); window.pack(); - window.setLocation(0, 300); + window.setLocation(0, HEIGHT + 100); window.setVisible(true); Util.waitForIdle(robot); @@ -63,17 +66,10 @@ public class TranserFocusToWindow Button btn2 = new Button("button in a frame"); another_frame.add(btn2); another_frame.pack(); - another_frame.setLocation(300, 0); + another_frame.setLocation(WIDTH + 100, 0); another_frame.setVisible(true); Util.waitForIdle(robot); - Util.clickOnTitle(owner_frame, robot); - Util.waitForIdle(robot); - - setFocus(btn1, robot); - - setFocus(btn2, robot); - owner_frame.addWindowFocusListener(new WindowFocusListener() { public void windowLostFocus(WindowEvent we) { System.out.println(we); @@ -100,6 +96,10 @@ public class TranserFocusToWindow } }); + Util.clickOnTitle(owner_frame, robot); + Util.waitForIdle(robot); + setFocus(btn1, robot); + setFocus(btn2, robot); // we need this delay so WM can not treat two clicks on title as double click robot.delay(500); Util.clickOnTitle(owner_frame, robot); diff --git a/jdk/test/java/awt/FontClass/DrawStringWithInfiniteXform.java b/jdk/test/java/awt/FontClass/DrawStringWithInfiniteXform.java new file mode 100644 index 00000000000..bd23226cb54 --- /dev/null +++ b/jdk/test/java/awt/FontClass/DrawStringWithInfiniteXform.java @@ -0,0 +1,78 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 8023213 + * @summary Font/Text APIs should not crash/takes long time + * if transform includes INIFINITY + * @run main DrawStringWithInfiniteXform + */ +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.image.*; +import java.util.Timer; +import java.util.TimerTask; + +public class DrawStringWithInfiniteXform { + Timer timer; + boolean done; + class ScheduleTask extends TimerTask { + public void run() { + timer.cancel(); + if (!done) { + throw new + RuntimeException("drawString with InfiniteXform transform takes long time"); + } + } + } + public DrawStringWithInfiniteXform() { + timer = new Timer(); + timer.schedule(new ScheduleTask(), 10000); + } + + public static void main(String [] args) { + DrawStringWithInfiniteXform test = new DrawStringWithInfiniteXform(); + test.start(); + } + + private void start() { + float[] vals = new float[6]; + for (int i=0;i<6;i++) vals[i]=Float.POSITIVE_INFINITY; + AffineTransform nanTX = new AffineTransform(vals); + + BufferedImage bi = new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = bi.createGraphics(); + + g2d.rotate(Float.POSITIVE_INFINITY); + Font font = g2d.getFont(); + Font xfiniteFont; + for (int i=0; i<2000; i++) { + xfiniteFont = font.deriveFont(Float.POSITIVE_INFINITY); + g2d.setFont(xfiniteFont); + g2d.drawString("abc", 20, 20); + } + done = true; + System.out.println("Test passed"); + } +} diff --git a/jdk/test/java/awt/FontClass/NaNTransform.java b/jdk/test/java/awt/FontClass/NaNTransform.java new file mode 100644 index 00000000000..ab525ec2d2c --- /dev/null +++ b/jdk/test/java/awt/FontClass/NaNTransform.java @@ -0,0 +1,92 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/** + * @test + * @bug 6357987 6513889 8023213 + * @summary Font/Text APIs should not crash if transform includes NaN + * @author prr + * @run main NaNTransform + */ +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.image.*; + +public class NaNTransform { + + private static void testShape(String msg, Shape s) { + if (!(new Area(s).isEmpty())) { + System.out.println(msg+"="+s); + throw new RuntimeException("Warning: expected this to be empty"); + } + } + + public static void main(String [] args) { + + float NaN=0f/0f; + float[] vals = new float[6]; + for (int i=0;i<6;i++) vals[i]=NaN; + AffineTransform nanTX = new AffineTransform(vals); + + BufferedImage bi = new BufferedImage(1,1,BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = bi.createGraphics(); + + g2d.rotate(NaN); + + Font font = g2d.getFont(); + FontMetrics fm = g2d.getFontMetrics(); + FontRenderContext frc = g2d.getFontRenderContext(); + + int adv = fm.stringWidth("ABCDEF"); + if (adv != 0) { + System.out.println("strWidth="+adv); + throw new RuntimeException("Warning: expected this to be zero"); + } + testShape("strBounds", font.getStringBounds("12345", frc)); + + TextLayout tl = new TextLayout("Some text", font, frc); + testShape("tl PixelBounds 1", tl.getPixelBounds(frc, 20, 10)); + testShape("tl PixelBounds 2", tl.getPixelBounds(frc, NaN, NaN)); + testShape("tl Outline", tl.getOutline(nanTX)); + + GlyphVector gv = font.createGlyphVector(frc, "abcdef"); + testShape("gv PixelBounds 1", gv.getPixelBounds(frc, 0, 0)); + testShape("gv PixelBounds 2", gv.getPixelBounds(frc, NaN, NaN)); + testShape("gv Outline", gv.getOutline(NaN, NaN)); + + gv.setGlyphTransform(0, nanTX); + testShape("gv PixelBounds 1A", gv.getPixelBounds(frc, 0, 0)); + testShape("gv PixelBounds 2A", gv.getPixelBounds(frc, NaN, NaN)); + testShape("gv Outline A", gv.getOutline(NaN, NaN)); + + g2d.drawString("BOO!", 20, 20); + + Font nanFont; + for (int i=0; i<5000; i++) { + nanFont = font.deriveFont(Float.NaN); + g2d.setFont(nanFont); + g2d.drawString("abc", 20, 20); + } + System.out.println("Test passed (no crash)"); + } +} diff --git a/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java b/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java index e0da056b035..0b295470328 100644 --- a/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java +++ b/jdk/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java @@ -32,7 +32,7 @@ import java.awt.Robot; /** * @test - * @bug 8007219 + * @bug 8007219 8146168 * @author Alexander Scherbatiy * @summary Frame size reverts meaning of maximized attribute * @run main MaximizedToMaximized @@ -41,7 +41,8 @@ public class MaximizedToMaximized { public static void main(String[] args) throws Exception { - Frame frame = new Frame(); + Frame frame = new Frame(); + Robot robot = new Robot(); final Toolkit toolkit = Toolkit.getDefaultToolkit(); final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment(); @@ -62,13 +63,15 @@ public class MaximizedToMaximized { frame.setBounds(availableScreenBounds.x, availableScreenBounds.y, availableScreenBounds.width, availableScreenBounds.height); frame.setVisible(true); + robot.waitForIdle(); Rectangle frameBounds = frame.getBounds(); frame.setExtendedState(Frame.MAXIMIZED_BOTH); - Robot robot = new Robot(); robot.waitForIdle(); Rectangle maximizedFrameBounds = frame.getBounds(); + + frame.dispose(); if (maximizedFrameBounds.width < frameBounds.width || maximizedFrameBounds.height < frameBounds.height) { throw new RuntimeException("Maximized frame is smaller than non maximized"); diff --git a/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java b/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java index 39117195a65..9545c57c220 100644 --- a/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java +++ b/jdk/test/java/awt/Graphics2D/MTGraphicsAccessTest/MTGraphicsAccessTest.java @@ -23,7 +23,7 @@ /* @test - @bug 5089429 6982632 + @bug 5089429 6982632 8145808 @summary Checks that we don't crash if rendering operations and state changes are performed on a graphics context from different threads. @@ -34,6 +34,7 @@ import java.awt.*; import java.awt.image.*; import java.awt.geom.*; +import java.util.concurrent.atomic.AtomicInteger; public class MTGraphicsAccessTest { @@ -46,7 +47,7 @@ public class MTGraphicsAccessTest { static long testRunTime; volatile boolean done; - volatile int stillRunning; + AtomicInteger stillRunning = new AtomicInteger(0); volatile int numexceptions; Graphics2D sharedGraphics; @@ -108,7 +109,7 @@ public class MTGraphicsAccessTest { mysleep(testRunTime); done = true; - while (stillRunning > 0) { mysleep(500); } + while (stillRunning.get() > 0) { mysleep(500); } if (numexceptions == 0) { System.err.println("Test passed"); @@ -187,7 +188,7 @@ public class MTGraphicsAccessTest { Runnable testRunnable; public TesterThread(Runnable testRunnable) { - stillRunning++; + stillRunning.incrementAndGet(); this.testRunnable = testRunnable; } @@ -203,7 +204,7 @@ public class MTGraphicsAccessTest { } } } finally { - stillRunning--; + stillRunning.decrementAndGet(); } } } diff --git a/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java b/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java index 832713d187f..e52b6b95f13 100644 --- a/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java +++ b/jdk/test/java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java @@ -23,7 +23,7 @@ /* test - @bug 5039416 6404008 + @bug 5039416 6404008 7087869 @summary REGRESSION: Extra mouse click dispatched after press-drag- release sequence. @library ../../regtesthelpers @build Util @@ -32,8 +32,16 @@ */ import java.applet.Applet; -import java.awt.*; -import java.awt.event.*; +import java.awt.AWTException; +import java.awt.BorderLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; import test.java.awt.regtesthelpers.Util; //** @@ -141,7 +149,12 @@ public class ExtraMouseClick extends Applet smallWin32Drag(dragWidth, dragHeight); clearFlags(); } - }else{ + } else if ("sun.lwawt.macosx.LWCToolkit".equals(sToolkit)) { + // On MacOS X every mouse move event is MOUSE_DRAGGED event and + // MOUSE_DRAGGED is sent back form the Native code to the java code + // for every mouse move. Therefore 'smallDrag test should be + // disabled for toolkit 'sun.lwawt.macosx.LWCToolkit'. + } else { for (int i = 0; i< TRIALS; i++){ smallDrag(SMUDGE_WIDTH - 1, SMUDGE_HEIGHT - 1); //on Motif and XAWT SMUDGE area is 4-pixels wide clearFlags(); @@ -157,8 +170,10 @@ public class ExtraMouseClick extends Applet for (int i = 1; i=0; --k) { + for (int k = keys.length - 1; k >= 0; --k) { robot.keyRelease(keys[k]); - robot.delay(keyDelay); + robot.delay(KEY_DELAY); } - - assertEQ(modifiersEx, modEx, "invalid extended modifiers"); + assertEQ(expectedMask, modEx, "invalid extended modifiers"); for (int k = 0; k < keys.length; ++k) { String keyText = KeyEvent.getKeyText(keys[k]).toLowerCase(); - assertTrue(exText.toLowerCase().contains(keyText), "invalid extended modifier keys description"); + assertTrue(exText.toLowerCase().contains(keyText), + "invalid extended modifier keys description"); } System.out.println(exText + " : passed"); robot.type(KeyEvent.VK_ESCAPE); - - robot.delay(robotDelay); + robot.waitForIdle(); } private void doTest() throws Exception { @@ -201,7 +209,7 @@ public class ExtendedModifiersTest implements KeyListener { String OS = System.getProperty("os.name").toLowerCase(); System.out.println(OS); - for (Component c: components) { + for (Component c : components) { String className = c.getClass().getName(); System.out.println("component class : " + className); @@ -211,18 +219,19 @@ public class ExtendedModifiersTest implements KeyListener { int yc = origin.y + c.getHeight() / 2; Point center = new Point(xc, yc); - robot.delay(robotDelay); + robot.waitForIdle(); robot.glide(origin, center); robot.click(); - robot.delay(robotDelay); + robot.waitForIdle(); // 1. shift + control runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); // 2. alt + shift + control - runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, - InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_ALT, KeyEvent.VK_SHIFT, + KeyEvent.VK_CONTROL}, InputEvent.ALT_DOWN_MASK + | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); // 3. shift runScenario(new int[]{KeyEvent.VK_SHIFT}, @@ -236,26 +245,31 @@ public class ExtendedModifiersTest implements KeyListener { runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_ALT}, InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); - if (OS.contains("os x") || OS.contains("sunos")) { // 6. meta - runScenario(new int[]{KeyEvent.VK_META}, InputEvent.META_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META}, + InputEvent.META_DOWN_MASK); // 7. shift + ctrl + alt + meta - runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT, KeyEvent.VK_META}, - InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL, + KeyEvent.VK_ALT, KeyEvent.VK_META}, + InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK + | InputEvent.ALT_DOWN_MASK | InputEvent.META_DOWN_MASK); // 8. meta + shift + ctrl - runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_CONTROL}, - InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, + KeyEvent.VK_CONTROL}, InputEvent.META_DOWN_MASK + | InputEvent.SHIFT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK); // 9. meta + shift + alt - runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, KeyEvent.VK_ALT}, - InputEvent.META_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_SHIFT, + KeyEvent.VK_ALT}, InputEvent.META_DOWN_MASK + | InputEvent.SHIFT_DOWN_MASK | InputEvent.ALT_DOWN_MASK); // 10. meta + ctrl + alt - runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_CONTROL, KeyEvent.VK_ALT}, - InputEvent.META_DOWN_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK); + runScenario(new int[]{KeyEvent.VK_META, KeyEvent.VK_CONTROL, + KeyEvent.VK_ALT}, InputEvent.META_DOWN_MASK + | InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK); } } @@ -267,5 +281,4 @@ public class ExtendedModifiersTest implements KeyListener { ExtendedModifiersTest test = new ExtendedModifiersTest(); test.doTest(); } -} - +} \ No newline at end of file diff --git a/jdk/test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java b/jdk/test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java new file mode 100644 index 00000000000..92dcc214376 --- /dev/null +++ b/jdk/test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java @@ -0,0 +1,268 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 8041928 + @summary Confirm that the Alt-Gr Modifier bit is set correctly. + @run main/manual AltGraphModifierTest + */ +import java.awt.Button; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class AltGraphModifierTest { + private static void init() throws Exception { + String[] instructions + = { + "This test is for verifying Alt-Gr modifier of an event.", + "Windows :-", + "1. Please check if Alt-Gr key is present on keyboard.", + "2. If present, press the Alt-Gr key and perform", + " mouse click on the TestWindow.", + "3. If Alt-Gr key is not present, press Ctrl+Alt keys &", + " perform mouse click on the TestWindow.", + "4. Test will exit by itself with appropriate result.", + "", + "Linux :-", + "1. Please check if Alt-Gr key is present on keyboard.", + "2. If present, press the Alt-Gr key and perform", + " mouse click on the TestWindow.", + "3. Navigate to System Settings-> Keyboard-> Shortcuts->", + " Typing.", + "4. Select an option for the Alternative Characters Key", + " For example. Right Alt", + "5. Close the settings and navigate to test", + "6. Press Right Alt Key & perform mouse click on the", + " TestWindow", + "7. Test will exit by itself with appropriate result.", + "", + "Mac :-", + " Mac fix is under progress, & will be fixed soon.", + " Please click Fail" + }; + + Sysout.createDialog(); + Sysout.printInstructions(instructions); + } + + static Frame mainFrame; + public static void initTestWindow() { + mainFrame = new Frame(); + mainFrame.setTitle("TestWindow"); + mainFrame.setSize(300, 200); + mainFrame.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + int ex = e.getModifiersEx(); + if ((ex & InputEvent.ALT_GRAPH_DOWN_MASK) == 0) { + AltGraphModifierTest.fail("Alt-Gr Modifier bit is not set."); + } else { + AltGraphModifierTest.pass(); + } + } + }); + mainFrame.setVisible(true); + } + + public static void dispose() { + Sysout.dispose(); + mainFrame.dispose(); + } + + /** + * *************************************************** + * Standard Test Machinery Section DO NOT modify anything in this section -- + * it's a standard chunk of code which has all of the synchronisation + * necessary for the test harness. By keeping it the same in all tests, it + * is easier to read and understand someone else's test, as well as insuring + * that all tests behave correctly with the test harness. There is a section + * following this for test-defined classes + * **************************************************** + */ + private static boolean theTestPassed = false; + private static boolean testGeneratedInterrupt = false; + private static String failureMessage = ""; + private static Thread mainThread = null; + final private static int sleepTime = 300000; + + public static void main(String args[]) throws Exception { + mainThread = Thread.currentThread(); + try { + init(); + initTestWindow(); + } catch (Exception e) { + e.printStackTrace(); + } + try { + mainThread.sleep(sleepTime); + } catch (InterruptedException e) { + dispose(); + if (testGeneratedInterrupt && !theTestPassed) { + throw new Exception(failureMessage); + } + } + if (!testGeneratedInterrupt) { + dispose(); + throw new RuntimeException("Timed out after " + sleepTime / 1000 + + " seconds"); + } + } + + public static synchronized void pass() { + theTestPassed = true; + testGeneratedInterrupt = true; + mainThread.interrupt(); + } + + public static synchronized void fail(String whyFailed) { + theTestPassed = false; + testGeneratedInterrupt = true; + failureMessage = whyFailed; + mainThread.interrupt(); + } +} + +// *********** End Standard Test Machinery Section ********** +/** + * ************************************************** + * Standard Test Machinery DO NOT modify anything below -- it's a standard chunk + * of code whose purpose is to make user interaction uniform, and thereby make + * it simpler to read and understand someone else's test. + * ************************************************** + */ +/** + * This is part of the standard test machinery. It creates a dialog (with the + * instructions), and is the interface for sending text messages to the user. To + * print the instructions, send an array of strings to Sysout.createDialog + * WithInstructions method. Put one line of instructions per array entry. To + * display a message for the tester to see, simply call Sysout.println with the + * string to be displayed. This mimics System.out.println but works within the + * test harness as well as standalone. + */ +class Sysout { + private static TestDialog dialog; + private static Frame frame; + + public static void createDialog() { + frame = new Frame(); + dialog = new TestDialog(frame, "Instructions"); + String[] defInstr = {"Instructions will appear here. ", ""}; + dialog.printInstructions(defInstr); + dialog.show(); + println("Any messages for the tester will display here."); + } + + public static void printInstructions(String[] instructions) { + dialog.printInstructions(instructions); + } + + public static void println(String messageIn) { + dialog.displayMessage(messageIn); + } + + public static void dispose() { + dialog.dispose(); + frame.dispose(); + } +} + +/** + * This is part of the standard test machinery. It provides a place for the test + * instructions to be displayed, and a place for interactive messages to the + * user to be displayed. To have the test instructions displayed, see Sysout. To + * have a message to the user be displayed, see Sysout. Do not call anything in + * this dialog directly. + */ +class TestDialog extends Dialog implements ActionListener { + TextArea instructionsText; + TextArea messageText; + int maxStringLength = 80; + Panel buttonP; + Button failB; + + // DO NOT call this directly, go through Sysout + public TestDialog(Frame frame, String name) { + super(frame, name); + int scrollBoth = TextArea.SCROLLBARS_BOTH; + instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); + add("North", instructionsText); + + messageText = new TextArea("", 5, maxStringLength, scrollBoth); + add("Center", messageText); + + buttonP = new Panel(); + failB = new Button("Fail"); + failB.setActionCommand("fail"); + failB.addActionListener(this); + buttonP.add("Center", failB); + + add("South", buttonP); + pack(); + setVisible(true); + } + + // DO NOT call this directly, go through Sysout + public void printInstructions(String[] instructions) { + instructionsText.setText(""); + String printStr, remainingStr; + for (int i = 0; i < instructions.length; i++) { + remainingStr = instructions[i]; + while (remainingStr.length() > 0) { + if (remainingStr.length() >= maxStringLength) { + int posOfSpace = remainingStr. + lastIndexOf(' ', maxStringLength - 1); + + if (posOfSpace <= 0) { + posOfSpace = maxStringLength - 1; + } + + printStr = remainingStr.substring(0, posOfSpace + 1); + remainingStr = remainingStr.substring(posOfSpace + 1); + } + else { + printStr = remainingStr; + remainingStr = ""; + } + instructionsText.append(printStr + "\n"); + } + } + } + + public void displayMessage(String messageIn) { + messageText.append(messageIn + "\n"); + } + + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand() == "fail") { + AltGraphModifierTest.fail("User Clicked Fail"); + } + } +} \ No newline at end of file diff --git a/jdk/test/java/awt/font/TextLayout/TestGetPixelBounds.java b/jdk/test/java/awt/font/TextLayout/TestGetPixelBounds.java new file mode 100644 index 00000000000..459ff695bf3 --- /dev/null +++ b/jdk/test/java/awt/font/TextLayout/TestGetPixelBounds.java @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2005, 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 6271221 8145584 + * @summary ask a text layout for its pixel bounds, then render it and + * compute the actual pixel bounds when rendering-- the actual pixel bounds + * must be contained within the bounds reported by the text layout, or there + * will be an exception. + */ + +/* + * Copyright 2005 IBM Corp. All Rights Reserved. + */ + +import java.awt.*; +import java.awt.font.*; +import java.awt.geom.*; +import java.awt.image.*; +import java.text.*; +import java.util.*; + +import static java.awt.Font.*; +import static java.awt.font.GraphicAttribute.*; +import static java.awt.font.ShapeGraphicAttribute.*; +import static java.awt.font.TextAttribute.*; + +public class TestGetPixelBounds { + static final boolean DEBUG; + static final boolean DUMP; + static { + String dbg = null; + String dmp = null; + try { + dbg = System.getProperty("DEBUG"); + dmp = System.getProperty("DUMP"); + } + catch (SecurityException e) { + dbg = dmp = null; + } + + DEBUG = dbg != null; + DUMP = dmp != null; + } + + public static void main(String[] args) { + float x = 0; + float y = 0; + boolean rotate = false; + boolean underline = false; + boolean graphic = false; + String text = "Ping"; + for (int i = 0; i < args.length; ++i) { + String arg = args[i]; + if (arg.startsWith("-x")) { + x = Float.parseFloat(args[++i]); + } else if (arg.startsWith("-y")) { + y = Float.parseFloat(args[++i]); + } else if (arg.startsWith("-r")) { + rotate = true; + } else if (arg.startsWith("-u")) { + underline = true; + } else if (arg.startsWith("-g")) { + graphic = true; + } else if (arg.startsWith("-t")) { + text = args[++i]; + } + } + FontRenderContext frc = new FontRenderContext(null, true, true); + Map m = new HashMap(); + m.put(FAMILY, SANS_SERIF); + m.put(SIZE, 16); + if (underline) { + m.put(UNDERLINE, UNDERLINE_ON); + } + if (rotate) { + m.put(TRANSFORM, AffineTransform.getRotateInstance(Math.PI/4)); + } + Font font = Font.getFont(m); + + AttributedString as; + if (graphic) { + GraphicAttribute sga = new ShapeGraphicAttribute( + new Ellipse2D.Float(0,-10,10,20), TOP_ALIGNMENT, STROKE); + as = new AttributedString(text + '*' + text, m); + as.addAttribute(CHAR_REPLACEMENT, sga, text.length(), text.length() + 1); + } else { + as = new AttributedString(text, m); + } + TextLayout tl = new TextLayout(as.getIterator(), frc); + System.out.println("tl bounds: " + tl.getBounds()); + System.out.println("tl compute: " + computeLayoutBounds(tl, x, y, frc)); + System.out.println("tl pixel bounds: " + tl.getPixelBounds(frc, x, y)); + System.out.println(" again int off: " + tl.getPixelBounds(frc, x+2, y - 2)); + System.out.println(" again frac off: " + tl.getPixelBounds(frc, x+.5f, y + .2f)); + System.out.println(" again frc: " + tl.getPixelBounds( + new FontRenderContext(AffineTransform.getScaleInstance(100, 100), true, true), x, y)); + System.out.println(" again int off: " + tl.getPixelBounds(frc, x-2, y+2)); + + GlyphVector gv = font.createGlyphVector(frc, text); + System.out.println("gv bounds: " + gv.getPixelBounds(frc, x, y)); + System.out.println("gv compute: " + computeLayoutBounds(gv, x, y, frc)); + + if (!tl.getPixelBounds(frc, x, y).contains(computeLayoutBounds(tl, x, y, frc))) { + throw new RuntimeException("error, tl.bounds does not contain computed bounds"); + } + } + + static Rectangle computeLayoutBounds(TextLayout tl, float x, float y, FontRenderContext frc) { + Rectangle bounds = tl.getBounds().getBounds(); + BufferedImage im = new BufferedImage(bounds.width + 4, bounds.height + 4, + BufferedImage.TYPE_INT_ARGB); + + Graphics2D g2d = im.createGraphics(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, im.getWidth(), im.getHeight()); + + float fx = (float)Math.IEEEremainder(x,1); + float fy = (float)Math.IEEEremainder(y,1); + g2d.setColor(Color.BLACK); + tl.draw(g2d, fx + 2 - bounds.x, fy + 2 - bounds.y); + + Rectangle r = computePixelBounds(im); + r.x += (int)Math.floor(x) - 2 + bounds.x; + r.y += (int)Math.floor(y) - 2 + bounds.y; + + return r; + } + + static Rectangle computeLayoutBounds(GlyphVector gv, float x, float y, FontRenderContext frc) { + Rectangle bounds = gv.getVisualBounds().getBounds(); + BufferedImage im = new BufferedImage(bounds.width + 4, bounds.height + 4, + BufferedImage.TYPE_INT_ARGB); + + Graphics2D g2d = im.createGraphics(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, im.getWidth(), im.getHeight()); + + float fx = (float)Math.IEEEremainder(x,1); + float fy = (float)Math.IEEEremainder(y,1); + g2d.setColor(Color.BLACK); + g2d.drawGlyphVector(gv, fx + 2 - bounds.x, fy + 2 - bounds.y); + + Rectangle r = computePixelBounds(im); + r.x += (int)Math.floor(x) - 2 + bounds.x; + r.y += (int)Math.floor(y) - 2 + bounds.y; + + return r; + } + + static Rectangle computePixelBounds(BufferedImage im) { + int w = im.getWidth(); + int h = im.getHeight(); + + Formatter fmt = DEBUG ? new Formatter(System.err) : null; + + // dump + if (DUMP && DEBUG) { + fmt.format(" "); + for (int j = 0; j < w; ++j) { + fmt.format("%2d", j); + } + for (int i = 0; i < h; ++i) { + fmt.format("\n[%2d] ", i); + for (int j = 0; j < w; ++j) { + fmt.format("%c ", im.getRGB(j, i) == -1 ? ' ' : '*'); + } + } + fmt.format("\n"); + } + + int l = -1, t = -1, r = w, b = h; + + { + // get top + int[] buf = new int[w]; + loop: + while (++t < h) { + im.getRGB(0, t, buf.length, 1, buf, 0, w); // w ignored + for (int i = 0; i < buf.length; i++) { + if (buf[i] != -1) { + if (DEBUG) fmt.format("top pixel at %d,%d = 0x%08x\n", i, t, buf[i]); + break loop; + } + } + } + if (DEBUG) fmt.format("t: %d\n", t); + } + + // get bottom + { + int[] buf = new int[w]; + loop: + while (--b > t) { + im.getRGB(0, b, buf.length, 1, buf, 0, w); // w ignored + for (int i = 0; i < buf.length; ++i) { + if (buf[i] != -1) { + if (DEBUG) fmt.format("bottom pixel at %d,%d = 0x%08x\n", i, b, buf[i]); + break loop; + } + } + } + ++b; + if (DEBUG) fmt.format("b: %d\n", b); + } + + // get left + { + loop: + while (++l < r) { + for (int i = t; i < b; ++i) { + int v = im.getRGB(l, i); + if (v != -1) { + if (DEBUG) fmt.format("left pixel at %d,%d = 0x%08x\n", l, i, v); + break loop; + } + } + } + if (DEBUG) fmt.format("l: %d\n", l); + } + + // get right + { + loop: + while (--r > l) { + for (int i = t; i < b; ++i) { + int v = im.getRGB(r, i); + if (v != -1) { + if (DEBUG) fmt.format("right pixel at %d,%d = 0x%08x\n", r, i, v); + break loop; + } + } + } + ++r; + if (DEBUG) fmt.format("r: %d\n", r); + } + + return new Rectangle(l, t, r-l, b-t); + } +} diff --git a/jdk/test/java/awt/image/multiresolution/MultiResolutionImagePropertiesTest.java b/jdk/test/java/awt/image/multiresolution/MultiResolutionImagePropertiesTest.java new file mode 100644 index 00000000000..67bdf08c606 --- /dev/null +++ b/jdk/test/java/awt/image/multiresolution/MultiResolutionImagePropertiesTest.java @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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.awt.*; +import java.awt.image.*; +import java.util.*; + +/* @test + * @bug 8147966 + * @summary test multiresolution image properties + * @author a.stepanov + * + * @run main MultiResolutionImagePropertiesTest + */ + +public class MultiResolutionImagePropertiesTest { + + private final static Map PROPS; + static { + PROPS = new HashMap<>(); + PROPS.put("one", "ONE"); + PROPS.put("two", "TWO"); + PROPS.put("three", "THREE"); + PROPS.put("other", "OTHER"); + PROPS.put("test", "TEST"); + } + + private final static int SZ = 100; + private final static Object UNDEF = Image.UndefinedProperty; + + private static BufferedImage generateImage(int scale, Properties p) { + + int x = (int) (SZ * scale); + BufferedImage tmp = new BufferedImage(x, x, BufferedImage.TYPE_INT_RGB); + + return new BufferedImage(tmp.getColorModel(), + tmp.getRaster(), + tmp.isAlphaPremultiplied(), + p); + } + + private static void checkProperties(BufferedImage img, + String keys[], + String undefined[]) { + boolean numOK = true; + + if (keys.length == 0) { + numOK = (img.getPropertyNames() == null); + } else { + numOK = (img.getPropertyNames().length == keys.length); + } + + if (!numOK) { + throw new RuntimeException("invalid number of properties"); + } + + for (String k: keys) { + if (!img.getProperty(k).equals(PROPS.get(k))) { + throw new RuntimeException("invalid property for name " + k); + } + } + + for (String k: undefined) { + if (!img.getProperty(k).equals(UNDEF)) { + throw new RuntimeException("property for name " + k + + " must be undefined"); + } + } + } + + private static void checkProperties(BaseMultiResolutionImage img, + String keys[], + String undefined[]) { + for (String k: keys) { + if (!img.getProperty(k, null).equals(PROPS.get(k))) { + throw new RuntimeException("invalid property for name " + k); + } + } + + for (String k: undefined) { + if (!img.getProperty(k, null).equals(UNDEF)) { + throw new RuntimeException("property for name " + k + + " must be undefined"); + } + } + } + + + public static void main(String[] args) throws Exception { + + String keys[] = new String[]{"one", "two", "three"}; + String otherKeys[] = new String[]{"other", "test"}; + String empty[] = new String[]{}; + + Properties props = new Properties(); + for (String k: keys) { props.setProperty(k, PROPS.get(k)); } + + Properties otherProps = new Properties(); + for (String k: otherKeys) { otherProps.setProperty(k, PROPS.get(k)); } + + Properties defaultProps = new Properties(); + + + // === check the default state === + BaseMultiResolutionImage image = + new BaseMultiResolutionImage(new BufferedImage[]{ + generateImage(1, defaultProps), + generateImage(2, defaultProps), + generateImage(3, defaultProps) + }); + + for (Image var: image.getResolutionVariants()) { + if (((BufferedImage) var).getPropertyNames() != null) { + throw new RuntimeException("PropertyNames should be null"); + } + } + + // === default: base image is the 1st one === + image = + new BaseMultiResolutionImage(new BufferedImage[]{ + generateImage(1, props), + generateImage(2, otherProps), + generateImage(3, defaultProps) + }); + + checkProperties(image, keys, otherKeys); + + BufferedImage var = (BufferedImage) image.getResolutionVariant(SZ, SZ); + checkProperties(var, keys, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(2 * SZ, 2 * SZ); + checkProperties(var, otherKeys, keys); + + var = (BufferedImage) image.getResolutionVariant(3 * SZ, 3 * SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + // === let the 2nd image be a base one === + image = + new BaseMultiResolutionImage(1, new BufferedImage[]{ + generateImage(1, props), + generateImage(2, otherProps), + generateImage(3, defaultProps) + }); + + checkProperties(image, otherKeys, keys); + + var = (BufferedImage) image.getResolutionVariant(SZ, SZ); + checkProperties(var, keys, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(2 * SZ, 2 * SZ); + checkProperties(var, otherKeys, keys); + + var = (BufferedImage) image.getResolutionVariant(3 * SZ, 3 * SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + // === let the 3rd image be a base one === + image = + new BaseMultiResolutionImage(2, new BufferedImage[]{ + generateImage(1, defaultProps), + generateImage(2, defaultProps), + generateImage(3, props) + }); + + checkProperties(image, keys, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(SZ, SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(2 * SZ, 2 * SZ); + checkProperties(var, empty, keys); + checkProperties(var, empty, otherKeys); + + var = (BufferedImage) image.getResolutionVariant(3 * SZ, 3 * SZ); + checkProperties(var, keys, otherKeys); + + // === check the other properties don't affect base === + checkProperties( + new BaseMultiResolutionImage(new BufferedImage[]{ + generateImage(1, defaultProps), + generateImage(2, props), + generateImage(3, props) + }), + empty, keys); + + checkProperties( + new BaseMultiResolutionImage(2, new BufferedImage[]{ + generateImage(1, props), + generateImage(2, props), + generateImage(3, defaultProps) + }), + empty, keys); + } +} diff --git a/jdk/test/java/lang/Math/SinCosCornerCasesTests.java b/jdk/test/java/lang/Math/SinCosCornerCasesTests.java new file mode 100644 index 00000000000..e144857443f --- /dev/null +++ b/jdk/test/java/lang/Math/SinCosCornerCasesTests.java @@ -0,0 +1,2927 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143353 + * @summary Test corner cases of sin and cos + * @build Tests + * @build SinCosCornerCasesTests + * @run main SinCosCornerCasesTests + * @author Vivek Deshpande + */ + +public class SinCosCornerCasesTests { + private SinCosCornerCasesTests() {throw new AssertionError("No instances for you.");} + + public static void main(String... args) { + int failures = 0; + + + failures += testCornerCasesSin(); + failures += testCornerCasesCos(); + + if (failures > 0) { + System.err.printf("Testing worst cases incurred %d failures.%n", failures); + throw new RuntimeException(); + } + } + + + private static int testCornerCasesSin() { + int failures = 0; + double[][] testCases = { + {0x1.9283586503fep-5, 0x1.9259e3708bd3ap-5, 0x1.9259e3708bd39p-5}, + {-0x1.9283586503fep-5, -0x1.9259e3708bd3ap-5, -0x1.9259e3708bd39p-5}, + {0x1.d7bdcd778049fp-5, 0x1.d77b117f230d6p-5, 0x1.d77b117f230d5p-5}, + {-0x1.d7bdcd778049fp-5, -0x1.d77b117f230d6p-5, -0x1.d77b117f230d5p-5}, + {0x1.a202b3fb84788p-4, 0x1.a1490c8c06ba7p-4, 0x1.a1490c8c06ba6p-4}, + {-0x1.a202b3fb84788p-4, -0x1.a1490c8c06ba7p-4, -0x1.a1490c8c06ba6p-4}, + {0x1.d037cb27ee6dfp-3, 0x1.cc40c3805229ap-3, 0x1.cc40c3805229bp-3}, + {-0x1.d037cb27ee6dfp-3, -0x1.cc40c3805229ap-3, -0x1.cc40c3805229bp-3}, + {0x1.d5064e6fe82c5p-3, 0x1.d0ef799001ba9p-3, 0x1.d0ef799001baap-3}, + {-0x1.d5064e6fe82c5p-3, -0x1.d0ef799001ba9p-3, -0x1.d0ef799001baap-3}, + {0x1.fe767739d0f6dp-2, 0x1.e9950730c4696p-2, 0x1.e9950730c4696p-2}, + {-0x1.fe767739d0f6dp-2, -0x1.e9950730c4696p-2, -0x1.e9950730c4696p-2}, + {0x1.d98c4c612718dp-1, 0x1.98dcd09337793p-1, 0x1.98dcd09337792p-1}, + {-0x1.d98c4c612718dp-1, -0x1.98dcd09337793p-1, -0x1.98dcd09337792p-1}, + {0x1.921fb54442d18p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.0000001f8p500, 0x1.70a9d825b5064p-1, 0x1.70a9d825b5065p-1}, + {0x1.0000001f8p500, -0x1.70a9d825b5064p-1, -0x1.70a9d825b5065p-1}, + {-0x1.00c0bf8p700, 0x1.bf3980c6c1e9fp-1, 0x1.bf3980c6c1eap-1}, + {0x1.00c0bf8p700, -0x1.bf3980c6c1e9fp-1, -0x1.bf3980c6c1eap-1}, + {-0x1.13fffffffff8p6, 0x1.d62899d48b43ap-4, 0x1.d62899d48b439p-4}, + {0x1.13fffffffff8p6, -0x1.d62899d48b43ap-4, -0x1.d62899d48b439p-4}, + {-0x1.17c5920767dfcp-5, -0x1.17b7a60ce1f15p-5, -0x1.17b7a60ce1f14p-5}, + {0x1.17c5920767dfcp-5, 0x1.17b7a60ce1f15p-5, 0x1.17b7a60ce1f14p-5}, + {-0x1.1d99be08713ccp2, 0x1.f0192b794fbbep-1, 0x1.f0192b794fbbfp-1}, + {0x1.1d99be08713ccp2, -0x1.f0192b794fbbep-1, -0x1.f0192b794fbbfp-1}, + {-0x1.1ddbfd64fc0d3p81, -0x1.5e61328c0034fp-3, -0x1.5e61328c0034ep-3}, + {0x1.1ddbfd64fc0d3p81, 0x1.5e61328c0034fp-3, 0x1.5e61328c0034ep-3}, + {-0x1.1e2a1563e068ep7, 0x1.fb028c5df1db4p-1, 0x1.fb028c5df1db3p-1}, + {0x1.1e2a1563e068ep7, -0x1.fb028c5df1db4p-1, -0x1.fb028c5df1db3p-1}, + {-0x1.2e07a91314dp-3, -0x1.2cefb196ba208p-3, -0x1.2cefb196ba207p-3}, + {0x1.2e07a91314dp-3, 0x1.2cefb196ba208p-3, 0x1.2cefb196ba207p-3}, + {-0x1.3bcec270444e2p3, 0x1.b80f489d3edf5p-2, 0x1.b80f489d3edf4p-2}, + {0x1.3bcec270444e2p3, -0x1.b80f489d3edf5p-2, -0x1.b80f489d3edf4p-2}, + {-0x1.500000000004p-20, -0x1.4fffffffffa39p-20, -0x1.4fffffffffa38p-20}, + {0x1.500000000004p-20, 0x1.4fffffffffa39p-20, 0x1.4fffffffffa38p-20}, + {-0x1.559001a42d90cp1, -0x1.d29da5b44f51cp-2, -0x1.d29da5b44f51bp-2}, + {0x1.559001a42d90cp1, 0x1.d29da5b44f51cp-2, 0x1.d29da5b44f51bp-2}, + {-0x1.597bf3e9776b7p99, -0x1.f85f526147f78p-1, -0x1.f85f526147f79p-1}, + {0x1.597bf3e9776b7p99, 0x1.f85f526147f78p-1, 0x1.f85f526147f79p-1}, + {-0x1.6c6cbc45dc8dep7, -0x1.6d61b58c99c43p-59, -0x1.6d61b58c99c42p-59}, + {0x1.6c6cbc45dc8dep7, 0x1.6d61b58c99c43p-59, 0x1.6d61b58c99c42p-59}, + {-0x1.73d8d173f90dp4, 0x1.e5c3c08a258a8p-1, 0x1.e5c3c08a258a7p-1}, + {0x1.73d8d173f90dp4, -0x1.e5c3c08a258a8p-1, -0x1.e5c3c08a258a7p-1}, + {-0x1.8c202d3a31802p6, 0x1.feb36806ca5fbp-1, 0x1.feb36806ca5fcp-1}, + {0x1.8c202d3a31802p6, -0x1.feb36806ca5fbp-1, -0x1.feb36806ca5fcp-1}, + {-0x1.acd538b1a6d5dp-1, -0x1.7c6c7b01b98dap-1, -0x1.7c6c7b01b98d9p-1}, + {0x1.acd538b1a6d5dp-1, 0x1.7c6c7b01b98dap-1, 0x1.7c6c7b01b98d9p-1}, + {-0x1.b7525ac97e0d2p2, -0x1.191be2059dcb6p-1, -0x1.191be2059dcb5p-1}, + {0x1.b7525ac97e0d2p2, 0x1.191be2059dcb6p-1, 0x1.191be2059dcb5p-1}, + {-0x1.bee5fa8a84b02p0, -0x1.f8305993a212cp-1, -0x1.f8305993a212dp-1}, + {0x1.bee5fa8a84b02p0, 0x1.f8305993a212cp-1, 0x1.f8305993a212dp-1}, + {-0x1.c393979fe5921p9, 0x1.ff3b13530fd71p-1, 0x1.ff3b13530fd7p-1}, + {0x1.c393979fe5921p9, -0x1.ff3b13530fd71p-1, -0x1.ff3b13530fd7p-1}, + {-0x1.c48ffc72563c8p18, -0x1.f119da81a4da6p-1, -0x1.f119da81a4da5p-1}, + {0x1.c48ffc72563c8p18, 0x1.f119da81a4da6p-1, 0x1.f119da81a4da5p-1}, + {-0x1.c79548bc31856p3, -0x1.fd73b81e04cccp-1, -0x1.fd73b81e04ccdp-1}, + {0x1.c79548bc31856p3, 0x1.fd73b81e04cccp-1, 0x1.fd73b81e04ccdp-1}, + {-0x1.cb6p-3, -0x1.c7885aef33a95p-3, -0x1.c7885aef33a94p-3}, + {0x1.cb6p-3, 0x1.c7885aef33a95p-3, 0x1.c7885aef33a94p-3}, + {-0x1.e64ddaf7bd72fp-7, -0x1.e6494911eedd1p-7, -0x1.e6494911eeddp-7}, + {0x1.e64ddaf7bd72fp-7, 0x1.e6494911eedd1p-7, 0x1.e6494911eeddp-7}, + {-0x1.ecdd0fbf07942p5, 0x1.e180eef5b1c88p-1, 0x1.e180eef5b1c89p-1}, + {0x1.ecdd0fbf07942p5, -0x1.e180eef5b1c88p-1, -0x1.e180eef5b1c89p-1}, + {-0x1.f073a23292337p2, -0x1.fd98d20c1be44p-1, -0x1.fd98d20c1be43p-1}, + {0x1.f073a23292337p2, 0x1.fd98d20c1be44p-1, 0x1.fd98d20c1be43p-1}, + {-0x1.f5e4c410f4ef8p15, -0x1.7268c112297c8p-5, -0x1.7268c112297c9p-5}, + {0x1.f5e4c410f4ef8p15, 0x1.7268c112297c8p-5, 0x1.7268c112297c9p-5}, + {-0x1.f8000000002p95, 0x1.420796146070ep-18, 0x1.420796146070fp-18}, + {0x1.f8000000002p95, -0x1.420796146070ep-18, -0x1.420796146070fp-18}, + {-0x1.f9365d79546e1p-2, -0x1.e4f6dc499d9ccp-2, -0x1.e4f6dc499d9cdp-2}, + {0x1.f9365d79546e1p-2, 0x1.e4f6dc499d9ccp-2, 0x1.e4f6dc499d9cdp-2}, + {-0x1.ffffffffffe7ep1023, 0x1.b2ef99b140d65p-14, 0x1.b2ef99b140d66p-14}, + {0x1.ffffffffffe7ep1023, -0x1.b2ef99b140d65p-14, -0x1.b2ef99b140d66p-14}, + {0x1.0p15, 0x1.db0ffc3ecc6e4p-1, 0x1.db0ffc3ecc6e3p-1}, + {-0x1.0p15, -0x1.db0ffc3ecc6e4p-1, -0x1.db0ffc3ecc6e3p-1}, + {0x1.0000000000001p13, -0x1.e98f87098b627p-1, -0x1.e98f87098b626p-1}, + {-0x1.0000000000001p13, 0x1.e98f87098b627p-1, 0x1.e98f87098b626p-1}, + {0x1.0000000000001p52, 0x1.053c35068e10dp-4, 0x1.053c35068e10ep-4}, + {-0x1.0000000000001p52, -0x1.053c35068e10dp-4, -0x1.053c35068e10ep-4}, + {0x1.0000000000001p228, 0x1.72d421b6884e5p-1, 0x1.72d421b6884e6p-1}, + {-0x1.0000000000001p228, -0x1.72d421b6884e5p-1, -0x1.72d421b6884e6p-1}, + {0x1.0000000000001p491, 0x1.77fba987c5654p-1, 0x1.77fba987c5653p-1}, + {-0x1.0000000000001p491, -0x1.77fba987c5654p-1, -0x1.77fba987c5653p-1}, + {0x1.0000000000003p215, -0x1.723b2625331afp-1, -0x1.723b2625331bp-1}, + {-0x1.0000000000003p215, 0x1.723b2625331afp-1, 0x1.723b2625331bp-1}, + {0x1.0000000000006p0, 0x1.aed548f090cf5p-1, 0x1.aed548f090cf4p-1}, + {-0x1.0000000000006p0, -0x1.aed548f090cf5p-1, -0x1.aed548f090cf4p-1}, + {0x1.0000000000007p8, -0x1.ff983208c7dc9p-1, -0x1.ff983208c7dcap-1}, + {-0x1.0000000000007p8, 0x1.ff983208c7dc9p-1, 0x1.ff983208c7dcap-1}, + {0x1.0000000000007p275, 0x1.ffef29dc38453p-1, 0x1.ffef29dc38452p-1}, + {-0x1.0000000000007p275, -0x1.ffef29dc38453p-1, -0x1.ffef29dc38452p-1}, + {0x1.0000000000007p449, -0x1.fa88c375723c1p-8, -0x1.fa88c375723cp-8}, + {-0x1.0000000000007p449, 0x1.fa88c375723c1p-8, 0x1.fa88c375723cp-8}, + {0x1.0000000000011p644, 0x1.fff5322c94eaep-1, 0x1.fff5322c94eafp-1}, + {-0x1.0000000000011p644, -0x1.fff5322c94eaep-1, -0x1.fff5322c94eafp-1}, + {0x1.000000000001fp164, -0x1.a73630af8f15cp-1, -0x1.a73630af8f15bp-1}, + {-0x1.000000000001fp164, 0x1.a73630af8f15cp-1, 0x1.a73630af8f15bp-1}, + {0x1.0000000000038p380, 0x1.1c548f9249e44p-2, 0x1.1c548f9249e45p-2}, + {-0x1.0000000000038p380, -0x1.1c548f9249e44p-2, -0x1.1c548f9249e45p-2}, + {0x1.0000000000118p380, 0x1.ca965bd2c4dffp-3, 0x1.ca965bd2c4dfep-3}, + {-0x1.0000000000118p380, -0x1.ca965bd2c4dffp-3, -0x1.ca965bd2c4dfep-3}, + {0x1.000000000012cp2, -0x1.837b9dddc24dp-1, -0x1.837b9dddc24cfp-1}, + {-0x1.000000000012cp2, 0x1.837b9dddc24dp-1, 0x1.837b9dddc24cfp-1}, + {0x1.00000000001f8p700, 0x1.d82c1784c3eccp-2, 0x1.d82c1784c3ecbp-2}, + {-0x1.00000000001f8p700, -0x1.d82c1784c3eccp-2, -0x1.d82c1784c3ecbp-2}, + {0x1.00000000002p-7, 0x1.fffeaaaaef2eep-8, 0x1.fffeaaaaef2efp-8}, + {-0x1.00000000002p-7, -0x1.fffeaaaaef2eep-8, -0x1.fffeaaaaef2efp-8}, + {0x1.00000000002p40, -0x1.0871bddd90fc6p-1, -0x1.0871bddd90fc5p-1}, + {-0x1.00000000002p40, 0x1.0871bddd90fc6p-1, 0x1.0871bddd90fc5p-1}, + {0x1.0000000000201p-7, 0x1.fffeaaaaef2fp-8, 0x1.fffeaaaaef2f1p-8}, + {-0x1.0000000000201p-7, -0x1.fffeaaaaef2fp-8, -0x1.fffeaaaaef2f1p-8}, + {0x1.0000000000221p-7, 0x1.fffeaaaaef33p-8, 0x1.fffeaaaaef331p-8}, + {-0x1.0000000000221p-7, -0x1.fffeaaaaef33p-8, -0x1.fffeaaaaef331p-8}, + {0x1.000000000023ap-7, 0x1.fffeaaaaef362p-8, 0x1.fffeaaaaef363p-8}, + {-0x1.000000000023ap-7, -0x1.fffeaaaaef362p-8, -0x1.fffeaaaaef363p-8}, + {0x1.0000000004p45, 0x1.e0c6edfa93601p-9, 0x1.e0c6edfa93602p-9}, + {-0x1.0000000004p45, -0x1.e0c6edfa93601p-9, -0x1.e0c6edfa93602p-9}, + {0x1.0000000cp40, 0x1.ea1f618356db1p-5, 0x1.ea1f618356dbp-5}, + {-0x1.0000000cp40, -0x1.ea1f618356db1p-5, -0x1.ea1f618356dbp-5}, + {0x1.00000013c86f4p-2, 0x1.faaeed7587542p-3, 0x1.faaeed7587541p-3}, + {-0x1.00000013c86f4p-2, -0x1.faaeed7587542p-3, -0x1.faaeed7587541p-3}, + {0x1.001p13, 0x1.540bc7785680bp-1, 0x1.540bc7785680ap-1}, + {-0x1.001p13, -0x1.540bc7785680bp-1, -0x1.540bc7785680ap-1}, + {0x1.003p699, -0x1.37a7cb907a2e5p-1, -0x1.37a7cb907a2e6p-1}, + {-0x1.003p699, 0x1.37a7cb907a2e5p-1, 0x1.37a7cb907a2e6p-1}, + {0x1.0038p40, -0x1.29e5845fc54b5p-1, -0x1.29e5845fc54b6p-1}, + {-0x1.0038p40, 0x1.29e5845fc54b5p-1, 0x1.29e5845fc54b6p-1}, + {0x1.007p10, 0x1.ffe5ca4656491p-1, 0x1.ffe5ca4656492p-1}, + {-0x1.007p10, -0x1.ffe5ca4656491p-1, -0x1.ffe5ca4656492p-1}, + {0x1.007p25, 0x1.ea4df82db014bp-1, 0x1.ea4df82db014ap-1}, + {-0x1.007p25, -0x1.ea4df82db014bp-1, -0x1.ea4df82db014ap-1}, + {0x1.007p41, 0x1.fe757aef1c80cp-1, 0x1.fe757aef1c80dp-1}, + {-0x1.007p41, -0x1.fe757aef1c80cp-1, -0x1.fe757aef1c80dp-1}, + {0x1.00cp41, 0x1.e9b71805ec068p-7, 0x1.e9b71805ec069p-7}, + {-0x1.00cp41, -0x1.e9b71805ec068p-7, -0x1.e9b71805ec069p-7}, + {0x1.01c00000001p0, 0x1.b0b6d0a540583p-1, 0x1.b0b6d0a540582p-1}, + {-0x1.01c00000001p0, -0x1.b0b6d0a540583p-1, -0x1.b0b6d0a540582p-1}, + {0x1.02322e46da919p-2, 0x1.fef0092627012p-3, 0x1.fef0092627013p-3}, + {-0x1.02322e46da919p-2, -0x1.fef0092627012p-3, -0x1.fef0092627013p-3}, + {0x1.02a236478p-2, 0x1.ffc90059804a1p-3, 0x1.ffc90059804ap-3}, + {-0x1.02a236478p-2, -0x1.ffc90059804a1p-3, -0x1.ffc90059804ap-3}, + {0x1.02a65d08ca5e5p-2, 0x1.ffd10a6b5429fp-3, 0x1.ffd10a6b5429ep-3}, + {-0x1.02a65d08ca5e5p-2, -0x1.ffd10a6b5429fp-3, -0x1.ffd10a6b5429ep-3}, + {0x1.02a65d2dce49ap-2, 0x1.ffd10ab302a3fp-3, 0x1.ffd10ab302a4p-3}, + {-0x1.02a65d2dce49ap-2, -0x1.ffd10ab302a3fp-3, -0x1.ffd10ab302a4p-3}, + {0x1.02ae7238ap-2, 0x1.ffe0b1764ca4cp-3, 0x1.ffe0b1764ca4dp-3}, + {-0x1.02ae7238ap-2, -0x1.ffe0b1764ca4cp-3, -0x1.ffe0b1764ca4dp-3}, + {0x1.0501d22221dacp621, -0x1.f68f0e26c0f6bp-3, -0x1.f68f0e26c0f6ap-3}, + {-0x1.0501d22221dacp621, 0x1.f68f0e26c0f6bp-3, 0x1.f68f0e26c0f6ap-3}, + {0x1.06ffffffffff8p0, 0x1.b63c41f09eb75p-1, 0x1.b63c41f09eb74p-1}, + {-0x1.06ffffffffff8p0, -0x1.b63c41f09eb75p-1, -0x1.b63c41f09eb74p-1}, + {0x1.07023d3d44215p12, -0x1.ffdc173adabb2p-1, -0x1.ffdc173adabb1p-1}, + {-0x1.07023d3d44215p12, 0x1.ffdc173adabb2p-1, 0x1.ffdc173adabb1p-1}, + {0x1.0895a7a3e8ae6p-5, 0x1.0889e11bef135p-5, 0x1.0889e11bef136p-5}, + {-0x1.0895a7a3e8ae6p-5, -0x1.0889e11bef135p-5, -0x1.0889e11bef136p-5}, + {0x1.08d5d69840601p-5, 0x1.08ca077c76445p-5, 0x1.08ca077c76446p-5}, + {-0x1.08d5d69840601p-5, -0x1.08ca077c76445p-5, -0x1.08ca077c76446p-5}, + {0x1.0ep6, -0x1.ff7fbe518023fp-1, -0x1.ff7fbe518023ep-1}, + {-0x1.0ep6, 0x1.ff7fbe518023fp-1, 0x1.ff7fbe518023ep-1}, + {0x1.107ba49c346e4p9, -0x1.fd6c68b877afep-1, -0x1.fd6c68b877affp-1}, + {-0x1.107ba49c346e4p9, 0x1.fd6c68b877afep-1, 0x1.fd6c68b877affp-1}, + {0x1.149154477444p745, -0x1.a2ba6bc70bce4p-1, -0x1.a2ba6bc70bce5p-1}, + {-0x1.149154477444p745, 0x1.a2ba6bc70bce4p-1, 0x1.a2ba6bc70bce5p-1}, + {0x1.1663c0e51818p-5, 0x1.165609790f235p-5, 0x1.165609790f234p-5}, + {-0x1.1663c0e51818p-5, -0x1.165609790f235p-5, -0x1.165609790f234p-5}, + {0x1.1745d1745d176p238, -0x1.fc0523ff94e45p-1, -0x1.fc0523ff94e44p-1}, + {-0x1.1745d1745d176p238, 0x1.fc0523ff94e45p-1, 0x1.fc0523ff94e44p-1}, + {0x1.17472a408a3ep97, 0x1.f34a729c584bdp-1, 0x1.f34a729c584bcp-1}, + {-0x1.17472a408a3ep97, -0x1.f34a729c584bdp-1, -0x1.f34a729c584bcp-1}, + {0x1.178d91b6b992dp-5, 0x1.177fae169fdf1p-5, 0x1.177fae169fdfp-5}, + {-0x1.178d91b6b992dp-5, -0x1.177fae169fdf1p-5, -0x1.177fae169fdfp-5}, + {0x1.178d91b6bad4ep-5, 0x1.177fae16a120fp-5, 0x1.177fae16a120ep-5}, + {-0x1.178d91b6bad4ep-5, -0x1.177fae16a120fp-5, -0x1.177fae16a120ep-5}, + {0x1.178d91b6bbabap-5, 0x1.177fae16a1f79p-5, 0x1.177fae16a1f78p-5}, + {-0x1.178d91b6bbabap-5, -0x1.177fae16a1f79p-5, -0x1.177fae16a1f78p-5}, + {0x1.178d91b6bdc45p-5, 0x1.177fae16a40ffp-5, 0x1.177fae16a40fep-5}, + {-0x1.178d91b6bdc45p-5, -0x1.177fae16a40ffp-5, -0x1.177fae16a40fep-5}, + {0x1.19752dbee5f6ap933, 0x1.297c768f2413p-1, 0x1.297c768f24131p-1}, + {-0x1.19752dbee5f6ap933, -0x1.297c768f2413p-1, -0x1.297c768f24131p-1}, + {0x1.1b3009cfe4dbcp8, 0x1.b826df5cafafap-2, 0x1.b826df5cafafbp-2}, + {-0x1.1b3009cfe4dbcp8, -0x1.b826df5cafafap-2, -0x1.b826df5cafafbp-2}, + {0x1.1f6475d95bf18p3, 0x1.b7a5956250b6bp-2, 0x1.b7a5956250b6ap-2}, + {-0x1.1f6475d95bf18p3, -0x1.b7a5956250b6bp-2, -0x1.b7a5956250b6ap-2}, + {0x1.229148a452291p118, 0x1.4db6566b64548p-1, 0x1.4db6566b64547p-1}, + {-0x1.229148a452291p118, -0x1.4db6566b64548p-1, -0x1.4db6566b64547p-1}, + {0x1.268p-1, 0x1.1686fee2c49a8p-1, 0x1.1686fee2c49a7p-1}, + {-0x1.268p-1, -0x1.1686fee2c49a8p-1, -0x1.1686fee2c49a7p-1}, + {0x1.26fb3844dd19p-2, 0x1.22eb21a44d627p-2, 0x1.22eb21a44d628p-2}, + {-0x1.26fb3844dd19p-2, -0x1.22eb21a44d627p-2, -0x1.22eb21a44d628p-2}, + {0x1.27fffffffe6bp0, 0x1.d4a216d89b2b3p-1, 0x1.d4a216d89b2b4p-1}, + {-0x1.27fffffffe6bp0, -0x1.d4a216d89b2b3p-1, -0x1.d4a216d89b2b4p-1}, + {0x1.284b84048d481p204, -0x1.76c9b0f3a22f8p-1, -0x1.76c9b0f3a22f7p-1}, + {-0x1.284b84048d481p204, 0x1.76c9b0f3a22f8p-1, 0x1.76c9b0f3a22f7p-1}, + {0x1.2999e3109cad4p2, -0x1.ff01226f97d33p-1, -0x1.ff01226f97d32p-1}, + {-0x1.2999e3109cad4p2, 0x1.ff01226f97d33p-1, 0x1.ff01226f97d32p-1}, + {0x1.2aap-5, 0x1.2a8f11e7ae82cp-5, 0x1.2a8f11e7ae82dp-5}, + {-0x1.2aap-5, -0x1.2a8f11e7ae82cp-5, -0x1.2a8f11e7ae82dp-5}, + {0x1.2b14d3be0c23p-5, 0x1.2b03d1bf773dfp-5, 0x1.2b03d1bf773ep-5}, + {-0x1.2b14d3be0c23p-5, -0x1.2b03d1bf773dfp-5, -0x1.2b03d1bf773ep-5}, + {0x1.2b7cb44849981p2, -0x1.ffb90ee641792p-1, -0x1.ffb90ee641791p-1}, + {-0x1.2b7cb44849981p2, 0x1.ffb90ee641792p-1, 0x1.ffb90ee641791p-1}, + {0x1.2becc8685258p200, -0x1.ffffff79e71a4p-1, -0x1.ffffff79e71a3p-1}, + {-0x1.2becc8685258p200, 0x1.ffffff79e71a4p-1, 0x1.ffffff79e71a3p-1}, + {0x1.2cfa14ce27cd5p2, -0x1.fff9edaf85b77p-1, -0x1.fff9edaf85b76p-1}, + {-0x1.2cfa14ce27cd5p2, 0x1.fff9edaf85b77p-1, 0x1.fff9edaf85b76p-1}, + {0x1.2dp-4, 0x1.2cbaaa4cebb52p-4, 0x1.2cbaaa4cebb51p-4}, + {-0x1.2dp-4, -0x1.2cbaaa4cebb52p-4, -0x1.2cbaaa4cebb51p-4}, + {0x1.2d76d18721be8p2, -0x1.ffffbc177e01p-1, -0x1.ffffbc177e00fp-1}, + {-0x1.2d76d18721be8p2, 0x1.ffffbc177e01p-1, 0x1.ffffbc177e00fp-1}, + {0x1.302a494e0909p97, 0x1.745843dfafefdp-18, 0x1.745843dfafefep-18}, + {-0x1.302a494e0909p97, -0x1.745843dfafefdp-18, -0x1.745843dfafefep-18}, + {0x1.31cc731cc731cp1000, 0x1.ffcc568d42376p-1, 0x1.ffcc568d42377p-1}, + {-0x1.31cc731cc731cp1000, -0x1.ffcc568d42376p-1, -0x1.ffcc568d42377p-1}, + {0x1.328463d4f8ca6p441, 0x1.b676077d4faf8p-1, 0x1.b676077d4faf7p-1}, + {-0x1.328463d4f8ca6p441, -0x1.b676077d4faf8p-1, -0x1.b676077d4faf7p-1}, + {0x1.32ce90b32171ep18, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.32ce90b32171ep18, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.35debd7f020ecp-5, 0x1.35cbd3240d149p-5, 0x1.35cbd3240d148p-5}, + {-0x1.35debd7f020ecp-5, -0x1.35cbd3240d149p-5, -0x1.35cbd3240d148p-5}, + {0x1.3bb3487893405p-7, 0x1.3bb2086559faap-7, 0x1.3bb2086559fa9p-7}, + {-0x1.3bb3487893405p-7, -0x1.3bb2086559faap-7, -0x1.3bb2086559fa9p-7}, + {0x1.3bb3487893407p-7, 0x1.3bb2086559facp-7, 0x1.3bb2086559fabp-7}, + {-0x1.3bb3487893407p-7, -0x1.3bb2086559facp-7, -0x1.3bb2086559fabp-7}, + {0x1.3bb681d65aa6p100, 0x1.dff197edc51d2p-16, 0x1.dff197edc51d3p-16}, + {-0x1.3bb681d65aa6p100, -0x1.dff197edc51d2p-16, -0x1.dff197edc51d3p-16}, + {0x1.3f9aa8626042fp83, -0x1.5d08d3dbb41bp-3, -0x1.5d08d3dbb41afp-3}, + {-0x1.3f9aa8626042fp83, 0x1.5d08d3dbb41bp-3, 0x1.5d08d3dbb41afp-3}, + {0x1.3fep19, 0x1.fb503983f94bbp-3, 0x1.fb503983f94bcp-3}, + {-0x1.3fep19, -0x1.fb503983f94bbp-3, -0x1.fb503983f94bcp-3}, + {0x1.4285478f1e3c8p58, -0x1.d3876eacc9ee7p-1, -0x1.d3876eacc9ee6p-1}, + {-0x1.4285478f1e3c8p58, 0x1.d3876eacc9ee7p-1, 0x1.d3876eacc9ee6p-1}, + {0x1.42cbcf45a169ep-5, 0x1.42b66d54f69c1p-5, 0x1.42b66d54f69cp-5}, + {-0x1.42cbcf45a169ep-5, -0x1.42b66d54f69c1p-5, -0x1.42b66d54f69cp-5}, + {0x1.43fffffffff6ap557, 0x1.b45e9e9427554p-1, 0x1.b45e9e9427553p-1}, + {-0x1.43fffffffff6ap557, -0x1.b45e9e9427554p-1, -0x1.b45e9e9427553p-1}, + {0x1.44p-17, 0x1.43ffffffea603p-17, 0x1.43ffffffea602p-17}, + {-0x1.44p-17, -0x1.43ffffffea603p-17, -0x1.43ffffffea602p-17}, + {0x1.4748c08dc0976p200, -0x1.6a4e98d2d8b1cp-1, -0x1.6a4e98d2d8b1bp-1}, + {-0x1.4748c08dc0976p200, 0x1.6a4e98d2d8b1cp-1, 0x1.6a4e98d2d8b1bp-1}, + {0x1.478fc08p43, -0x1.b57ca8aacf2a9p-1, -0x1.b57ca8aacf2aap-1}, + {-0x1.478fc08p43, 0x1.b57ca8aacf2a9p-1, 0x1.b57ca8aacf2aap-1}, + {0x1.4cf36d17c596ep200, 0x1.ffe38008ef6b5p-1, 0x1.ffe38008ef6b4p-1}, + {-0x1.4cf36d17c596ep200, -0x1.ffe38008ef6b5p-1, -0x1.ffe38008ef6b4p-1}, + {0x1.4f0f308p488, 0x1.d6457a3f12e6cp-1, 0x1.d6457a3f12e6dp-1}, + {-0x1.4f0f308p488, -0x1.d6457a3f12e6cp-1, -0x1.d6457a3f12e6dp-1}, + {0x1.5p-20, 0x1.4fffffffff9f9p-20, 0x1.4fffffffff9f8p-20}, + {-0x1.5p-20, -0x1.4fffffffff9f9p-20, -0x1.4fffffffff9f8p-20}, + {0x1.5143e25a488f1p3, -0x1.cbad095f503a2p-1, -0x1.cbad095f503a1p-1}, + {-0x1.5143e25a488f1p3, 0x1.cbad095f503a2p-1, 0x1.cbad095f503a1p-1}, + {0x1.51f0f44da4df4p200, -0x1.f942d6262e82ep-5, -0x1.f942d6262e82dp-5}, + {-0x1.51f0f44da4df4p200, 0x1.f942d6262e82ep-5, 0x1.f942d6262e82dp-5}, + {0x1.52ad6c5a3602fp16, -0x1.fc466ccaece8p-3, -0x1.fc466ccaece81p-3}, + {-0x1.52ad6c5a3602fp16, 0x1.fc466ccaece8p-3, 0x1.fc466ccaece81p-3}, + {0x1.52f00ep793, 0x1.d69c3cf4eecdep-1, 0x1.d69c3cf4eecddp-1}, + {-0x1.52f00ep793, -0x1.d69c3cf4eecdep-1, -0x1.d69c3cf4eecddp-1}, + {0x1.5555555555556p239, 0x1.e120292f3d495p-1, 0x1.e120292f3d496p-1}, + {-0x1.5555555555556p239, -0x1.e120292f3d495p-1, -0x1.e120292f3d496p-1}, + {0x1.5a0000008p6, -0x1.fd1d85b7ef004p-1, -0x1.fd1d85b7ef003p-1}, + {-0x1.5a0000008p6, 0x1.fd1d85b7ef004p-1, 0x1.fd1d85b7ef003p-1}, + {0x1.5b063ad2dd08fp-6, 0x1.5aff9664b07e2p-6, 0x1.5aff9664b07e1p-6}, + {-0x1.5b063ad2dd08fp-6, -0x1.5aff9664b07e2p-6, -0x1.5aff9664b07e1p-6}, + {0x1.5b179d75fa285p2, -0x1.83f8bbb59f2f8p-1, -0x1.83f8bbb59f2f9p-1}, + {-0x1.5b179d75fa285p2, 0x1.83f8bbb59f2f8p-1, 0x1.83f8bbb59f2f9p-1}, + {0x1.5bb5967402f9cp79, 0x1.fa865b0d99497p-1, 0x1.fa865b0d99496p-1}, + {-0x1.5bb5967402f9cp79, -0x1.fa865b0d99497p-1, -0x1.fa865b0d99496p-1}, + {0x1.5bea01p468, 0x1.e8a523fce884dp-2, 0x1.e8a523fce884ep-2}, + {-0x1.5bea01p468, -0x1.e8a523fce884dp-2, -0x1.e8a523fce884ep-2}, + {0x1.5f19fbc507af6p9, -0x1.ff2ad941f0a41p-1, -0x1.ff2ad941f0a4p-1}, + {-0x1.5f19fbc507af6p9, 0x1.ff2ad941f0a41p-1, 0x1.ff2ad941f0a4p-1}, + {0x1.60a610a658da9p889, -0x1.75ce4a0d0bd03p-1, -0x1.75ce4a0d0bd04p-1}, + {-0x1.60a610a658da9p889, 0x1.75ce4a0d0bd03p-1, 0x1.75ce4a0d0bd04p-1}, + {0x1.62ad7ce17143dp62, -0x1.721586594ab48p-1, -0x1.721586594ab49p-1}, + {-0x1.62ad7ce17143dp62, 0x1.721586594ab48p-1, 0x1.721586594ab49p-1}, + {0x1.645926cc1132cp9, 0x1.b8d27019d1b9fp-2, 0x1.b8d27019d1b9ep-2}, + {-0x1.645926cc1132cp9, -0x1.b8d27019d1b9fp-2, -0x1.b8d27019d1b9ep-2}, + {0x1.647e25d391f17p-9, 0x1.647e09059c1eap-9, 0x1.647e09059c1e9p-9}, + {-0x1.647e25d391f17p-9, -0x1.647e09059c1eap-9, -0x1.647e09059c1e9p-9}, + {0x1.64ef438p142, -0x1.8d3b53ff85a82p-1, -0x1.8d3b53ff85a83p-1}, + {-0x1.64ef438p142, 0x1.8d3b53ff85a82p-1, 0x1.8d3b53ff85a83p-1}, + {0x1.6599665996658p3, -0x1.f7c8630e62a02p-1, -0x1.f7c8630e62a01p-1}, + {-0x1.6599665996658p3, 0x1.f7c8630e62a02p-1, 0x1.f7c8630e62a01p-1}, + {0x1.672p-5, 0x1.67028e3602035p-5, 0x1.67028e3602034p-5}, + {-0x1.672p-5, -0x1.67028e3602035p-5, -0x1.67028e3602034p-5}, + {0x1.688ae6c138ea8p299, 0x1.bc60c8c33cb5fp-2, 0x1.bc60c8c33cb5ep-2}, + {-0x1.688ae6c138ea8p299, -0x1.bc60c8c33cb5fp-2, -0x1.bc60c8c33cb5ep-2}, + {0x1.6aa78p17, -0x1.fc3b4bb8b012ep-1, -0x1.fc3b4bb8b012fp-1}, + {-0x1.6aa78p17, 0x1.fc3b4bb8b012ep-1, 0x1.fc3b4bb8b012fp-1}, + {0x1.6ac5b262ca1ffp849, 0x1.0p0, 0x1.0p0}, + {-0x1.6ac5b262ca1ffp849, -0x1.0p0, -0x1.0p0}, + {0x1.6d88083749412p4, -0x1.82317836a97c8p-1, -0x1.82317836a97c9p-1}, + {-0x1.6d88083749412p4, 0x1.82317836a97c8p-1, 0x1.82317836a97c9p-1}, + {0x1.6f8p-6, 0x1.6f781c78cc82bp-6, 0x1.6f781c78cc82ap-6}, + {-0x1.6f8p-6, -0x1.6f781c78cc82bp-6, -0x1.6f781c78cc82ap-6}, + {0x1.729aa6859d1f4p396, -0x1.fdbe5085494aep-1, -0x1.fdbe5085494afp-1}, + {-0x1.729aa6859d1f4p396, 0x1.fdbe5085494aep-1, 0x1.fdbe5085494afp-1}, + {0x1.73e2dbe9a2f8p10, -0x1.fffffae862b5p-1, -0x1.fffffae862b4fp-1}, + {-0x1.73e2dbe9a2f8p10, 0x1.fffffae862b5p-1, 0x1.fffffae862b4fp-1}, + {0x1.769cde0b90b8p-7, 0x1.769ac74459b06p-7, 0x1.769ac74459b05p-7}, + {-0x1.769cde0b90b8p-7, -0x1.769ac74459b06p-7, -0x1.769ac74459b05p-7}, + {0x1.76cp-5, 0x1.769e8afb6a4ecp-5, 0x1.769e8afb6a4ebp-5}, + {-0x1.76cp-5, -0x1.769e8afb6a4ecp-5, -0x1.769e8afb6a4ebp-5}, + {0x1.78001p0, 0x1.fd562611f5bd4p-1, 0x1.fd562611f5bd5p-1}, + {-0x1.78001p0, -0x1.fd562611f5bd4p-1, -0x1.fd562611f5bd5p-1}, + {0x1.7ap0, 0x1.fdba784ca00f2p-1, 0x1.fdba784ca00f1p-1}, + {-0x1.7ap0, -0x1.fdba784ca00f2p-1, -0x1.fdba784ca00f1p-1}, + {0x1.7abd870381c2dp38, 0x1.f930c222a8683p-5, 0x1.f930c222a8682p-5}, + {-0x1.7abd870381c2dp38, -0x1.f930c222a8683p-5, -0x1.f930c222a8682p-5}, + {0x1.7dc945c21248p95, 0x1.ffeb2ff2b6923p-1, 0x1.ffeb2ff2b6924p-1}, + {-0x1.7dc945c21248p95, -0x1.ffeb2ff2b6923p-1, -0x1.ffeb2ff2b6924p-1}, + {0x1.7f73e1594b70cp98, 0x1.b279153c23fb2p-2, 0x1.b279153c23fb1p-2}, + {-0x1.7f73e1594b70cp98, -0x1.b279153c23fb2p-2, -0x1.b279153c23fb1p-2}, + {0x1.7f7ef77e83f1ap21, -0x1.599fad35cf60bp-41, -0x1.599fad35cf60ap-41}, + {-0x1.7f7ef77e83f1ap21, 0x1.599fad35cf60bp-41, 0x1.599fad35cf60ap-41}, + {0x1.8p0, 0x1.feb7a9b2c6d8bp-1, 0x1.feb7a9b2c6d8ap-1}, + {-0x1.8p0, -0x1.feb7a9b2c6d8bp-1, -0x1.feb7a9b2c6d8ap-1}, + {0x1.8p6, 0x1.f798d01ec615cp-1, 0x1.f798d01ec615bp-1}, + {-0x1.8p6, -0x1.f798d01ec615cp-1, -0x1.f798d01ec615bp-1}, + {0x1.8132ceb1c4f39p0, 0x1.fee1a2a977bcfp-1, 0x1.fee1a2a977bcep-1}, + {-0x1.8132ceb1c4f39p0, -0x1.fee1a2a977bcfp-1, -0x1.fee1a2a977bcep-1}, + {0x1.81ae0dffa3b33p959, -0x1.24245af4cd995p-52, -0x1.24245af4cd994p-52}, + {-0x1.81ae0dffa3b33p959, 0x1.24245af4cd995p-52, 0x1.24245af4cd994p-52}, + {0x1.85ec5a399a2e6p1, 0x1.85d41b0bf3091p-4, 0x1.85d41b0bf309p-4}, + {-0x1.85ec5a399a2e6p1, -0x1.85d41b0bf3091p-4, -0x1.85d41b0bf309p-4}, + {0x1.86a0092754022p16, 0x1.1e42ae3cfbdc6p-24, 0x1.1e42ae3cfbdc7p-24}, + {-0x1.86a0092754022p16, -0x1.1e42ae3cfbdc6p-24, -0x1.1e42ae3cfbdc7p-24}, + {0x1.8720588p392, -0x1.dbf4e594cefe1p-1, -0x1.dbf4e594cefe2p-1}, + {-0x1.8720588p392, 0x1.dbf4e594cefe1p-1, 0x1.dbf4e594cefe2p-1}, + {0x1.8929354ebc6aap43, 0x1.44302d6a82d4p-9, 0x1.44302d6a82d41p-9}, + {-0x1.8929354ebc6aap43, -0x1.44302d6a82d4p-9, -0x1.44302d6a82d41p-9}, + {0x1.8a791e4791e75p-5, 0x1.8a52189ec3487p-5, 0x1.8a52189ec3488p-5}, + {-0x1.8a791e4791e75p-5, -0x1.8a52189ec3487p-5, -0x1.8a52189ec3488p-5}, + {0x1.8ba761438f5edp11, -0x1.fe8566e538123p-1, -0x1.fe8566e538122p-1}, + {-0x1.8ba761438f5edp11, 0x1.fe8566e538123p-1, 0x1.fe8566e538122p-1}, + {0x1.8eaf16de6392p0, 0x1.fff42aca4cb5ap-1, 0x1.fff42aca4cb5bp-1}, + {-0x1.8eaf16de6392p0, -0x1.fff42aca4cb5ap-1, -0x1.fff42aca4cb5bp-1}, + {0x1.9p0, 0x1.fffb7d3f3a253p-1, 0x1.fffb7d3f3a252p-1}, + {-0x1.9p0, -0x1.fffb7d3f3a253p-1, -0x1.fffb7d3f3a252p-1}, + {0x1.91a5657fb6a9ap6, -0x1.e815770667fd9p-4, -0x1.e815770667fd8p-4}, + {-0x1.91a5657fb6a9ap6, 0x1.e815770667fd9p-4, 0x1.e815770667fd8p-4}, + {0x1.921fb54468847p37, -0x1.fffffffd311dcp-1, -0x1.fffffffd311ddp-1}, + {-0x1.921fb54468847p37, 0x1.fffffffd311dcp-1, 0x1.fffffffd311ddp-1}, + {0x1.921ff54442d18p2, 0x1.ffffffff875e6p-17, 0x1.ffffffff875e5p-17}, + {-0x1.921ff54442d18p2, -0x1.ffffffff875e6p-17, -0x1.ffffffff875e5p-17}, + {0x1.928p2, 0x1.812a5da3777cdp-8, 0x1.812a5da3777cep-8}, + {-0x1.928p2, -0x1.812a5da3777cdp-8, -0x1.812a5da3777cep-8}, + {0x1.94ap0, 0x1.fff9be8d82573p-1, 0x1.fff9be8d82572p-1}, + {-0x1.94ap0, -0x1.fff9be8d82573p-1, -0x1.fff9be8d82572p-1}, + {0x1.94a5294a51bdep-5, 0x1.947b0ace235f3p-5, 0x1.947b0ace235f2p-5}, + {-0x1.94a5294a51bdep-5, -0x1.947b0ace235f3p-5, -0x1.947b0ace235f2p-5}, + {0x1.94a5294a52948p100, 0x1.c34f70e55a708p-2, 0x1.c34f70e55a707p-2}, + {-0x1.94a5294a52948p100, -0x1.c34f70e55a708p-2, -0x1.c34f70e55a707p-2}, + {0x1.95361b8f7697dp-5, 0x1.950bcfc0f3d51p-5, 0x1.950bcfc0f3d5p-5}, + {-0x1.95361b8f7697dp-5, -0x1.950bcfc0f3d51p-5, -0x1.950bcfc0f3d5p-5}, + {0x1.956p-1, 0x1.6c548bfcce696p-1, 0x1.6c548bfcce695p-1}, + {-0x1.956p-1, -0x1.6c548bfcce696p-1, -0x1.6c548bfcce695p-1}, + {0x1.962p0, 0x1.ffeffdbf67ca6p-1, 0x1.ffeffdbf67ca7p-1}, + {-0x1.962p0, -0x1.ffeffdbf67ca6p-1, -0x1.ffeffdbf67ca7p-1}, + {0x1.97330d2ea16d9p-5, 0x1.9708213bf67f5p-5, 0x1.9708213bf67f4p-5}, + {-0x1.97330d2ea16d9p-5, -0x1.9708213bf67f5p-5, -0x1.9708213bf67f4p-5}, + {0x1.9756f073b6b61p-5, 0x1.972bf92713d51p-5, 0x1.972bf92713d5p-5}, + {-0x1.9756f073b6b61p-5, -0x1.972bf92713d51p-5, -0x1.972bf92713d5p-5}, + {0x1.97935055cec1bp-5, 0x1.976845ebe7119p-5, 0x1.976845ebe7118p-5}, + {-0x1.97935055cec1bp-5, -0x1.976845ebe7119p-5, -0x1.976845ebe7118p-5}, + {0x1.98p-4, 0x1.97535cee51a43p-4, 0x1.97535cee51a42p-4}, + {-0x1.98p-4, -0x1.97535cee51a43p-4, -0x1.97535cee51a42p-4}, + {0x1.999999a42160cp-1, 0x1.6f494c3356177p-1, 0x1.6f494c3356178p-1}, + {-0x1.999999a42160cp-1, -0x1.6f494c3356177p-1, -0x1.6f494c3356178p-1}, + {0x1.999999aab8f5p-1, 0x1.6f494c37edd6ep-1, 0x1.6f494c37edd6dp-1}, + {-0x1.999999aab8f5p-1, -0x1.6f494c37edd6ep-1, -0x1.6f494c37edd6dp-1}, + {0x1.9a2324b9c6326p-1, 0x1.6fa912bdeaab2p-1, 0x1.6fa912bdeaab3p-1}, + {-0x1.9a2324b9c6326p-1, -0x1.6fa912bdeaab2p-1, -0x1.6fa912bdeaab3p-1}, + {0x1.9bcp-1, 0x1.70c7ef4ef9b34p-1, 0x1.70c7ef4ef9b35p-1}, + {-0x1.9bcp-1, -0x1.70c7ef4ef9b34p-1, -0x1.70c7ef4ef9b35p-1}, + {0x1.a0d1d817d6c4ap0, 0x1.ff28176ad3164p-1, 0x1.ff28176ad3163p-1}, + {-0x1.a0d1d817d6c4ap0, -0x1.ff28176ad3164p-1, -0x1.ff28176ad3163p-1}, + {0x1.a141c9de12fdfp-1, 0x1.749468a7248dep-1, 0x1.749468a7248ddp-1}, + {-0x1.a141c9de12fdfp-1, -0x1.749468a7248dep-1, -0x1.749468a7248ddp-1}, + {0x1.a251bc6766f2p-1, 0x1.754ebb7e73f46p-1, 0x1.754ebb7e73f45p-1}, + {-0x1.a251bc6766f2p-1, -0x1.754ebb7e73f46p-1, -0x1.754ebb7e73f45p-1}, + {0x1.a2689ae1b86ddp62, -0x1.7c3bfefa74bd1p-1, -0x1.7c3bfefa74bdp-1}, + {-0x1.a2689ae1b86ddp62, 0x1.7c3bfefa74bd1p-1, 0x1.7c3bfefa74bdp-1}, + {0x1.a3f66180c455p100, -0x1.ffff4f3648e03p-1, -0x1.ffff4f3648e02p-1}, + {-0x1.a3f66180c455p100, 0x1.ffff4f3648e03p-1, 0x1.ffff4f3648e02p-1}, + {0x1.a3fdd2a5286c3p1, -0x1.1cf463983c0e3p-3, -0x1.1cf463983c0e2p-3}, + {-0x1.a3fdd2a5286c3p1, 0x1.1cf463983c0e3p-3, 0x1.1cf463983c0e2p-3}, + {0x1.a44p0, 0x1.feb7948d224d8p-1, 0x1.feb7948d224d7p-1}, + {-0x1.a44p0, -0x1.feb7948d224d8p-1, -0x1.feb7948d224d7p-1}, + {0x1.a701ef3c7d54bp-1, 0x1.78801e3e11665p-1, 0x1.78801e3e11664p-1}, + {-0x1.a701ef3c7d54bp-1, -0x1.78801e3e11665p-1, -0x1.78801e3e11664p-1}, + {0x1.a8c01fd43cp537, -0x1.fff11e871d59cp-1, -0x1.fff11e871d59dp-1}, + {-0x1.a8c01fd43cp537, 0x1.fff11e871d59cp-1, 0x1.fff11e871d59dp-1}, + {0x1.a8e29b7602f3bp0, 0x1.fdfa4366eb733p-1, 0x1.fdfa4366eb734p-1}, + {-0x1.a8e29b7602f3bp0, -0x1.fdfa4366eb733p-1, -0x1.fdfa4366eb734p-1}, + {0x1.a94p0, 0x1.fde98b94e7948p-1, 0x1.fde98b94e7947p-1}, + {-0x1.a94p0, -0x1.fde98b94e7948p-1, -0x1.fde98b94e7947p-1}, + {0x1.aa445fce93b82p2, 0x1.7931cba100008p-2, 0x1.7931cba100009p-2}, + {-0x1.aa445fce93b82p2, -0x1.7931cba100008p-2, -0x1.7931cba100009p-2}, + {0x1.aaa3fbc359fbep-1, 0x1.7af3f76c7a708p-1, 0x1.7af3f76c7a709p-1}, + {-0x1.aaa3fbc359fbep-1, -0x1.7af3f76c7a708p-1, -0x1.7af3f76c7a709p-1}, + {0x1.abdd3dbd4d86p119, 0x1.fd74e53ae32fdp-6, 0x1.fd74e53ae32fcp-6}, + {-0x1.abdd3dbd4d86p119, -0x1.fd74e53ae32fdp-6, -0x1.fd74e53ae32fcp-6}, + {0x1.ae2165a0c9f8ep-1, 0x1.7d4a7bf183a34p-1, 0x1.7d4a7bf183a33p-1}, + {-0x1.ae2165a0c9f8ep-1, -0x1.7d4a7bf183a34p-1, -0x1.7d4a7bf183a33p-1}, + {0x1.ae8dfefcfe13bp2, 0x1.b81410edc79e1p-2, 0x1.b81410edc79ep-2}, + {-0x1.ae8dfefcfe13bp2, -0x1.b81410edc79e1p-2, -0x1.b81410edc79ep-2}, + {0x1.b5597f950ee8cp29, -0x1.ff751561dc50ap-2, -0x1.ff751561dc509p-2}, + {-0x1.b5597f950ee8cp29, 0x1.ff751561dc50ap-2, 0x1.ff751561dc509p-2}, + {0x1.bab62ed655019p970, 0x1.027d184afb198p-52, 0x1.027d184afb199p-52}, + {-0x1.bab62ed655019p970, -0x1.027d184afb198p-52, -0x1.027d184afb199p-52}, + {0x1.bc573c4ffffffp-10, 0x1.bc572e5e413e1p-10, 0x1.bc572e5e413e2p-10}, + {-0x1.bc573c4ffffffp-10, -0x1.bc572e5e413e1p-10, -0x1.bc572e5e413e2p-10}, + {0x1.bef5cd25ab1adp9, 0x1.fb300f1e39afep-1, 0x1.fb300f1e39affp-1}, + {-0x1.bef5cd25ab1adp9, -0x1.fb300f1e39afep-1, -0x1.fb300f1e39affp-1}, + {0x1.bfdf6df2a24c1p-2, 0x1.b1baaf622d3a3p-2, 0x1.b1baaf622d3a2p-2}, + {-0x1.bfdf6df2a24c1p-2, -0x1.b1baaf622d3a3p-2, -0x1.b1baaf622d3a2p-2}, + {0x1.bfffffdffffffp-1, 0x1.88fb762c35ce4p-1, 0x1.88fb762c35ce3p-1}, + {-0x1.bfffffdffffffp-1, -0x1.88fb762c35ce4p-1, -0x1.88fb762c35ce3p-1}, + {0x1.c2b489520e376p920, 0x1.fe0ebff99ab8dp-1, 0x1.fe0ebff99ab8cp-1}, + {-0x1.c2b489520e376p920, -0x1.fe0ebff99ab8dp-1, -0x1.fe0ebff99ab8cp-1}, + {0x1.c54beb008547p5, 0x1.cf7f749f2a836p-4, 0x1.cf7f749f2a835p-4}, + {-0x1.c54beb008547p5, -0x1.cf7f749f2a836p-4, -0x1.cf7f749f2a835p-4}, + {0x1.c5ad34f5f472ap-2, 0x1.b6facf6658915p-2, 0x1.b6facf6658914p-2}, + {-0x1.c5ad34f5f472ap-2, -0x1.b6facf6658915p-2, -0x1.b6facf6658914p-2}, + {0x1.c728fc2f34bd6p-2, 0x1.b851cd9b84ee7p-2, 0x1.b851cd9b84ee6p-2}, + {-0x1.c728fc2f34bd6p-2, -0x1.b851cd9b84ee7p-2, -0x1.b851cd9b84ee6p-2}, + {0x1.c92b0f6105089p-2, 0x1.ba21b53cf2ff3p-2, 0x1.ba21b53cf2ff2p-2}, + {-0x1.c92b0f6105089p-2, -0x1.ba21b53cf2ff3p-2, -0x1.ba21b53cf2ff2p-2}, + {0x1.c9dfbbe9ec704p-5, 0x1.c9a2b68e30ec7p-5, 0x1.c9a2b68e30ec8p-5}, + {-0x1.c9dfbbe9ec704p-5, -0x1.c9a2b68e30ec7p-5, -0x1.c9a2b68e30ec8p-5}, + {0x1.caf31bd7ee217p0, 0x1.f370115c9ab35p-1, 0x1.f370115c9ab36p-1}, + {-0x1.caf31bd7ee217p0, -0x1.f370115c9ab35p-1, -0x1.f370115c9ab36p-1}, + {0x1.cb44e86bc192bp648, -0x1.dd38a1f1d289bp-54, -0x1.dd38a1f1d289cp-54}, + {-0x1.cb44e86bc192bp648, 0x1.dd38a1f1d289bp-54, 0x1.dd38a1f1d289cp-54}, + {0x1.cb44e86bc192bp649, 0x1.dd38a1f1d289bp-53, 0x1.dd38a1f1d289cp-53}, + {-0x1.cb44e86bc192bp649, -0x1.dd38a1f1d289bp-53, -0x1.dd38a1f1d289cp-53}, + {0x1.cb6p-3, 0x1.c7885aef33a95p-3, 0x1.c7885aef33a94p-3}, + {-0x1.cb6p-3, -0x1.c7885aef33a95p-3, -0x1.c7885aef33a94p-3}, + {0x1.ce2271d2f662fp-4, 0x1.cd279aa6196b6p-4, 0x1.cd279aa6196b5p-4}, + {-0x1.ce2271d2f662fp-4, -0x1.cd279aa6196b6p-4, -0x1.cd279aa6196b5p-4}, + {0x1.d0000000004p-1, 0x1.930b705f9fad2p-1, 0x1.930b705f9fad1p-1}, + {-0x1.d0000000004p-1, -0x1.930b705f9fad2p-1, -0x1.930b705f9fad1p-1}, + {0x1.d01p199, 0x1.7ef24c8e67d9ap-1, 0x1.7ef24c8e67d9bp-1}, + {-0x1.d01p199, -0x1.7ef24c8e67d9ap-1, -0x1.7ef24c8e67d9bp-1}, + {0x1.d024ba6f953cfp1000, 0x1.ffff124c001abp-1, 0x1.ffff124c001aap-1}, + {-0x1.d024ba6f953cfp1000, -0x1.ffff124c001abp-1, -0x1.ffff124c001aap-1}, + {0x1.d4067c60f471ep1, -0x1.f83a0983dd15dp-2, -0x1.f83a0983dd15ep-2}, + {-0x1.d4067c60f471ep1, 0x1.f83a0983dd15dp-2, 0x1.f83a0983dd15ep-2}, + {0x1.d7de6263bcaabp-5, 0x1.d79b9896ff555p-5, 0x1.d79b9896ff554p-5}, + {-0x1.d7de6263bcaabp-5, -0x1.d79b9896ff555p-5, -0x1.d79b9896ff554p-5}, + {0x1.d800000002274p0, 0x1.ed0b908a2983p-1, 0x1.ed0b908a2982fp-1}, + {-0x1.d800000002274p0, -0x1.ed0b908a2983p-1, -0x1.ed0b908a2982fp-1}, + {0x1.d96e058p488, -0x1.f2c217cbc7dcdp-1, -0x1.f2c217cbc7dccp-1}, + {-0x1.d96e058p488, 0x1.f2c217cbc7dcdp-1, 0x1.f2c217cbc7dccp-1}, + {0x1.d98c4c612718dp-1, 0x1.98dcd09337793p-1, 0x1.98dcd09337792p-1}, + {-0x1.d98c4c612718dp-1, -0x1.98dcd09337793p-1, -0x1.98dcd09337792p-1}, + {0x1.db8p-5, 0x1.db3ba8775ca26p-5, 0x1.db3ba8775ca25p-5}, + {-0x1.db8p-5, -0x1.db3ba8775ca26p-5, -0x1.db3ba8775ca25p-5}, + {0x1.de386d6090303p200, -0x1.9fee37697d582p-2, -0x1.9fee37697d583p-2}, + {-0x1.de386d6090303p200, 0x1.9fee37697d582p-2, 0x1.9fee37697d583p-2}, + {0x1.de5e5054e921bp35, -0x1.5361ee6553188p-53, -0x1.5361ee6553189p-53}, + {-0x1.de5e5054e921bp35, 0x1.5361ee6553188p-53, 0x1.5361ee6553189p-53}, + {0x1.df77ddf77ddf4p10, 0x1.fec48d5e769ecp-1, 0x1.fec48d5e769ebp-1}, + {-0x1.df77ddf77ddf4p10, -0x1.fec48d5e769ecp-1, -0x1.fec48d5e769ebp-1}, + {0x1.e1562b0448a86p1, -0x1.2902a83d72632p-1, -0x1.2902a83d72633p-1}, + {-0x1.e1562b0448a86p1, 0x1.2902a83d72632p-1, 0x1.2902a83d72633p-1}, + {0x1.e2700cdc86635p-1, 0x1.9e26c7bc96b69p-1, 0x1.9e26c7bc96b68p-1}, + {-0x1.e2700cdc86635p-1, -0x1.9e26c7bc96b69p-1, -0x1.9e26c7bc96b68p-1}, + {0x1.e64ddaf7bd73p-7, 0x1.e6494911eedd2p-7, 0x1.e6494911eedd1p-7}, + {-0x1.e64ddaf7bd73p-7, -0x1.e6494911eedd2p-7, -0x1.e6494911eedd1p-7}, + {0x1.eb7239bca8afap-5, 0x1.eb26c690bda25p-5, 0x1.eb26c690bda24p-5}, + {-0x1.eb7239bca8afap-5, -0x1.eb26c690bda25p-5, -0x1.eb26c690bda24p-5}, + {0x1.ef7b83f7bdef4p3, 0x1.c73238790a4cfp-3, 0x1.c73238790a4cep-3}, + {-0x1.ef7b83f7bdef4p3, -0x1.c73238790a4cfp-3, -0x1.c73238790a4cep-3}, + {0x1.f20000000109bp-3, 0x1.ed1b575acb8c8p-3, 0x1.ed1b575acb8c9p-3}, + {-0x1.f20000000109bp-3, -0x1.ed1b575acb8c8p-3, -0x1.ed1b575acb8c9p-3}, + {0x1.f40ca67a9e8d7p9, 0x1.c1b50a56c8809p-1, 0x1.c1b50a56c880ap-1}, + {-0x1.f40ca67a9e8d7p9, -0x1.c1b50a56c8809p-1, -0x1.c1b50a56c880ap-1}, + {0x1.f7224d2c7754p-2, 0x1.e321fea643a96p-2, 0x1.e321fea643a97p-2}, + {-0x1.f7224d2c7754p-2, -0x1.e321fea643a96p-2, -0x1.e321fea643a97p-2}, + {0x1.f78a0d05e60e2p6, 0x1.c1269b020a108p-3, 0x1.c1269b020a107p-3}, + {-0x1.f78a0d05e60e2p6, -0x1.c1269b020a108p-3, -0x1.c1269b020a107p-3}, + {0x1.f7bdef7bdf073p-5, 0x1.f76cae28a0775p-5, 0x1.f76cae28a0774p-5}, + {-0x1.f7bdef7bdf073p-5, -0x1.f76cae28a0775p-5, -0x1.f76cae28a0774p-5}, + {0x1.f8502d5955443p-2, 0x1.e42c139dc2054p-2, 0x1.e42c139dc2053p-2}, + {-0x1.f8502d5955443p-2, -0x1.e42c139dc2054p-2, -0x1.e42c139dc2053p-2}, + {0x1.f8fc824d2693bp61, 0x1.0fa749e07f64p-9, 0x1.0fa749e07f63fp-9}, + {-0x1.f8fc824d2693bp61, -0x1.0fa749e07f64p-9, -0x1.0fa749e07f63fp-9}, + {0x1.f8fffffffffffp2, 0x1.ffa80324e2d8fp-1, 0x1.ffa80324e2d8ep-1}, + {-0x1.f8fffffffffffp2, -0x1.ffa80324e2d8fp-1, -0x1.ffa80324e2d8ep-1}, + {0x1.fd8p1, -0x1.7cdf79d5e37b8p-1, -0x1.7cdf79d5e37b9p-1}, + {-0x1.fd8p1, 0x1.7cdf79d5e37b8p-1, 0x1.7cdf79d5e37b9p-1}, + {0x1.fd9364d936596p-5, 0x1.fd3f48847a1d1p-5, 0x1.fd3f48847a1d2p-5}, + {-0x1.fd9364d936596p-5, -0x1.fd3f48847a1d1p-5, -0x1.fd3f48847a1d2p-5}, + {0x1.fe8p-3, 0x1.f93ad471d262fp-3, 0x1.f93ad471d263p-3}, + {-0x1.fe8p-3, -0x1.f93ad471d262fp-3, -0x1.f93ad471d263p-3}, + {0x1.febb646e2ee57p13, 0x1.83b3062414974p-1, 0x1.83b3062414973p-1}, + {-0x1.febb646e2ee57p13, -0x1.83b3062414974p-1, -0x1.83b3062414973p-1}, + {0x1.feeffffffffc6p995, 0x1.3b45bd7449775p-1, 0x1.3b45bd7449776p-1}, + {-0x1.feeffffffffc6p995, -0x1.3b45bd7449775p-1, -0x1.3b45bd7449776p-1}, + {0x1.ff8ffffffffffp7, -0x1.eefb59d143646p-1, -0x1.eefb59d143645p-1}, + {-0x1.ff8ffffffffffp7, 0x1.eefb59d143646p-1, 0x1.eefb59d143645p-1}, + {0x1.ff8ffffffffffp870, -0x1.56433f0c6bceep-1, -0x1.56433f0c6bcefp-1}, + {-0x1.ff8ffffffffffp870, 0x1.56433f0c6bceep-1, 0x1.56433f0c6bcefp-1}, + {0x1.ffcfff8p19, -0x1.930006246a6cp-2, -0x1.930006246a6c1p-2}, + {-0x1.ffcfff8p19, 0x1.930006246a6cp-2, 0x1.930006246a6c1p-2}, + {0x1.ffcfff8p365, 0x1.ded37a1f0aa6dp-1, 0x1.ded37a1f0aa6ep-1}, + {-0x1.ffcfff8p365, -0x1.ded37a1f0aa6dp-1, -0x1.ded37a1f0aa6ep-1}, + {0x1.ffcffffffff6cp720, -0x1.93e4d96b621ep-1, -0x1.93e4d96b621e1p-1}, + {-0x1.ffcffffffff6cp720, 0x1.93e4d96b621ep-1, 0x1.93e4d96b621e1p-1}, + {0x1.ffcfffffffff9p320, 0x1.9068b90e42606p-1, 0x1.9068b90e42605p-1}, + {-0x1.ffcfffffffff9p320, -0x1.9068b90e42606p-1, -0x1.9068b90e42605p-1}, + {0x1.ffcffffffffffp12, 0x1.cf81642e7421cp-1, 0x1.cf81642e7421dp-1}, + {-0x1.ffcffffffffffp12, -0x1.cf81642e7421cp-1, -0x1.cf81642e7421dp-1}, + {0x1.ffcffffffffffp404, 0x1.ffffffe61fe61p-1, 0x1.ffffffe61fe62p-1}, + {-0x1.ffcffffffffffp404, -0x1.ffffffe61fe61p-1, -0x1.ffffffe61fe62p-1}, + {0x1.ffeffffffffccp995, -0x1.406ee9ae91e17p-1, -0x1.406ee9ae91e16p-1}, + {-0x1.ffeffffffffccp995, 0x1.406ee9ae91e17p-1, 0x1.406ee9ae91e16p-1}, + {0x1.ffeffffffffffp-3, 0x1.fa9f6ca0ec44ep-3, 0x1.fa9f6ca0ec44fp-3}, + {-0x1.ffeffffffffffp-3, -0x1.fa9f6ca0ec44ep-3, -0x1.fa9f6ca0ec44fp-3}, + {0x1.ffeffffffffffp55, 0x1.6b491db8b66d9p-4, 0x1.6b491db8b66d8p-4}, + {-0x1.ffeffffffffffp55, -0x1.6b491db8b66d9p-4, -0x1.6b491db8b66d8p-4}, + {0x1.ffeffffffffffp180, 0x1.fb0ab102cb13p-1, 0x1.fb0ab102cb12fp-1}, + {-0x1.ffeffffffffffp180, -0x1.fb0ab102cb13p-1, -0x1.fb0ab102cb12fp-1}, + {0x1.ffeffffffffffp706, 0x1.e4315ec04635dp-3, 0x1.e4315ec04635cp-3}, + {-0x1.ffeffffffffffp706, -0x1.e4315ec04635dp-3, -0x1.e4315ec04635cp-3}, + {0x1.fff1fffffffffp41, 0x1.ffffc39997ef6p-1, 0x1.ffffc39997ef7p-1}, + {-0x1.fff1fffffffffp41, -0x1.ffffc39997ef6p-1, -0x1.ffffc39997ef7p-1}, + {0x1.fff6b89ffffffp-7, 0x1.fff163992831fp-7, 0x1.fff163992831ep-7}, + {-0x1.fff6b89ffffffp-7, -0x1.fff163992831fp-7, -0x1.fff163992831ep-7}, + {0x1.fffdffff0001fp105, -0x1.d9757a05fcc43p-1, -0x1.d9757a05fcc42p-1}, + {-0x1.fffdffff0001fp105, 0x1.d9757a05fcc43p-1, 0x1.d9757a05fcc42p-1}, + {0x1.ffff0c0000002p1, -0x1.83791fe63a17ap-1, -0x1.83791fe63a17bp-1}, + {-0x1.ffff0c0000002p1, 0x1.83791fe63a17ap-1, 0x1.83791fe63a17bp-1}, + {0x1.ffffc00000055p150, -0x1.d9d3a85acc50dp-1, -0x1.d9d3a85acc50cp-1}, + {-0x1.ffffc00000055p150, 0x1.d9d3a85acc50dp-1, 0x1.d9d3a85acc50cp-1}, + {0x1.ffffe3fffffffp40, -0x1.f25d858dcdee7p-3, -0x1.f25d858dcdee8p-3}, + {-0x1.ffffe3fffffffp40, 0x1.f25d858dcdee7p-3, 0x1.f25d858dcdee8p-3}, + {0x1.ffffefffcffaep0, 0x1.d18f7bfe557ecp-1, 0x1.d18f7bfe557ebp-1}, + {-0x1.ffffefffcffaep0, -0x1.d18f7bfe557ecp-1, -0x1.d18f7bfe557ebp-1}, + {0x1.fffffbfffffffp228, -0x1.bc14ebf6bfb52p-4, -0x1.bc14ebf6bfb51p-4}, + {-0x1.fffffbfffffffp228, 0x1.bc14ebf6bfb52p-4, 0x1.bc14ebf6bfb51p-4}, + {0x1.fffffbfffffffp735, 0x1.bb887a06f6c51p-3, 0x1.bb887a06f6c5p-3}, + {-0x1.fffffbfffffffp735, -0x1.bb887a06f6c51p-3, -0x1.bb887a06f6c5p-3}, + {0x1.fffffefffffffp-5, 0x1.ffaaadef54e2fp-5, 0x1.ffaaadef54e3p-5}, + {-0x1.fffffefffffffp-5, -0x1.ffaaadef54e2fp-5, -0x1.ffaaadef54e3p-5}, + {0x1.ffffff8p119, 0x1.d4a3c62c5be09p-1, 0x1.d4a3c62c5be08p-1}, + {-0x1.ffffff8p119, -0x1.d4a3c62c5be09p-1, -0x1.d4a3c62c5be08p-1}, + {0x1.ffffff8p192, 0x1.cec20f197703fp-3, 0x1.cec20f197704p-3}, + {-0x1.ffffff8p192, -0x1.cec20f197703fp-3, -0x1.cec20f197704p-3}, + {0x1.ffffff8p543, 0x1.d37aadc7c8662p-2, 0x1.d37aadc7c8663p-2}, + {-0x1.ffffff8p543, -0x1.d37aadc7c8662p-2, -0x1.d37aadc7c8663p-2}, + {0x1.ffffffc0018ffp2, 0x1.fa8d2a4d0a202p-1, 0x1.fa8d2a4d0a203p-1}, + {-0x1.ffffffc0018ffp2, -0x1.fa8d2a4d0a202p-1, -0x1.fa8d2a4d0a203p-1}, + {0x1.ffffffffeffffp2, 0x1.fa8d2a029f978p-1, 0x1.fa8d2a029f977p-1}, + {-0x1.ffffffffeffffp2, -0x1.fa8d2a029f978p-1, -0x1.fa8d2a029f977p-1}, + {0x1.fffffffff825p943, -0x1.2763f02a2d1eap-4, -0x1.2763f02a2d1e9p-4}, + {-0x1.fffffffff825p943, 0x1.2763f02a2d1eap-4, 0x1.2763f02a2d1e9p-4}, + {0x1.fffffffffe09dp320, 0x1.fcff128f77ddbp-1, 0x1.fcff128f77ddap-1}, + {-0x1.fffffffffe09dp320, -0x1.fcff128f77ddbp-1, -0x1.fcff128f77ddap-1}, + {0x1.fffffffffe6e3p720, -0x1.fcc0bfedd84a6p-1, -0x1.fcc0bfedd84a5p-1}, + {-0x1.fffffffffe6e3p720, 0x1.fcc0bfedd84a6p-1, 0x1.fcc0bfedd84a5p-1}, + {0x1.ffffffffffe7fp-1, 0x1.aed548f090c1ep-1, 0x1.aed548f090c1dp-1}, + {-0x1.ffffffffffe7fp-1, -0x1.aed548f090c1ep-1, -0x1.aed548f090c1dp-1}, + {0x1.ffffffffffeffp250, -0x1.f5e11def99d2bp-1, -0x1.f5e11def99d2cp-1}, + {-0x1.ffffffffffeffp250, 0x1.f5e11def99d2bp-1, 0x1.f5e11def99d2cp-1}, + {0x1.fffffffffff78p920, 0x1.8a9cbf48fec9fp-1, 0x1.8a9cbf48fecap-1}, + {-0x1.fffffffffff78p920, -0x1.8a9cbf48fec9fp-1, -0x1.8a9cbf48fecap-1}, + {0x1.fffffffffff83p150, -0x1.7eba5894844ccp-3, -0x1.7eba5894844cdp-3}, + {-0x1.fffffffffff83p150, 0x1.7eba5894844ccp-3, 0x1.7eba5894844cdp-3}, + {0x1.fffffffffffd5p995, 0x1.92c4f06d2cdd1p-1, 0x1.92c4f06d2cdd2p-1}, + {-0x1.fffffffffffd5p995, -0x1.92c4f06d2cdd1p-1, -0x1.92c4f06d2cdd2p-1}, + {0x1.fffffffffffe8p720, -0x1.3d5f7deb1d3bbp-1, -0x1.3d5f7deb1d3bap-1}, + {-0x1.fffffffffffe8p720, 0x1.3d5f7deb1d3bbp-1, 0x1.3d5f7deb1d3bap-1}, + {0x1.fffffffffffebp920, -0x1.91349b0ae90e5p-1, -0x1.91349b0ae90e6p-1}, + {-0x1.fffffffffffebp920, 0x1.91349b0ae90e5p-1, 0x1.91349b0ae90e6p-1}, + {0x1.ffffffffffff1p1, -0x1.837b9dddc1e88p-1, -0x1.837b9dddc1e87p-1}, + {-0x1.ffffffffffff1p1, 0x1.837b9dddc1e88p-1, 0x1.837b9dddc1e87p-1}, + {0x1.ffffffffffff1p245, 0x1.510e062e7fa2p-1, 0x1.510e062e7fa21p-1}, + {-0x1.ffffffffffff1p245, -0x1.510e062e7fa2p-1, -0x1.510e062e7fa21p-1}, + {0x1.ffffffffffff3p-2, 0x1.eaee8744b05e5p-2, 0x1.eaee8744b05e4p-2}, + {-0x1.ffffffffffff3p-2, -0x1.eaee8744b05e5p-2, -0x1.eaee8744b05e4p-2}, + {0x1.ffffffffffff4p845, 0x1.8a4dee8f40628p-1, 0x1.8a4dee8f40627p-1}, + {-0x1.ffffffffffff4p845, -0x1.8a4dee8f40628p-1, -0x1.8a4dee8f40627p-1}, + {0x1.ffffffffffff4p1020, 0x1.5118d6bbde07ep-1, 0x1.5118d6bbde07fp-1}, + {-0x1.ffffffffffff4p1020, -0x1.5118d6bbde07ep-1, -0x1.5118d6bbde07fp-1}, + {0x1.ffffffffffff8p616, -0x1.5cd5c53cf30a9p-1, -0x1.5cd5c53cf30aap-1}, + {-0x1.ffffffffffff8p616, 0x1.5cd5c53cf30a9p-1, 0x1.5cd5c53cf30aap-1}, + {0x1.ffffffffffffcp475, 0x1.ffffa1f0d7dafp-1, 0x1.ffffa1f0d7dbp-1}, + {-0x1.ffffffffffffcp475, -0x1.ffffa1f0d7dafp-1, -0x1.ffffa1f0d7dbp-1}, + {0x1.ffffffffffffep970, 0x1.51e9d840106d7p-1, 0x1.51e9d840106d8p-1}, + {-0x1.ffffffffffffep970, -0x1.51e9d840106d7p-1, -0x1.51e9d840106d8p-1}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {-0x1.0000000000001p-1022, -0x1.0000000000001p-1022, -0x1.0000000000001p-1022}, + {0x1.0000000000001p-1022, 0x1.0000000000001p-1022, 0x1.0000000000001p-1022}, + {-0x1.0p-1022, -0x1.0p-1022, -0x1.0p-1022}, + {0x1.0p-1022, 0x1.0p-1022, 0x1.0p-1022}, + {-0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022}, + {0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022}, + {0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022}, + {-0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022}, + {0x1.0p-1022, 0x1.0p-1022, 0x1.0p-1022}, + {-0x1.0p-1022, -0x1.0p-1022, -0x1.0p-1022}, + {0x1.0000000000001p-1022, 0x1.0000000000001p-1022, 0x1.0000000000001p-1022}, + {-0x1.0000000000001p-1022, -0x1.0000000000001p-1022, -0x1.0000000000001p-1022}, + {0x1.999999999999ap-13, 0x1.9999996de8ca2p-13, 0x1.9999996de8ca1p-13}, + {-0x1.999999999999ap-13, -0x1.9999996de8ca2p-13, -0x1.9999996de8ca1p-13}, + {0x1.999999999999ap-12, 0x1.999998ead65b9p-12, 0x1.999998ead65bap-12}, + {-0x1.999999999999ap-12, -0x1.999998ead65b9p-12, -0x1.999998ead65bap-12}, + {0x1.3333333333334p-11, 0x1.3333320c49bacp-11, 0x1.3333320c49babp-11}, + {-0x1.3333333333334p-11, -0x1.3333320c49bacp-11, -0x1.3333320c49babp-11}, + {0x1.999999999999ap-11, 0x1.999996de8ca29p-11, 0x1.999996de8ca28p-11}, + {-0x1.999999999999ap-11, -0x1.999996de8ca29p-11, -0x1.999996de8ca28p-11}, + {0x1.0p-10, 0x1.fffffaaaaaaefp-11, 0x1.fffffaaaaaaeep-11}, + {-0x1.0p-10, -0x1.fffffaaaaaaefp-11, -0x1.fffffaaaaaaeep-11}, + {0x1.3333333333333p-10, 0x1.33332e978d553p-10, 0x1.33332e978d552p-10}, + {-0x1.3333333333333p-10, -0x1.33332e978d553p-10, -0x1.33332e978d552p-10}, + {0x1.6666666666666p-10, 0x1.66665f1529bp-10, 0x1.66665f1529affp-10}, + {-0x1.6666666666666p-10, -0x1.66665f1529bp-10, -0x1.66665f1529affp-10}, + {0x1.9999999999999p-10, 0x1.99998ead65cep-10, 0x1.99998ead65cdfp-10}, + {-0x1.9999999999999p-10, -0x1.99998ead65cep-10, -0x1.99998ead65cdfp-10}, + {0x1.cccccccccccccp-10, 0x1.ccccbd3f7d15dp-10, 0x1.ccccbd3f7d15ep-10}, + {-0x1.cccccccccccccp-10, -0x1.ccccbd3f7d15dp-10, -0x1.ccccbd3f7d15ep-10}, + {0x1.0666666666666p-7, 0x1.0665ae9c7b44fp-7, 0x1.0665ae9c7b44ep-7}, + {-0x1.0666666666666p-7, -0x1.0665ae9c7b44fp-7, -0x1.0665ae9c7b44ep-7}, + {0x1.cccccccccccccp-7, 0x1.ccc8e97b59f62p-7, 0x1.ccc8e97b59f61p-7}, + {-0x1.cccccccccccccp-7, -0x1.ccc8e97b59f62p-7, -0x1.ccc8e97b59f61p-7}, + {0x1.4999999999999p-6, 0x1.4993e8a8ff79bp-6, 0x1.4993e8a8ff79cp-6}, + {-0x1.4999999999999p-6, -0x1.4993e8a8ff79bp-6, -0x1.4993e8a8ff79cp-6}, + {0x1.accccccccccccp-6, 0x1.acc044c56db0ep-6, 0x1.acc044c56db0fp-6}, + {-0x1.accccccccccccp-6, -0x1.acc044c56db0ep-6, -0x1.acc044c56db0fp-6}, + {0x1.08p-5, 0x1.07f44d67cf41bp-5, 0x1.07f44d67cf41ap-5}, + {-0x1.08p-5, -0x1.07f44d67cf41bp-5, -0x1.07f44d67cf41ap-5}, + {0x1.399999999999ap-5, 0x1.3985fe46f1c87p-5, 0x1.3985fe46f1c88p-5}, + {-0x1.399999999999ap-5, -0x1.3985fe46f1c87p-5, -0x1.3985fe46f1c88p-5}, + {0x1.6b33333333334p-5, 0x1.6b14bde93ac5fp-5, 0x1.6b14bde93ac6p-5}, + {-0x1.6b33333333334p-5, -0x1.6b14bde93ac5fp-5, -0x1.6b14bde93ac6p-5}, + {0x1.9cccccccccccep-5, 0x1.9ca0153ed8397p-5, 0x1.9ca0153ed8396p-5}, + {-0x1.9cccccccccccep-5, -0x1.9ca0153ed8397p-5, -0x1.9ca0153ed8396p-5}, + {0x1.ce66666666666p-5, 0x1.ce278d4027d34p-5, 0x1.ce278d4027d35p-5}, + {-0x1.ce66666666666p-5, -0x1.ce278d4027d34p-5, -0x1.ce278d4027d35p-5}, + {0x1.5e7fc4369bdadp-1, 0x1.43c1e9c171a66p-1, 0x1.43c1e9c171a67p-1}, + {-0x1.5e7fc4369bdadp-1, -0x1.43c1e9c171a66p-1, -0x1.43c1e9c171a67p-1}, + {0x1.4e7fc4369bdadp0, 0x1.ee3d6bcea09cap-1, 0x1.ee3d6bcea09cbp-1}, + {-0x1.4e7fc4369bdadp0, -0x1.ee3d6bcea09cap-1, -0x1.ee3d6bcea09cbp-1}, + {0x1.edbfa651e9c84p0, 0x1.df8e22ea809d6p-1, 0x1.df8e22ea809d7p-1}, + {-0x1.edbfa651e9c84p0, -0x1.df8e22ea809d6p-1, -0x1.df8e22ea809d7p-1}, + {0x1.467fc4369bdadp1, 0x1.1d3479eac7ae3p-1, 0x1.1d3479eac7ae4p-1}, + {-0x1.467fc4369bdadp1, -0x1.1d3479eac7ae3p-1, -0x1.1d3479eac7ae4p-1}, + {0x1.961fb54442d18p1, -0x1.ffeaaaeeee84bp-6, -0x1.ffeaaaeeee84cp-6}, + {-0x1.961fb54442d18p1, 0x1.ffeaaaeeee84bp-6, 0x1.ffeaaaeeee84cp-6}, + {0x1.e5bfa651e9c83p1, -0x1.3734d32d49bd1p-1, -0x1.3734d32d49bdp-1}, + {-0x1.e5bfa651e9c83p1, 0x1.3734d32d49bd1p-1, 0x1.3734d32d49bdp-1}, + {0x1.1aafcbafc85f7p2, -0x1.e9d25d19911e2p-1, -0x1.e9d25d19911e3p-1}, + {-0x1.1aafcbafc85f7p2, 0x1.e9d25d19911e2p-1, 0x1.e9d25d19911e3p-1}, + {0x1.427fc4369bdadp2, -0x1.e4ecdc5a4e466p-1, -0x1.e4ecdc5a4e465p-1}, + {-0x1.427fc4369bdadp2, 0x1.e4ecdc5a4e466p-1, 0x1.e4ecdc5a4e465p-1}, + {0x1.6a4fbcbd6f562p2, -0x1.2a59f10344262p-1, -0x1.2a59f10344261p-1}, + {-0x1.6a4fbcbd6f562p2, 0x1.2a59f10344262p-1, 0x1.2a59f10344261p-1}, + {0x1.6af2eff0a2896p2, -0x1.26312443bd35fp-1, -0x1.26312443bd36p-1}, + {-0x1.6af2eff0a2896p2, 0x1.26312443bd35fp-1, 0x1.26312443bd36p-1}, + {0x1.43c62a9d02414p2, -0x1.e18e660a5e2fbp-1, -0x1.e18e660a5e2fcp-1}, + {-0x1.43c62a9d02414p2, 0x1.e18e660a5e2fbp-1, 0x1.e18e660a5e2fcp-1}, + {0x1.1c99654961f92p2, -0x1.ee0e83a0198b7p-1, -0x1.ee0e83a0198b6p-1}, + {-0x1.1c99654961f92p2, 0x1.ee0e83a0198b7p-1, 0x1.ee0e83a0198b6p-1}, + {0x1.ead93feb8361fp1, -0x1.4727747338e46p-1, -0x1.4727747338e47p-1}, + {-0x1.ead93feb8361fp1, 0x1.4727747338e46p-1, 0x1.4727747338e47p-1}, + {0x1.9c7fb54442d1ap1, -0x1.4ba2f75dda5fep-4, -0x1.4ba2f75dda5ffp-4}, + {-0x1.9c7fb54442d1ap1, 0x1.4ba2f75dda5fep-4, 0x1.4ba2f75dda5ffp-4}, + {0x1.4e262a9d02415p1, 0x1.034c4d633b4efp-1, 0x1.034c4d633b4fp-1}, + {-0x1.4e262a9d02415p1, -0x1.034c4d633b4efp-1, -0x1.034c4d633b4fp-1}, + {0x1.ff993feb8362p0, 0x1.d1e4cde2f3945p-1, 0x1.d1e4cde2f3944p-1}, + {-0x1.ff993feb8362p0, -0x1.d1e4cde2f3945p-1, -0x1.d1e4cde2f3944p-1}, + {0x1.62e62a9d02416p0, 0x1.f750235c94992p-1, 0x1.f750235c94993p-1}, + {-0x1.62e62a9d02416p0, -0x1.f750235c94992p-1, -0x1.f750235c94993p-1}, + {0x1.8c662a9d02419p-1, 0x1.65f7d571279b1p-1, 0x1.65f7d571279bp-1}, + {-0x1.8c662a9d02419p-1, -0x1.65f7d571279b1p-1, -0x1.65f7d571279bp-1}, + {-0x1.a8aa1d11c44ffp0, -0x1.fe043f57369d7p-1, -0x1.fe043f57369d6p-1}, + {0x1.a8aa1d11c44ffp0, 0x1.fe043f57369d7p-1, 0x1.fe043f57369d6p-1}, + {-0x1.95ec8b9e03d54p0, -0x1.fff18f24f3e4cp-1, -0x1.fff18f24f3e4bp-1}, + {0x1.95ec8b9e03d54p0, 0x1.fff18f24f3e4cp-1, 0x1.fff18f24f3e4bp-1}, + {-0x1.832efa2a435a9p0, -0x1.ff20d961624e7p-1, -0x1.ff20d961624e8p-1}, + {0x1.832efa2a435a9p0, 0x1.ff20d961624e7p-1, 0x1.ff20d961624e8p-1}, + {-0x1.707168b682dfep0, -0x1.fb933c40107fdp-1, -0x1.fb933c40107fep-1}, + {0x1.707168b682dfep0, 0x1.fb933c40107fdp-1, 0x1.fb933c40107fep-1}, + {-0x1.5db3d742c2653p0, -0x1.f54d971881ad7p-1, -0x1.f54d971881ad6p-1}, + {0x1.5db3d742c2653p0, 0x1.f54d971881ad7p-1, 0x1.f54d971881ad6p-1}, + {-0x1.4af645cf01ea8p0, -0x1.ec5883b7b6cf5p-1, -0x1.ec5883b7b6cf4p-1}, + {0x1.4af645cf01ea8p0, 0x1.ec5883b7b6cf5p-1, 0x1.ec5883b7b6cf4p-1}, + {-0x1.3838b45b416fdp0, -0x1.e0c04a94e1731p-1, -0x1.e0c04a94e173p-1}, + {0x1.3838b45b416fdp0, 0x1.e0c04a94e1731p-1, 0x1.e0c04a94e173p-1}, + {-0x1.257b22e780f52p0, -0x1.d294d1f96c7ecp-1, -0x1.d294d1f96c7ebp-1}, + {0x1.257b22e780f52p0, 0x1.d294d1f96c7ecp-1, 0x1.d294d1f96c7ebp-1}, + {-0x1.12bd9173c07abp0, -0x1.c1e9883373d7fp-1, -0x1.c1e9883373d7ep-1}, + {0x1.12bd9173c07abp0, 0x1.c1e9883373d7fp-1, 0x1.c1e9883373d7ep-1}, + {-0x1.ea5c3ed5b385p-1, -0x1.a2c289d9d055bp-1, -0x1.a2c289d9d055ap-1}, + {0x1.ea5c3ed5b385p-1, 0x1.a2c289d9d055bp-1, 0x1.a2c289d9d055ap-1}, + {-0x1.d4b87dab670ap-1, -0x1.95f05257dbcb6p-1, -0x1.95f05257dbcb5p-1}, + {0x1.d4b87dab670ap-1, 0x1.95f05257dbcb6p-1, 0x1.95f05257dbcb5p-1}, + {-0x1.bf14bc811a8fp-1, -0x1.88647f26a6e0fp-1, -0x1.88647f26a6e1p-1}, + {0x1.bf14bc811a8fp-1, 0x1.88647f26a6e0fp-1, 0x1.88647f26a6e1p-1}, + {-0x1.a970fb56ce14p-1, -0x1.7a2541dfd4e75p-1, -0x1.7a2541dfd4e76p-1}, + {0x1.a970fb56ce14p-1, 0x1.7a2541dfd4e75p-1, 0x1.7a2541dfd4e76p-1}, + {-0x1.93cd3a2c8199p-1, -0x1.6b391e25bc26dp-1, -0x1.6b391e25bc26cp-1}, + {0x1.93cd3a2c8199p-1, 0x1.6b391e25bc26dp-1, 0x1.6b391e25bc26cp-1}, + {-0x1.7e297902351ep-1, -0x1.5ba6e6a8e7065p-1, -0x1.5ba6e6a8e7066p-1}, + {0x1.7e297902351ep-1, 0x1.5ba6e6a8e7065p-1, 0x1.5ba6e6a8e7066p-1}, + {-0x1.6885b7d7e8a3p-1, -0x1.4b75ba096fa55p-1, -0x1.4b75ba096fa54p-1}, + {0x1.6885b7d7e8a3p-1, 0x1.4b75ba096fa55p-1, 0x1.4b75ba096fa54p-1}, + {-0x1.52e1f6ad9c28p-1, -0x1.3aacff95a3123p-1, -0x1.3aacff95a3122p-1}, + {0x1.52e1f6ad9c28p-1, 0x1.3aacff95a3123p-1, 0x1.3aacff95a3122p-1}, + {-0x1.3d3e35834fadp-1, -0x1.295463e769285p-1, -0x1.295463e769284p-1}, + {0x1.3d3e35834fadp-1, 0x1.295463e769285p-1, 0x1.295463e769284p-1}, + {-0x1.0a0b02501c799p-1, -0x1.fc769b77e5885p-2, -0x1.fc769b77e5884p-2}, + {0x1.0a0b02501c799p-1, 0x1.fc769b77e5885p-2, 0x1.fc769b77e5884p-2}, + {-0x1.d8f7208e6b82cp-2, -0x1.c853c78462de4p-2, -0x1.c853c78462de5p-2}, + {0x1.d8f7208e6b82cp-2, 0x1.c853c78462de4p-2, 0x1.c853c78462de5p-2}, + {-0x1.9dd83c7c9e126p-2, -0x1.92aba90aaf272p-2, -0x1.92aba90aaf273p-2}, + {0x1.9dd83c7c9e126p-2, 0x1.92aba90aaf272p-2, 0x1.92aba90aaf273p-2}, + {-0x1.62b9586ad0a2p-2, -0x1.5bac064658f39p-2, -0x1.5bac064658f3ap-2}, + {0x1.62b9586ad0a2p-2, 0x1.5bac064658f39p-2, 0x1.5bac064658f3ap-2}, + {-0x1.279a74590331ap-2, -0x1.2383ca8078e58p-2, -0x1.2383ca8078e59p-2}, + {0x1.279a74590331ap-2, 0x1.2383ca8078e58p-2, 0x1.2383ca8078e59p-2}, + {-0x1.d8f7208e6b829p-3, -0x1.d4c5bc11d2372p-3, -0x1.d4c5bc11d2371p-3}, + {0x1.d8f7208e6b829p-3, 0x1.d4c5bc11d2372p-3, 0x1.d4c5bc11d2371p-3}, + {-0x1.62b9586ad0a1ep-3, -0x1.60f3faaf43024p-3, -0x1.60f3faaf43023p-3}, + {0x1.62b9586ad0a1ep-3, 0x1.60f3faaf43024p-3, 0x1.60f3faaf43023p-3}, + {-0x1.d8f7208e6b826p-4, -0x1.d7ea3de45a9d6p-4, -0x1.d7ea3de45a9d7p-4}, + {0x1.d8f7208e6b826p-4, 0x1.d7ea3de45a9d6p-4, 0x1.d7ea3de45a9d7p-4}, + {-0x1.d8f7208e6b82dp-5, -0x1.d8b3df489987ap-5, -0x1.d8b3df489987bp-5}, + {0x1.d8f7208e6b82dp-5, 0x1.d8b3df489987ap-5, 0x1.d8b3df489987bp-5}, + {0x1.d8f7208e6b82dp-5, 0x1.d8b3df489987ap-5, 0x1.d8b3df489987bp-5}, + {-0x1.d8f7208e6b82dp-5, -0x1.d8b3df489987ap-5, -0x1.d8b3df489987bp-5}, + {0x1.d8f7208e6b82dp-4, 0x1.d7ea3de45a9ddp-4, 0x1.d7ea3de45a9dep-4}, + {-0x1.d8f7208e6b82dp-4, -0x1.d7ea3de45a9ddp-4, -0x1.d7ea3de45a9dep-4}, + {0x1.62b9586ad0a22p-3, 0x1.60f3faaf43028p-3, 0x1.60f3faaf43027p-3}, + {-0x1.62b9586ad0a22p-3, -0x1.60f3faaf43028p-3, -0x1.60f3faaf43027p-3}, + {0x1.d8f7208e6b82dp-3, 0x1.d4c5bc11d2376p-3, 0x1.d4c5bc11d2375p-3}, + {-0x1.d8f7208e6b82dp-3, -0x1.d4c5bc11d2376p-3, -0x1.d4c5bc11d2375p-3}, + {0x1.279a74590331cp-2, 0x1.2383ca8078e5ap-2, 0x1.2383ca8078e5bp-2}, + {-0x1.279a74590331cp-2, -0x1.2383ca8078e5ap-2, -0x1.2383ca8078e5bp-2}, + {0x1.62b9586ad0a22p-2, 0x1.5bac064658f3bp-2, 0x1.5bac064658f3cp-2}, + {-0x1.62b9586ad0a22p-2, -0x1.5bac064658f3bp-2, -0x1.5bac064658f3cp-2}, + {0x1.9dd83c7c9e128p-2, 0x1.92aba90aaf274p-2, 0x1.92aba90aaf275p-2}, + {-0x1.9dd83c7c9e128p-2, -0x1.92aba90aaf274p-2, -0x1.92aba90aaf275p-2}, + {0x1.d8f7208e6b82ep-2, 0x1.c853c78462de6p-2, 0x1.c853c78462de7p-2}, + {-0x1.d8f7208e6b82ep-2, -0x1.c853c78462de6p-2, -0x1.c853c78462de7p-2}, + {0x1.0a0b02501c799p-1, 0x1.fc769b77e5885p-2, 0x1.fc769b77e5884p-2}, + {-0x1.0a0b02501c799p-1, -0x1.fc769b77e5885p-2, -0x1.fc769b77e5884p-2}, + {0x1.3d3e35834faccp-1, 0x1.295463e769281p-1, 0x1.295463e769282p-1}, + {-0x1.3d3e35834faccp-1, -0x1.295463e769281p-1, -0x1.295463e769282p-1}, + {0x1.52e1f6ad9c27cp-1, 0x1.3aacff95a312p-1, 0x1.3aacff95a311fp-1}, + {-0x1.52e1f6ad9c27cp-1, -0x1.3aacff95a312p-1, -0x1.3aacff95a311fp-1}, + {0x1.6885b7d7e8a2cp-1, 0x1.4b75ba096fa52p-1, 0x1.4b75ba096fa51p-1}, + {-0x1.6885b7d7e8a2cp-1, -0x1.4b75ba096fa52p-1, -0x1.4b75ba096fa51p-1}, + {0x1.7e297902351dcp-1, 0x1.5ba6e6a8e7062p-1, 0x1.5ba6e6a8e7063p-1}, + {-0x1.7e297902351dcp-1, -0x1.5ba6e6a8e7062p-1, -0x1.5ba6e6a8e7063p-1}, + {0x1.93cd3a2c8198cp-1, 0x1.6b391e25bc26ap-1, 0x1.6b391e25bc269p-1}, + {-0x1.93cd3a2c8198cp-1, -0x1.6b391e25bc26ap-1, -0x1.6b391e25bc269p-1}, + {0x1.a970fb56ce13cp-1, 0x1.7a2541dfd4e73p-1, 0x1.7a2541dfd4e72p-1}, + {-0x1.a970fb56ce13cp-1, -0x1.7a2541dfd4e73p-1, -0x1.7a2541dfd4e72p-1}, + {0x1.bf14bc811a8ecp-1, 0x1.88647f26a6e0dp-1, 0x1.88647f26a6e0cp-1}, + {-0x1.bf14bc811a8ecp-1, -0x1.88647f26a6e0dp-1, -0x1.88647f26a6e0cp-1}, + {0x1.d4b87dab6709cp-1, 0x1.95f05257dbcb4p-1, 0x1.95f05257dbcb3p-1}, + {-0x1.d4b87dab6709cp-1, -0x1.95f05257dbcb4p-1, -0x1.95f05257dbcb3p-1}, + {0x1.ea5c3ed5b384cp-1, 0x1.a2c289d9d0558p-1, 0x1.a2c289d9d0559p-1}, + {-0x1.ea5c3ed5b384cp-1, -0x1.a2c289d9d0558p-1, -0x1.a2c289d9d0559p-1}, + {0x1.12bd9173c07abp0, 0x1.c1e9883373d7fp-1, 0x1.c1e9883373d7ep-1}, + {-0x1.12bd9173c07abp0, -0x1.c1e9883373d7fp-1, -0x1.c1e9883373d7ep-1}, + {0x1.257b22e780f56p0, 0x1.d294d1f96c7efp-1, 0x1.d294d1f96c7fp-1}, + {-0x1.257b22e780f56p0, -0x1.d294d1f96c7efp-1, -0x1.d294d1f96c7fp-1}, + {0x1.3838b45b41701p0, 0x1.e0c04a94e1733p-1, 0x1.e0c04a94e1734p-1}, + {-0x1.3838b45b41701p0, -0x1.e0c04a94e1733p-1, -0x1.e0c04a94e1734p-1}, + {0x1.4af645cf01eacp0, 0x1.ec5883b7b6cf7p-1, 0x1.ec5883b7b6cf8p-1}, + {-0x1.4af645cf01eacp0, -0x1.ec5883b7b6cf7p-1, -0x1.ec5883b7b6cf8p-1}, + {0x1.5db3d742c2657p0, 0x1.f54d971881ad8p-1, 0x1.f54d971881ad9p-1}, + {-0x1.5db3d742c2657p0, -0x1.f54d971881ad8p-1, -0x1.f54d971881ad9p-1}, + {0x1.707168b682e02p0, 0x1.fb933c40107fep-1, 0x1.fb933c40107ffp-1}, + {-0x1.707168b682e02p0, -0x1.fb933c40107fep-1, -0x1.fb933c40107ffp-1}, + {0x1.832efa2a435adp0, 0x1.ff20d961624e7p-1, 0x1.ff20d961624e8p-1}, + {-0x1.832efa2a435adp0, -0x1.ff20d961624e7p-1, -0x1.ff20d961624e8p-1}, + {0x1.95ec8b9e03d58p0, 0x1.fff18f24f3e4bp-1, 0x1.fff18f24f3e4cp-1}, + {-0x1.95ec8b9e03d58p0, -0x1.fff18f24f3e4bp-1, -0x1.fff18f24f3e4cp-1}, + {0x1.a8aa1d11c44ffp0, 0x1.fe043f57369d7p-1, 0x1.fe043f57369d6p-1}, + {-0x1.a8aa1d11c44ffp0, -0x1.fe043f57369d7p-1, -0x1.fe043f57369d6p-1}, + {0x1.04aff6d330942p0, 0x1.b3d3695acc413p-1, 0x1.b3d3695acc414p-1}, + {-0x1.04aff6d330942p0, -0x1.b3d3695acc413p-1, -0x1.b3d3695acc414p-1}, + {0x1.04b09e98dcdb4p0, 0x1.b3d41972dc806p-1, 0x1.b3d41972dc807p-1}, + {-0x1.04b09e98dcdb4p0, -0x1.b3d41972dc806p-1, -0x1.b3d41972dc807p-1}, + {0x1.04b1465e89226p0, 0x1.b3d4c98a318fbp-1, 0x1.b3d4c98a318fcp-1}, + {-0x1.04b1465e89226p0, -0x1.b3d4c98a318fbp-1, -0x1.b3d4c98a318fcp-1}, + {0x1.04b1ee2435698p0, 0x1.b3d579a0cb6eep-1, 0x1.b3d579a0cb6efp-1}, + {-0x1.04b1ee2435698p0, -0x1.b3d579a0cb6eep-1, -0x1.b3d579a0cb6efp-1}, + {0x1.04b295e9e1b0ap0, 0x1.b3d629b6aa1dap-1, 0x1.b3d629b6aa1d9p-1}, + {-0x1.04b295e9e1b0ap0, -0x1.b3d629b6aa1dap-1, -0x1.b3d629b6aa1d9p-1}, + {0x1.04b33daf8df7cp0, 0x1.b3d6d9cbcd9bap-1, 0x1.b3d6d9cbcd9b9p-1}, + {-0x1.04b33daf8df7cp0, -0x1.b3d6d9cbcd9bap-1, -0x1.b3d6d9cbcd9b9p-1}, + {0x1.04b3e5753a3eep0, 0x1.b3d789e035e89p-1, 0x1.b3d789e035e8ap-1}, + {-0x1.04b3e5753a3eep0, -0x1.b3d789e035e89p-1, -0x1.b3d789e035e8ap-1}, + {0x1.04b48d3ae686p0, 0x1.b3d839f3e3043p-1, 0x1.b3d839f3e3044p-1}, + {-0x1.04b48d3ae686p0, -0x1.b3d839f3e3043p-1, -0x1.b3d839f3e3044p-1}, + {0x1.04b5350092ccfp0, 0x1.b3d8ea06d4eep-1, 0x1.b3d8ea06d4ee1p-1}, + {-0x1.04b5350092ccfp0, -0x1.b3d8ea06d4eep-1, -0x1.b3d8ea06d4ee1p-1}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x1.279a74590331bp-1, 0x1.1773d561fd506p-1, 0x1.1773d561fd507p-1}, + {-0x1.279a74590331bp-1, -0x1.1773d561fd506p-1, -0x1.1773d561fd507p-1}, + {0x1.279a74590331cp-1, 0x1.1773d561fd507p-1, 0x1.1773d561fd508p-1}, + {-0x1.279a74590331cp-1, -0x1.1773d561fd507p-1, -0x1.1773d561fd508p-1}, + {0x1.279a74590331dp-1, 0x1.1773d561fd508p-1, 0x1.1773d561fd509p-1}, + {-0x1.279a74590331dp-1, -0x1.1773d561fd508p-1, -0x1.1773d561fd509p-1}, + {0x1.bb67ae8584ca9p0, 0x1.f95b8e7107419p-1, 0x1.f95b8e7107418p-1}, + {-0x1.bb67ae8584ca9p0, -0x1.f95b8e7107419p-1, -0x1.f95b8e7107418p-1}, + {0x1.bb67ae8584caap0, 0x1.f95b8e7107418p-1, 0x1.f95b8e7107419p-1}, + {-0x1.bb67ae8584caap0, -0x1.f95b8e7107418p-1, -0x1.f95b8e7107419p-1}, + {0x1.bb67ae8584cabp0, 0x1.f95b8e7107418p-1, 0x1.f95b8e7107419p-1}, + {-0x1.bb67ae8584cabp0, -0x1.f95b8e7107418p-1, -0x1.f95b8e7107419p-1}, + {0x1.bffffffffffffp-2, 0x1.b1d8305321616p-2, 0x1.b1d8305321615p-2}, + {-0x1.bffffffffffffp-2, -0x1.b1d8305321616p-2, -0x1.b1d8305321615p-2}, + {0x1.cp-2, 0x1.b1d8305321617p-2, 0x1.b1d8305321616p-2}, + {-0x1.cp-2, -0x1.b1d8305321617p-2, -0x1.b1d8305321616p-2}, + {0x1.c000000000001p-2, 0x1.b1d8305321617p-2, 0x1.b1d8305321618p-2}, + {-0x1.c000000000001p-2, -0x1.b1d8305321617p-2, -0x1.b1d8305321618p-2}, + {0x1.5ffffffffffffp-1, 0x1.44eb381cf386ap-1, 0x1.44eb381cf3869p-1}, + {-0x1.5ffffffffffffp-1, -0x1.44eb381cf386ap-1, -0x1.44eb381cf3869p-1}, + {0x1.6p-1, 0x1.44eb381cf386bp-1, 0x1.44eb381cf386ap-1}, + {-0x1.6p-1, -0x1.44eb381cf386bp-1, -0x1.44eb381cf386ap-1}, + {0x1.6000000000001p-1, 0x1.44eb381cf386cp-1, 0x1.44eb381cf386bp-1}, + {-0x1.6000000000001p-1, -0x1.44eb381cf386cp-1, -0x1.44eb381cf386bp-1}, + {0x1.2ffffffffffffp0, 0x1.dad902fa8ac86p-1, 0x1.dad902fa8ac87p-1}, + {-0x1.2ffffffffffffp0, -0x1.dad902fa8ac86p-1, -0x1.dad902fa8ac87p-1}, + {0x1.3p0, 0x1.dad902fa8ac87p-1, 0x1.dad902fa8ac88p-1}, + {-0x1.3p0, -0x1.dad902fa8ac87p-1, -0x1.dad902fa8ac88p-1}, + {0x1.3000000000001p0, 0x1.dad902fa8ac88p-1, 0x1.dad902fa8ac87p-1}, + {-0x1.3000000000001p0, -0x1.dad902fa8ac88p-1, -0x1.dad902fa8ac87p-1}, + {0x1.37fffffffffffp1, 0x1.4b707a7acdedp-1, 0x1.4b707a7acdecfp-1}, + {-0x1.37fffffffffffp1, -0x1.4b707a7acdedp-1, -0x1.4b707a7acdecfp-1}, + {0x1.38p1, 0x1.4b707a7acdecdp-1, 0x1.4b707a7acdeccp-1}, + {-0x1.38p1, -0x1.4b707a7acdecdp-1, -0x1.4b707a7acdeccp-1}, + {0x1.3800000000001p1, 0x1.4b707a7acdecap-1, 0x1.4b707a7acdec9p-1}, + {-0x1.3800000000001p1, -0x1.4b707a7acdecap-1, -0x1.4b707a7acdec9p-1}, + {0x1.069c8b46b3792p-4, 0x1.066e7eb76f5c6p-4, 0x1.066e7eb76f5c7p-4}, + {-0x1.069c8b46b3792p-4, -0x1.066e7eb76f5c6p-4, -0x1.066e7eb76f5c7p-4}, + {0x1.069c8b46b3792p-3, 0x1.05e4761ab8d8fp-3, 0x1.05e4761ab8d9p-3}, + {-0x1.069c8b46b3792p-3, -0x1.05e4761ab8d8fp-3, -0x1.05e4761ab8d9p-3}, + {0x1.89ead0ea0d35bp-3, 0x1.877e2cd4f6fdap-3, 0x1.877e2cd4f6fd9p-3}, + {-0x1.89ead0ea0d35bp-3, -0x1.877e2cd4f6fdap-3, -0x1.877e2cd4f6fd9p-3}, + {0x1.069c8b46b3792p-2, 0x1.03be06f97cbeep-2, 0x1.03be06f97cbefp-2}, + {-0x1.069c8b46b3792p-2, -0x1.03be06f97cbeep-2, -0x1.03be06f97cbefp-2}, + {0x1.4843ae1860576p-2, 0x1.42abba8c72fbcp-2, 0x1.42abba8c72fbbp-2}, + {-0x1.4843ae1860576p-2, -0x1.42abba8c72fbcp-2, -0x1.42abba8c72fbbp-2}, + {0x1.89ead0ea0d35ap-2, 0x1.8045fe64e62dcp-2, 0x1.8045fe64e62ddp-2}, + {-0x1.89ead0ea0d35ap-2, -0x1.8045fe64e62dcp-2, -0x1.8045fe64e62ddp-2}, + {0x1.cb91f3bbba13ep-2, 0x1.bc4c04d71abbfp-2, 0x1.bc4c04d71abbep-2}, + {-0x1.cb91f3bbba13ep-2, -0x1.bc4c04d71abbfp-2, -0x1.bc4c04d71abbep-2}, + {0x1.069c8b46b3791p-1, 0x1.f67ea975b86ap-2, 0x1.f67ea975b86a1p-2}, + {-0x1.069c8b46b3791p-1, -0x1.f67ea975b86ap-2, -0x1.f67ea975b86a1p-2}, + {0x1.27701caf89e83p-1, 0x1.175059bf0d425p-1, 0x1.175059bf0d426p-1}, + {-0x1.27701caf89e83p-1, -0x1.175059bf0d425p-1, -0x1.175059bf0d426p-1}, + {0x1.4843ae1860575p-1, 0x1.323b8b1fb4ba2p-1, 0x1.323b8b1fb4ba3p-1}, + {-0x1.4843ae1860575p-1, -0x1.323b8b1fb4ba2p-1, -0x1.323b8b1fb4ba3p-1}, + {0x1.69173f8136c67p-1, 0x1.4be4979c5efb3p-1, 0x1.4be4979c5efb4p-1}, + {-0x1.69173f8136c67p-1, -0x1.4be4979c5efb3p-1, -0x1.4be4979c5efb4p-1}, + {0x1.89ead0ea0d359p-1, 0x1.643080d67acc1p-1, 0x1.643080d67acc2p-1}, + {-0x1.89ead0ea0d359p-1, -0x1.643080d67acc1p-1, -0x1.643080d67acc2p-1}, + {0x1.aabe6252e3a4bp-1, 0x1.7b05b7b6c612ep-1, 0x1.7b05b7b6c612fp-1}, + {-0x1.aabe6252e3a4bp-1, -0x1.7b05b7b6c612ep-1, -0x1.7b05b7b6c612fp-1}, + {0x1.cb91f3bbba13dp-1, 0x1.904c37505de49p-1, 0x1.904c37505de48p-1}, + {-0x1.cb91f3bbba13dp-1, -0x1.904c37505de49p-1, -0x1.904c37505de48p-1}, + {0x1.ec6585249082fp-1, 0x1.a3ed9e252938ap-1, 0x1.a3ed9e252938bp-1}, + {-0x1.ec6585249082fp-1, -0x1.a3ed9e252938ap-1, -0x1.a3ed9e252938bp-1}, + {0x1.069c8b46b3791p0, 0x1.b5d545b109bf9p-1, 0x1.b5d545b109bfap-1}, + {-0x1.069c8b46b3791p0, -0x1.b5d545b109bf9p-1, -0x1.b5d545b109bfap-1}, + {0x1.170653fb1eb0ap0, 0x1.c5f058230e7fdp-1, 0x1.c5f058230e7fep-1}, + {-0x1.170653fb1eb0ap0, -0x1.c5f058230e7fdp-1, -0x1.c5f058230e7fep-1}, + {0x1.27701caf89e83p0, 0x1.d42de42dce134p-1, 0x1.d42de42dce135p-1}, + {-0x1.27701caf89e83p0, -0x1.d42de42dce134p-1, -0x1.d42de42dce135p-1}, + {0x1.37d9e563f51fcp0, 0x1.e07eeeda109cbp-1, 0x1.e07eeeda109ccp-1}, + {-0x1.37d9e563f51fcp0, -0x1.e07eeeda109cbp-1, -0x1.e07eeeda109ccp-1}, + {0x1.4843ae1860575p0, 0x1.ead6834909b93p-1, 0x1.ead6834909b94p-1}, + {-0x1.4843ae1860575p0, -0x1.ead6834909b93p-1, -0x1.ead6834909b94p-1}, + {0x1.58ad76cccb8eep0, 0x1.f329c0558e968p-1, 0x1.f329c0558e967p-1}, + {-0x1.58ad76cccb8eep0, -0x1.f329c0558e968p-1, -0x1.f329c0558e967p-1}, + {0x1.69173f8136c67p0, 0x1.f96fe405f1ac6p-1, 0x1.f96fe405f1ac5p-1}, + {-0x1.69173f8136c67p0, -0x1.f96fe405f1ac6p-1, -0x1.f96fe405f1ac5p-1}, + {0x1.79810835a1fep0, 0x1.fda254c27a01fp-1, 0x1.fda254c27a02p-1}, + {-0x1.79810835a1fep0, -0x1.fda254c27a01fp-1, -0x1.fda254c27a02p-1}, + {0x1.89ead0ea0d359p0, 0x1.ffbca846c4fcap-1, 0x1.ffbca846c4fc9p-1}, + {-0x1.89ead0ea0d359p0, -0x1.ffbca846c4fcap-1, -0x1.ffbca846c4fc9p-1}, + {0x1.9a54999e786d2p0, 0x1.ffbca846c4fcap-1, 0x1.ffbca846c4fc9p-1}, + {-0x1.9a54999e786d2p0, -0x1.ffbca846c4fcap-1, -0x1.ffbca846c4fc9p-1}, + {0x1.aabe6252e3a4bp0, 0x1.fda254c27a02p-1, 0x1.fda254c27a021p-1}, + {-0x1.aabe6252e3a4bp0, -0x1.fda254c27a02p-1, -0x1.fda254c27a021p-1}, + {0x1.bb282b074edc4p0, 0x1.f96fe405f1ac8p-1, 0x1.f96fe405f1ac7p-1}, + {-0x1.bb282b074edc4p0, -0x1.f96fe405f1ac8p-1, -0x1.f96fe405f1ac7p-1}, + {0x1.cb91f3bbba13dp0, 0x1.f329c0558e96ap-1, 0x1.f329c0558e96bp-1}, + {-0x1.cb91f3bbba13dp0, -0x1.f329c0558e96ap-1, -0x1.f329c0558e96bp-1}, + {0x1.dbfbbc70254b6p0, 0x1.ead6834909b96p-1, 0x1.ead6834909b97p-1}, + {-0x1.dbfbbc70254b6p0, -0x1.ead6834909b96p-1, -0x1.ead6834909b97p-1}, + {0x1.ec6585249082fp0, 0x1.e07eeeda109cfp-1, 0x1.e07eeeda109dp-1}, + {-0x1.ec6585249082fp0, -0x1.e07eeeda109cfp-1, -0x1.e07eeeda109dp-1}, + {0x1.fccf4dd8fbba8p0, 0x1.d42de42dce139p-1, 0x1.d42de42dce138p-1}, + {-0x1.fccf4dd8fbba8p0, -0x1.d42de42dce139p-1, -0x1.d42de42dce138p-1}, + {0x1.069c8b46b3791p1, 0x1.c5f058230e801p-1, 0x1.c5f058230e802p-1}, + {-0x1.069c8b46b3791p1, -0x1.c5f058230e801p-1, -0x1.c5f058230e802p-1}, + {0x1.0ed16fa0e914ep1, 0x1.b5d545b109bfdp-1, 0x1.b5d545b109bfcp-1}, + {-0x1.0ed16fa0e914ep1, -0x1.b5d545b109bfdp-1, -0x1.b5d545b109bfcp-1}, + {0x1.170653fb1eb0bp1, 0x1.a3ed9e252938dp-1, 0x1.a3ed9e252938ep-1}, + {-0x1.170653fb1eb0bp1, -0x1.a3ed9e252938dp-1, -0x1.a3ed9e252938ep-1}, + {0x1.1f3b3855544c8p1, 0x1.904c37505de4cp-1, 0x1.904c37505de4bp-1}, + {-0x1.1f3b3855544c8p1, -0x1.904c37505de4cp-1, -0x1.904c37505de4bp-1}, + {0x1.27701caf89e85p1, 0x1.7b05b7b6c613p-1, 0x1.7b05b7b6c612fp-1}, + {-0x1.27701caf89e85p1, -0x1.7b05b7b6c613p-1, -0x1.7b05b7b6c612fp-1}, + {0x1.2fa50109bf842p1, 0x1.643080d67acc1p-1, 0x1.643080d67acc2p-1}, + {-0x1.2fa50109bf842p1, -0x1.643080d67acc1p-1, -0x1.643080d67acc2p-1}, + {0x1.37d9e563f51ffp1, 0x1.4be4979c5efb2p-1, 0x1.4be4979c5efb1p-1}, + {-0x1.37d9e563f51ffp1, -0x1.4be4979c5efb2p-1, -0x1.4be4979c5efb1p-1}, + {0x1.400ec9be2abbcp1, 0x1.323b8b1fb4b9fp-1, 0x1.323b8b1fb4b9ep-1}, + {-0x1.400ec9be2abbcp1, -0x1.323b8b1fb4b9fp-1, -0x1.323b8b1fb4b9ep-1}, + {0x1.4843ae1860579p1, 0x1.175059bf0d42p-1, 0x1.175059bf0d421p-1}, + {-0x1.4843ae1860579p1, -0x1.175059bf0d42p-1, -0x1.175059bf0d421p-1}, + {0x1.5078927295f36p1, 0x1.f67ea975b8692p-2, 0x1.f67ea975b8693p-2}, + {-0x1.5078927295f36p1, -0x1.f67ea975b8692p-2, -0x1.f67ea975b8693p-2}, + {0x1.58ad76cccb8f3p1, 0x1.bc4c04d71abadp-2, 0x1.bc4c04d71abaep-2}, + {-0x1.58ad76cccb8f3p1, -0x1.bc4c04d71abadp-2, -0x1.bc4c04d71abaep-2}, + {0x1.60e25b27012bp1, 0x1.8045fe64e62c6p-2, 0x1.8045fe64e62c7p-2}, + {-0x1.60e25b27012bp1, -0x1.8045fe64e62c6p-2, -0x1.8045fe64e62c7p-2}, + {0x1.69173f8136c6dp1, 0x1.42abba8c72fa1p-2, 0x1.42abba8c72fa2p-2}, + {-0x1.69173f8136c6dp1, -0x1.42abba8c72fa1p-2, -0x1.42abba8c72fa2p-2}, + {0x1.714c23db6c62ap1, 0x1.03be06f97cbdp-2, 0x1.03be06f97cbcfp-2}, + {-0x1.714c23db6c62ap1, -0x1.03be06f97cbdp-2, -0x1.03be06f97cbcfp-2}, + {0x1.79810835a1fe7p1, 0x1.877e2cd4f6f94p-3, 0x1.877e2cd4f6f95p-3}, + {-0x1.79810835a1fe7p1, -0x1.877e2cd4f6f94p-3, -0x1.877e2cd4f6f95p-3}, + {0x1.81b5ec8fd79a4p1, 0x1.05e4761ab8d42p-3, 0x1.05e4761ab8d43p-3}, + {-0x1.81b5ec8fd79a4p1, -0x1.05e4761ab8d42p-3, -0x1.05e4761ab8d43p-3}, + {0x1.89ead0ea0d35bp1, 0x1.066e7eb76f5ddp-4, 0x1.066e7eb76f5dep-4}, + {-0x1.89ead0ea0d35bp1, -0x1.066e7eb76f5ddp-4, -0x1.066e7eb76f5dep-4}, + {-0x1.81b5ec8fd799fp2, 0x1.03be06f97cbf1p-2, 0x1.03be06f97cbfp-2}, + {0x1.81b5ec8fd799fp2, -0x1.03be06f97cbf1p-2, -0x1.03be06f97cbfp-2}, + {-0x1.714c23db6c626p2, 0x1.f67ea975b86a2p-2, 0x1.f67ea975b86a3p-2}, + {0x1.714c23db6c626p2, -0x1.f67ea975b86a2p-2, -0x1.f67ea975b86a3p-2}, + {-0x1.60e25b27012adp2, 0x1.643080d67acc2p-1, 0x1.643080d67acc3p-1}, + {0x1.60e25b27012adp2, -0x1.643080d67acc2p-1, -0x1.643080d67acc3p-1}, + {-0x1.5078927295f34p2, 0x1.b5d545b109bf9p-1, 0x1.b5d545b109bfap-1}, + {0x1.5078927295f34p2, -0x1.b5d545b109bf9p-1, -0x1.b5d545b109bfap-1}, + {-0x1.400ec9be2abbbp2, 0x1.ead6834909b93p-1, 0x1.ead6834909b94p-1}, + {0x1.400ec9be2abbbp2, -0x1.ead6834909b93p-1, -0x1.ead6834909b94p-1}, + {-0x1.2fa50109bf842p2, 0x1.ffbca846c4fcap-1, 0x1.ffbca846c4fc9p-1}, + {0x1.2fa50109bf842p2, -0x1.ffbca846c4fcap-1, -0x1.ffbca846c4fc9p-1}, + {-0x1.1f3b3855544c9p2, 0x1.f329c0558e96ap-1, 0x1.f329c0558e96bp-1}, + {0x1.1f3b3855544c9p2, -0x1.f329c0558e96ap-1, -0x1.f329c0558e96bp-1}, + {-0x1.0ed16fa0e915p2, 0x1.c5f058230e802p-1, 0x1.c5f058230e803p-1}, + {0x1.0ed16fa0e915p2, -0x1.c5f058230e802p-1, -0x1.c5f058230e803p-1}, + {-0x1.fccf4dd8fbbaep1, 0x1.7b05b7b6c6136p-1, 0x1.7b05b7b6c6137p-1}, + {0x1.fccf4dd8fbbaep1, -0x1.7b05b7b6c6136p-1, -0x1.7b05b7b6c6137p-1}, + {-0x1.dbfbbc70254bcp1, 0x1.175059bf0d42fp-1, 0x1.175059bf0d43p-1}, + {0x1.dbfbbc70254bcp1, -0x1.175059bf0d42fp-1, -0x1.175059bf0d43p-1}, + {-0x1.bb282b074edcap1, 0x1.42abba8c72fd2p-2, 0x1.42abba8c72fd3p-2}, + {0x1.bb282b074edcap1, -0x1.42abba8c72fd2p-2, -0x1.42abba8c72fd3p-2}, + {-0x1.9a54999e786d8p1, 0x1.066e7eb76f62bp-4, 0x1.066e7eb76f62cp-4}, + {0x1.9a54999e786d8p1, -0x1.066e7eb76f62bp-4, -0x1.066e7eb76f62cp-4}, + {-0x1.79810835a1fe6p1, -0x1.877e2cd4f6fa4p-3, -0x1.877e2cd4f6fa5p-3}, + {0x1.79810835a1fe6p1, 0x1.877e2cd4f6fa4p-3, 0x1.877e2cd4f6fa5p-3}, + {-0x1.58ad76cccb8f4p1, -0x1.bc4c04d71aba6p-2, -0x1.bc4c04d71aba5p-2}, + {0x1.58ad76cccb8f4p1, 0x1.bc4c04d71aba6p-2, 0x1.bc4c04d71aba5p-2}, + {-0x1.37d9e563f5202p1, -0x1.4be4979c5efa8p-1, -0x1.4be4979c5efa9p-1}, + {0x1.37d9e563f5202p1, 0x1.4be4979c5efa8p-1, 0x1.4be4979c5efa9p-1}, + {-0x1.170653fb1eb1p1, -0x1.a3ed9e2529382p-1, -0x1.a3ed9e2529383p-1}, + {0x1.170653fb1eb1p1, 0x1.a3ed9e2529382p-1, 0x1.a3ed9e2529383p-1}, + {-0x1.ec6585249083cp0, -0x1.e07eeeda109c6p-1, -0x1.e07eeeda109c7p-1}, + {0x1.ec6585249083cp0, 0x1.e07eeeda109c6p-1, 0x1.e07eeeda109c7p-1}, + {-0x1.aabe6252e3a58p0, -0x1.fda254c27a01ep-1, -0x1.fda254c27a01dp-1}, + {0x1.aabe6252e3a58p0, 0x1.fda254c27a01ep-1, 0x1.fda254c27a01dp-1}, + {-0x1.69173f8136c74p0, -0x1.f96fe405f1acap-1, -0x1.f96fe405f1acbp-1}, + {0x1.69173f8136c74p0, 0x1.f96fe405f1acap-1, 0x1.f96fe405f1acbp-1}, + {-0x1.27701caf89e9p0, -0x1.d42de42dce13fp-1, -0x1.d42de42dce13ep-1}, + {0x1.27701caf89e9p0, 0x1.d42de42dce13fp-1, 0x1.d42de42dce13ep-1}, + {-0x1.cb91f3bbba157p-1, -0x1.904c37505de59p-1, -0x1.904c37505de5ap-1}, + {0x1.cb91f3bbba157p-1, 0x1.904c37505de59p-1, 0x1.904c37505de5ap-1}, + {-0x1.4843ae186058ep-1, -0x1.323b8b1fb4bb6p-1, -0x1.323b8b1fb4bb7p-1}, + {0x1.4843ae186058ep-1, 0x1.323b8b1fb4bb6p-1, 0x1.323b8b1fb4bb7p-1}, + {-0x1.89ead0ea0d38ap-2, -0x1.8045fe64e6309p-2, -0x1.8045fe64e6308p-2}, + {0x1.89ead0ea0d38ap-2, 0x1.8045fe64e6309p-2, 0x1.8045fe64e6308p-2}, + {-0x1.069c8b46b37fp-3, -0x1.05e4761ab8decp-3, -0x1.05e4761ab8dedp-3}, + {0x1.069c8b46b37fp-3, 0x1.05e4761ab8decp-3, 0x1.05e4761ab8dedp-3}, + {0x1.069c8b46b3734p-3, 0x1.05e4761ab8d32p-3, 0x1.05e4761ab8d31p-3}, + {-0x1.069c8b46b3734p-3, -0x1.05e4761ab8d32p-3, -0x1.05e4761ab8d31p-3}, + {0x1.89ead0ea0d32cp-2, 0x1.8045fe64e62b2p-2, 0x1.8045fe64e62b1p-2}, + {-0x1.89ead0ea0d32cp-2, -0x1.8045fe64e62b2p-2, -0x1.8045fe64e62b1p-2}, + {0x1.4843ae186055fp-1, 0x1.323b8b1fb4b9p-1, 0x1.323b8b1fb4b91p-1}, + {-0x1.4843ae186055fp-1, -0x1.323b8b1fb4b9p-1, -0x1.323b8b1fb4b91p-1}, + {0x1.cb91f3bbba128p-1, 0x1.904c37505de3cp-1, 0x1.904c37505de3bp-1}, + {-0x1.cb91f3bbba128p-1, -0x1.904c37505de3cp-1, -0x1.904c37505de3bp-1}, + {0x1.27701caf89e78p0, 0x1.d42de42dce12bp-1, 0x1.d42de42dce12cp-1}, + {-0x1.27701caf89e78p0, -0x1.d42de42dce12bp-1, -0x1.d42de42dce12cp-1}, + {0x1.69173f8136c5cp0, 0x1.f96fe405f1ac2p-1, 0x1.f96fe405f1ac3p-1}, + {-0x1.69173f8136c5cp0, -0x1.f96fe405f1ac2p-1, -0x1.f96fe405f1ac3p-1}, + {0x1.aabe6252e3a4p0, 0x1.fda254c27a022p-1, 0x1.fda254c27a023p-1}, + {-0x1.aabe6252e3a4p0, -0x1.fda254c27a022p-1, -0x1.fda254c27a023p-1}, + {0x1.ec65852490824p0, 0x1.e07eeeda109d7p-1, 0x1.e07eeeda109d6p-1}, + {-0x1.ec65852490824p0, -0x1.e07eeeda109d7p-1, -0x1.e07eeeda109d6p-1}, + {0x1.170653fb1eb04p1, 0x1.a3ed9e252939ep-1, 0x1.a3ed9e252939dp-1}, + {-0x1.170653fb1eb04p1, -0x1.a3ed9e252939ep-1, -0x1.a3ed9e252939dp-1}, + {0x1.37d9e563f51f6p1, 0x1.4be4979c5efcdp-1, 0x1.4be4979c5efccp-1}, + {-0x1.37d9e563f51f6p1, -0x1.4be4979c5efcdp-1, -0x1.4be4979c5efccp-1}, + {0x1.58ad76cccb8e8p1, 0x1.bc4c04d71abfcp-2, 0x1.bc4c04d71abfdp-2}, + {-0x1.58ad76cccb8e8p1, -0x1.bc4c04d71abfcp-2, -0x1.bc4c04d71abfdp-2}, + {0x1.79810835a1fdap1, 0x1.877e2cd4f7061p-3, 0x1.877e2cd4f706p-3}, + {-0x1.79810835a1fdap1, -0x1.877e2cd4f7061p-3, -0x1.877e2cd4f706p-3}, + {0x1.9a54999e786ccp1, -0x1.066e7eb76f4acp-4, -0x1.066e7eb76f4adp-4}, + {-0x1.9a54999e786ccp1, 0x1.066e7eb76f4acp-4, 0x1.066e7eb76f4adp-4}, + {0x1.bb282b074edbep1, -0x1.42abba8c72f77p-2, -0x1.42abba8c72f78p-2}, + {-0x1.bb282b074edbep1, 0x1.42abba8c72f77p-2, 0x1.42abba8c72f78p-2}, + {0x1.dbfbbc70254bp1, -0x1.175059bf0d407p-1, -0x1.175059bf0d406p-1}, + {-0x1.dbfbbc70254bp1, 0x1.175059bf0d407p-1, 0x1.175059bf0d406p-1}, + {0x1.fccf4dd8fbba2p1, -0x1.7b05b7b6c6116p-1, -0x1.7b05b7b6c6117p-1}, + {-0x1.fccf4dd8fbba2p1, 0x1.7b05b7b6c6116p-1, 0x1.7b05b7b6c6117p-1}, + {0x1.0ed16fa0e914ap2, -0x1.c5f058230e7ecp-1, -0x1.c5f058230e7ebp-1}, + {-0x1.0ed16fa0e914ap2, 0x1.c5f058230e7ecp-1, 0x1.c5f058230e7ebp-1}, + {0x1.1f3b3855544c3p2, -0x1.f329c0558e96p-1, -0x1.f329c0558e95fp-1}, + {-0x1.1f3b3855544c3p2, 0x1.f329c0558e96p-1, 0x1.f329c0558e95fp-1}, + {0x1.2fa50109bf83cp2, -0x1.ffbca846c4fcbp-1, -0x1.ffbca846c4fccp-1}, + {-0x1.2fa50109bf83cp2, 0x1.ffbca846c4fcbp-1, 0x1.ffbca846c4fccp-1}, + {0x1.400ec9be2abb5p2, -0x1.ead6834909ba1p-1, -0x1.ead6834909bap-1}, + {-0x1.400ec9be2abb5p2, 0x1.ead6834909ba1p-1, 0x1.ead6834909bap-1}, + {0x1.5078927295f2ep2, -0x1.b5d545b109c12p-1, -0x1.b5d545b109c13p-1}, + {-0x1.5078927295f2ep2, 0x1.b5d545b109c12p-1, 0x1.b5d545b109c13p-1}, + {0x1.60e25b27012a7p2, -0x1.643080d67ace4p-1, -0x1.643080d67ace5p-1}, + {-0x1.60e25b27012a7p2, 0x1.643080d67ace4p-1, 0x1.643080d67ace5p-1}, + {0x1.714c23db6c62p2, -0x1.f67ea975b86f6p-2, -0x1.f67ea975b86f5p-2}, + {-0x1.714c23db6c62p2, 0x1.f67ea975b86f6p-2, 0x1.f67ea975b86f5p-2}, + {0x1.81b5ec8fd7999p2, -0x1.03be06f97cc4dp-2, -0x1.03be06f97cc4ep-2}, + {-0x1.81b5ec8fd7999p2, 0x1.03be06f97cc4dp-2, 0x1.03be06f97cc4ep-2}, + {0x1.effffffffffffp-5, 0x1.efb26ef930c4cp-5, 0x1.efb26ef930c4dp-5}, + {-0x1.effffffffffffp-5, -0x1.efb26ef930c4cp-5, -0x1.efb26ef930c4dp-5}, + {0x1.fp-5, 0x1.efb26ef930c4dp-5, 0x1.efb26ef930c4ep-5}, + {-0x1.fp-5, -0x1.efb26ef930c4dp-5, -0x1.efb26ef930c4ep-5}, + {0x1.f000000000001p-5, 0x1.efb26ef930c4ep-5, 0x1.efb26ef930c4fp-5}, + {-0x1.f000000000001p-5, -0x1.efb26ef930c4ep-5, -0x1.efb26ef930c4fp-5}, + {0x1.f7fffffffffffp-4, 0x1.f6baaa131de63p-4, 0x1.f6baaa131de64p-4}, + {-0x1.f7fffffffffffp-4, -0x1.f6baaa131de63p-4, -0x1.f6baaa131de64p-4}, + {0x1.f8p-4, 0x1.f6baaa131de64p-4, 0x1.f6baaa131de65p-4}, + {-0x1.f8p-4, -0x1.f6baaa131de64p-4, -0x1.f6baaa131de65p-4}, + {0x1.f800000000001p-4, 0x1.f6baaa131de65p-4, 0x1.f6baaa131de66p-4}, + {-0x1.f800000000001p-4, -0x1.f6baaa131de65p-4, -0x1.f6baaa131de66p-4}, + {0x1.4bfffffffffffp-3, 0x1.4a8c3b4e9c7ffp-3, 0x1.4a8c3b4e9c8p-3}, + {-0x1.4bfffffffffffp-3, -0x1.4a8c3b4e9c7ffp-3, -0x1.4a8c3b4e9c8p-3}, + {0x1.4cp-3, 0x1.4a8c3b4e9c8p-3, 0x1.4a8c3b4e9c7ffp-3}, + {-0x1.4cp-3, -0x1.4a8c3b4e9c8p-3, -0x1.4a8c3b4e9c7ffp-3}, + {0x1.4c00000000001p-3, 0x1.4a8c3b4e9c801p-3, 0x1.4a8c3b4e9c8p-3}, + {-0x1.4c00000000001p-3, -0x1.4a8c3b4e9c801p-3, -0x1.4a8c3b4e9c8p-3}, + {0x1.3333333333332p-2, 0x1.2e9cd95baba32p-2, 0x1.2e9cd95baba33p-2}, + {-0x1.3333333333332p-2, -0x1.2e9cd95baba32p-2, -0x1.2e9cd95baba33p-2}, + {0x1.3333333333333p-2, 0x1.2e9cd95baba33p-2, 0x1.2e9cd95baba34p-2}, + {-0x1.3333333333333p-2, -0x1.2e9cd95baba33p-2, -0x1.2e9cd95baba34p-2}, + {0x1.3333333333334p-2, 0x1.2e9cd95baba34p-2, 0x1.2e9cd95baba35p-2}, + {-0x1.3333333333334p-2, -0x1.2e9cd95baba34p-2, -0x1.2e9cd95baba35p-2}, + {0x1.594317acc4ef8p-1, 0x1.3faefc7a5466fp-1, 0x1.3faefc7a5466ep-1}, + {-0x1.594317acc4ef8p-1, -0x1.3faefc7a5466fp-1, -0x1.3faefc7a5466ep-1}, + {0x1.594317acc4ef9p-1, 0x1.3faefc7a5467p-1, 0x1.3faefc7a5466fp-1}, + {-0x1.594317acc4ef9p-1, -0x1.3faefc7a5467p-1, -0x1.3faefc7a5466fp-1}, + {0x1.594317acc4efap-1, 0x1.3faefc7a5467p-1, 0x1.3faefc7a54671p-1}, + {-0x1.594317acc4efap-1, -0x1.3faefc7a5467p-1, -0x1.3faefc7a54671p-1}, + {0x1.8ffffffffffffp-1, 0x1.6888a4e134b2ep-1, 0x1.6888a4e134b2dp-1}, + {-0x1.8ffffffffffffp-1, -0x1.6888a4e134b2ep-1, -0x1.6888a4e134b2dp-1}, + {0x1.9p-1, 0x1.6888a4e134b2fp-1, 0x1.6888a4e134b2ep-1}, + {-0x1.9p-1, -0x1.6888a4e134b2fp-1, -0x1.6888a4e134b2ep-1}, + {0x1.9000000000001p-1, 0x1.6888a4e134b2fp-1, 0x1.6888a4e134b3p-1}, + {-0x1.9000000000001p-1, -0x1.6888a4e134b2fp-1, -0x1.6888a4e134b3p-1}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x1.921fb54442d17p-5, 0x1.91f65f10dd813p-5, 0x1.91f65f10dd812p-5}, + {-0x1.921fb54442d17p-5, -0x1.91f65f10dd813p-5, -0x1.91f65f10dd812p-5}, + {0x1.921fb54442d18p-5, 0x1.91f65f10dd814p-5, 0x1.91f65f10dd813p-5}, + {-0x1.921fb54442d18p-5, -0x1.91f65f10dd814p-5, -0x1.91f65f10dd813p-5}, + {0x1.921fb54442d19p-5, 0x1.91f65f10dd815p-5, 0x1.91f65f10dd814p-5}, + {-0x1.921fb54442d19p-5, -0x1.91f65f10dd815p-5, -0x1.91f65f10dd814p-5}, + {0x1.921fb54442d17p-4, 0x1.917a6bc29b42bp-4, 0x1.917a6bc29b42ap-4}, + {-0x1.921fb54442d17p-4, -0x1.917a6bc29b42bp-4, -0x1.917a6bc29b42ap-4}, + {0x1.921fb54442d18p-4, 0x1.917a6bc29b42cp-4, 0x1.917a6bc29b42bp-4}, + {-0x1.921fb54442d18p-4, -0x1.917a6bc29b42cp-4, -0x1.917a6bc29b42bp-4}, + {0x1.921fb54442d19p-4, 0x1.917a6bc29b42dp-4, 0x1.917a6bc29b42cp-4}, + {-0x1.921fb54442d19p-4, -0x1.917a6bc29b42dp-4, -0x1.917a6bc29b42cp-4}, + {0x1.921fb54442d17p-3, 0x1.8f8b83c69a609p-3, 0x1.8f8b83c69a60ap-3}, + {-0x1.921fb54442d17p-3, -0x1.8f8b83c69a609p-3, -0x1.8f8b83c69a60ap-3}, + {0x1.921fb54442d18p-3, 0x1.8f8b83c69a60ap-3, 0x1.8f8b83c69a60bp-3}, + {-0x1.921fb54442d18p-3, -0x1.8f8b83c69a60ap-3, -0x1.8f8b83c69a60bp-3}, + {0x1.921fb54442d19p-3, 0x1.8f8b83c69a60bp-3, 0x1.8f8b83c69a60cp-3}, + {-0x1.921fb54442d19p-3, -0x1.8f8b83c69a60bp-3, -0x1.8f8b83c69a60cp-3}, + {0x1.921fb54442d17p-2, 0x1.87de2a6aea962p-2, 0x1.87de2a6aea961p-2}, + {-0x1.921fb54442d17p-2, -0x1.87de2a6aea962p-2, -0x1.87de2a6aea961p-2}, + {0x1.921fb54442d18p-2, 0x1.87de2a6aea963p-2, 0x1.87de2a6aea962p-2}, + {-0x1.921fb54442d18p-2, -0x1.87de2a6aea963p-2, -0x1.87de2a6aea962p-2}, + {0x1.921fb54442d19p-2, 0x1.87de2a6aea964p-2, 0x1.87de2a6aea963p-2}, + {-0x1.921fb54442d19p-2, -0x1.87de2a6aea964p-2, -0x1.87de2a6aea963p-2}, + {0x1.921fb54442d17p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.921fb54442d17p-1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d18p-1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcdp-1}, + {0x1.921fb54442d19p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bcep-1}, + {-0x1.921fb54442d19p-1, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bcep-1}, + {0x1.921fb54442d17p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p1, 0x1.469898cc51702p-51, 0x1.469898cc51701p-51}, + {-0x1.921fb54442d17p1, -0x1.469898cc51702p-51, -0x1.469898cc51701p-51}, + {0x1.921fb54442d18p1, 0x1.1a62633145c07p-53, 0x1.1a62633145c06p-53}, + {-0x1.921fb54442d18p1, -0x1.1a62633145c07p-53, -0x1.1a62633145c06p-53}, + {0x1.921fb54442d19p1, -0x1.72cece675d1fdp-52, -0x1.72cece675d1fcp-52}, + {-0x1.921fb54442d19p1, 0x1.72cece675d1fdp-52, 0x1.72cece675d1fcp-52}, + {0x1.921fb54442d17p2, -0x1.469898cc51702p-50, -0x1.469898cc51701p-50}, + {-0x1.921fb54442d17p2, 0x1.469898cc51702p-50, 0x1.469898cc51701p-50}, + {0x1.921fb54442d18p2, -0x1.1a62633145c07p-52, -0x1.1a62633145c06p-52}, + {-0x1.921fb54442d18p2, 0x1.1a62633145c07p-52, 0x1.1a62633145c06p-52}, + {0x1.921fb54442d19p2, 0x1.72cece675d1fdp-51, 0x1.72cece675d1fcp-51}, + {-0x1.921fb54442d19p2, -0x1.72cece675d1fdp-51, -0x1.72cece675d1fcp-51}, + {0x1.921fb54442d17p3, -0x1.469898cc51702p-49, -0x1.469898cc51701p-49}, + {-0x1.921fb54442d17p3, 0x1.469898cc51702p-49, 0x1.469898cc51701p-49}, + {0x1.921fb54442d18p3, -0x1.1a62633145c07p-51, -0x1.1a62633145c06p-51}, + {-0x1.921fb54442d18p3, 0x1.1a62633145c07p-51, 0x1.1a62633145c06p-51}, + {0x1.921fb54442d19p3, 0x1.72cece675d1fdp-50, 0x1.72cece675d1fcp-50}, + {-0x1.921fb54442d19p3, -0x1.72cece675d1fdp-50, -0x1.72cece675d1fcp-50}, + {0x1.921fb54442d17p4, -0x1.469898cc51702p-48, -0x1.469898cc51701p-48}, + {-0x1.921fb54442d17p4, 0x1.469898cc51702p-48, 0x1.469898cc51701p-48}, + {0x1.921fb54442d18p4, -0x1.1a62633145c07p-50, -0x1.1a62633145c06p-50}, + {-0x1.921fb54442d18p4, 0x1.1a62633145c07p-50, 0x1.1a62633145c06p-50}, + {0x1.921fb54442d19p4, 0x1.72cece675d1fdp-49, 0x1.72cece675d1fcp-49}, + {-0x1.921fb54442d19p4, -0x1.72cece675d1fdp-49, -0x1.72cece675d1fcp-49}, + {0x1.921fb54442d17p5, -0x1.469898cc51702p-47, -0x1.469898cc51701p-47}, + {-0x1.921fb54442d17p5, 0x1.469898cc51702p-47, 0x1.469898cc51701p-47}, + {0x1.921fb54442d18p5, -0x1.1a62633145c07p-49, -0x1.1a62633145c06p-49}, + {-0x1.921fb54442d18p5, 0x1.1a62633145c07p-49, 0x1.1a62633145c06p-49}, + {0x1.921fb54442d19p5, 0x1.72cece675d1fdp-48, 0x1.72cece675d1fcp-48}, + {-0x1.921fb54442d19p5, -0x1.72cece675d1fdp-48, -0x1.72cece675d1fcp-48}, + {0x1.921fb54442d17p6, -0x1.469898cc51702p-46, -0x1.469898cc51701p-46}, + {-0x1.921fb54442d17p6, 0x1.469898cc51702p-46, 0x1.469898cc51701p-46}, + {0x1.921fb54442d18p6, -0x1.1a62633145c07p-48, -0x1.1a62633145c06p-48}, + {-0x1.921fb54442d18p6, 0x1.1a62633145c07p-48, 0x1.1a62633145c06p-48}, + {0x1.921fb54442d19p6, 0x1.72cece675d1fdp-47, 0x1.72cece675d1fcp-47}, + {-0x1.921fb54442d19p6, -0x1.72cece675d1fdp-47, -0x1.72cece675d1fcp-47}, + {0x1.921fb54442d17p7, -0x1.469898cc51702p-45, -0x1.469898cc51701p-45}, + {-0x1.921fb54442d17p7, 0x1.469898cc51702p-45, 0x1.469898cc51701p-45}, + {0x1.921fb54442d18p7, -0x1.1a62633145c07p-47, -0x1.1a62633145c06p-47}, + {-0x1.921fb54442d18p7, 0x1.1a62633145c07p-47, 0x1.1a62633145c06p-47}, + {0x1.921fb54442d19p7, 0x1.72cece675d1fdp-46, 0x1.72cece675d1fcp-46}, + {-0x1.921fb54442d19p7, -0x1.72cece675d1fdp-46, -0x1.72cece675d1fcp-46}, + {0x1.2d97c7f3321d1p1, 0x1.6a09e667f3bdp-1, 0x1.6a09e667f3bcfp-1}, + {-0x1.2d97c7f3321d1p1, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bcfp-1}, + {0x1.2d97c7f3321d2p1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bcep-1}, + {-0x1.2d97c7f3321d2p1, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bcep-1}, + {0x1.2d97c7f3321d3p1, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.2d97c7f3321d3p1, -0x1.6a09e667f3bcap-1, -0x1.6a09e667f3bcbp-1}, + {0x1.f6a7a2955385dp1, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bc8p-1}, + {-0x1.f6a7a2955385dp1, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bc8p-1}, + {0x1.f6a7a2955385ep1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {-0x1.f6a7a2955385ep1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {0x1.f6a7a2955385fp1, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.f6a7a2955385fp1, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {0x1.2d97c7f3321d1p2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d1p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d2p2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d2p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d3p2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d3p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba774p2, -0x1.6a09e667f3bd4p-1, -0x1.6a09e667f3bd3p-1}, + {-0x1.5fdbbe9bba774p2, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd3p-1}, + {0x1.5fdbbe9bba775p2, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {-0x1.5fdbbe9bba775p2, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {0x1.5fdbbe9bba776p2, -0x1.6a09e667f3bc8p-1, -0x1.6a09e667f3bc9p-1}, + {-0x1.5fdbbe9bba776p2, 0x1.6a09e667f3bc8p-1, 0x1.6a09e667f3bc9p-1}, + {0x1.c463abeccb2bap2, 0x1.6a09e667f3bc5p-1, 0x1.6a09e667f3bc6p-1}, + {-0x1.c463abeccb2bap2, -0x1.6a09e667f3bc5p-1, -0x1.6a09e667f3bc6p-1}, + {0x1.c463abeccb2bbp2, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bcap-1}, + {-0x1.c463abeccb2bbp2, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {0x1.c463abeccb2bcp2, 0x1.6a09e667f3bd1p-1, 0x1.6a09e667f3bdp-1}, + {-0x1.c463abeccb2bcp2, -0x1.6a09e667f3bd1p-1, -0x1.6a09e667f3bdp-1}, + {0x1.f6a7a2955385dp2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385dp2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385ep2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385ep2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385fp2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385fp2, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.1475cc9eedeffp3, 0x1.6a09e667f3bdfp-1, 0x1.6a09e667f3bep-1}, + {-0x1.1475cc9eedeffp3, -0x1.6a09e667f3bdfp-1, -0x1.6a09e667f3bep-1}, + {0x1.1475cc9eedfp3, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd5p-1}, + {-0x1.1475cc9eedfp3, -0x1.6a09e667f3bd4p-1, -0x1.6a09e667f3bd5p-1}, + {0x1.1475cc9eedf01p3, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bcap-1}, + {-0x1.1475cc9eedf01p3, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {0x1.2d97c7f3321d1p3, 0x1.34f272993d141p-49, 0x1.34f272993d142p-49}, + {-0x1.2d97c7f3321d1p3, -0x1.34f272993d141p-49, -0x1.34f272993d142p-49}, + {0x1.2d97c7f3321d2p3, 0x1.a79394c9e8a0ap-52, 0x1.a79394c9e8a0bp-52}, + {-0x1.2d97c7f3321d2p3, -0x1.a79394c9e8a0ap-52, -0x1.a79394c9e8a0bp-52}, + {0x1.2d97c7f3321d3p3, -0x1.961b1acd85d7dp-50, -0x1.961b1acd85d7ep-50}, + {-0x1.2d97c7f3321d3p3, 0x1.961b1acd85d7dp-50, 0x1.961b1acd85d7ep-50}, + {0x1.46b9c347764a2p3, -0x1.6a09e667f3bb9p-1, -0x1.6a09e667f3bbap-1}, + {-0x1.46b9c347764a2p3, 0x1.6a09e667f3bb9p-1, 0x1.6a09e667f3bbap-1}, + {0x1.46b9c347764a3p3, -0x1.6a09e667f3bc4p-1, -0x1.6a09e667f3bc5p-1}, + {-0x1.46b9c347764a3p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc5p-1}, + {0x1.46b9c347764a4p3, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.46b9c347764a4p3, 0x1.6a09e667f3bdp-1, 0x1.6a09e667f3bcfp-1}, + {0x1.5fdbbe9bba774p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba774p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba775p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba775p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba776p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba776p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.78fdb9effea45p3, -0x1.6a09e667f3bep-1, -0x1.6a09e667f3be1p-1}, + {-0x1.78fdb9effea45p3, 0x1.6a09e667f3bep-1, 0x1.6a09e667f3be1p-1}, + {0x1.78fdb9effea46p3, -0x1.6a09e667f3bd5p-1, -0x1.6a09e667f3bd6p-1}, + {-0x1.78fdb9effea46p3, 0x1.6a09e667f3bd5p-1, 0x1.6a09e667f3bd6p-1}, + {0x1.78fdb9effea47p3, -0x1.6a09e667f3bcap-1, -0x1.6a09e667f3bc9p-1}, + {-0x1.78fdb9effea47p3, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bc9p-1}, + {0x1.ab41b09886fe8p3, 0x1.6a09e667f3bb8p-1, 0x1.6a09e667f3bb9p-1}, + {-0x1.ab41b09886fe8p3, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb9p-1}, + {0x1.ab41b09886fe9p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc3p-1}, + {-0x1.ab41b09886fe9p3, -0x1.6a09e667f3bc4p-1, -0x1.6a09e667f3bc3p-1}, + {0x1.ab41b09886feap3, 0x1.6a09e667f3bcfp-1, 0x1.6a09e667f3bcep-1}, + {-0x1.ab41b09886feap3, -0x1.6a09e667f3bcfp-1, -0x1.6a09e667f3bcep-1}, + {0x1.c463abeccb2bap3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.c463abeccb2bap3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.c463abeccb2bbp3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.c463abeccb2bbp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.c463abeccb2bcp3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.c463abeccb2bcp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.dd85a7410f58bp3, 0x1.6a09e667f3be1p-1, 0x1.6a09e667f3be2p-1}, + {-0x1.dd85a7410f58bp3, -0x1.6a09e667f3be1p-1, -0x1.6a09e667f3be2p-1}, + {0x1.dd85a7410f58cp3, 0x1.6a09e667f3bd6p-1, 0x1.6a09e667f3bd5p-1}, + {-0x1.dd85a7410f58cp3, -0x1.6a09e667f3bd6p-1, -0x1.6a09e667f3bd5p-1}, + {0x1.dd85a7410f58dp3, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bcap-1}, + {-0x1.dd85a7410f58dp3, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {0x1.f6a7a2955385dp3, 0x1.583ebeff65cc2p-49, 0x1.583ebeff65cc3p-49}, + {-0x1.f6a7a2955385dp3, -0x1.583ebeff65cc2p-49, -0x1.583ebeff65cc3p-49}, + {0x1.f6a7a2955385ep3, 0x1.60fafbfd97309p-51, 0x1.60fafbfd97308p-51}, + {-0x1.f6a7a2955385ep3, -0x1.60fafbfd97309p-51, -0x1.60fafbfd97308p-51}, + {0x1.f6a7a2955385fp3, -0x1.4f8282013467cp-50, -0x1.4f8282013467bp-50}, + {-0x1.f6a7a2955385fp3, 0x1.4f8282013467cp-50, 0x1.4f8282013467bp-50}, + {0x1.07e4cef4cbd96p4, -0x1.6a09e667f3ba1p-1, -0x1.6a09e667f3bap-1}, + {-0x1.07e4cef4cbd96p4, 0x1.6a09e667f3ba1p-1, 0x1.6a09e667f3bap-1}, + {0x1.07e4cef4cbd97p4, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb7p-1}, + {-0x1.07e4cef4cbd97p4, 0x1.6a09e667f3bb8p-1, 0x1.6a09e667f3bb7p-1}, + {0x1.07e4cef4cbd98p4, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.07e4cef4cbd98p4, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {0x1.1475cc9eedeffp4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.1475cc9eedeffp4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.1475cc9eedfp4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.1475cc9eedfp4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.1475cc9eedf01p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.1475cc9eedf01p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2106ca4910068p4, -0x1.6a09e667f3bedp-1, -0x1.6a09e667f3beep-1}, + {-0x1.2106ca4910068p4, 0x1.6a09e667f3bedp-1, 0x1.6a09e667f3beep-1}, + {0x1.2106ca4910069p4, -0x1.6a09e667f3bd7p-1, -0x1.6a09e667f3bd6p-1}, + {-0x1.2106ca4910069p4, 0x1.6a09e667f3bd7p-1, 0x1.6a09e667f3bd6p-1}, + {0x1.2106ca491006ap4, -0x1.6a09e667f3bcp-1, -0x1.6a09e667f3bc1p-1}, + {-0x1.2106ca491006ap4, 0x1.6a09e667f3bcp-1, 0x1.6a09e667f3bc1p-1}, + {0x1.2d97c7f3321d1p4, -0x1.34f272993d141p-48, -0x1.34f272993d142p-48}, + {-0x1.2d97c7f3321d1p4, 0x1.34f272993d141p-48, 0x1.34f272993d142p-48}, + {0x1.2d97c7f3321d2p4, -0x1.a79394c9e8a0ap-51, -0x1.a79394c9e8a0bp-51}, + {-0x1.2d97c7f3321d2p4, 0x1.a79394c9e8a0ap-51, 0x1.a79394c9e8a0bp-51}, + {0x1.2d97c7f3321d3p4, 0x1.961b1acd85d7dp-49, 0x1.961b1acd85d7ep-49}, + {-0x1.2d97c7f3321d3p4, -0x1.961b1acd85d7dp-49, -0x1.961b1acd85d7ep-49}, + {0x1.3a28c59d54339p4, 0x1.6a09e667f3bap-1, 0x1.6a09e667f3ba1p-1}, + {-0x1.3a28c59d54339p4, -0x1.6a09e667f3bap-1, -0x1.6a09e667f3ba1p-1}, + {0x1.3a28c59d5433ap4, 0x1.6a09e667f3bb7p-1, 0x1.6a09e667f3bb6p-1}, + {-0x1.3a28c59d5433ap4, -0x1.6a09e667f3bb7p-1, -0x1.6a09e667f3bb6p-1}, + {0x1.3a28c59d5433bp4, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.3a28c59d5433bp4, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {0x1.46b9c347764a2p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.46b9c347764a2p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.46b9c347764a3p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.46b9c347764a3p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.46b9c347764a4p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.46b9c347764a4p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.534ac0f19860bp4, 0x1.6a09e667f3beep-1, 0x1.6a09e667f3befp-1}, + {-0x1.534ac0f19860bp4, -0x1.6a09e667f3beep-1, -0x1.6a09e667f3befp-1}, + {0x1.534ac0f19860cp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd7p-1}, + {-0x1.534ac0f19860cp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd7p-1}, + {0x1.534ac0f19860dp4, 0x1.6a09e667f3bc1p-1, 0x1.6a09e667f3bcp-1}, + {-0x1.534ac0f19860dp4, -0x1.6a09e667f3bc1p-1, -0x1.6a09e667f3bcp-1}, + {0x1.5fdbbe9bba774p4, 0x1.3dc585b2c7422p-48, 0x1.3dc585b2c7421p-48}, + {-0x1.5fdbbe9bba774p4, -0x1.3dc585b2c7422p-48, -0x1.3dc585b2c7421p-48}, + {0x1.5fdbbe9bba775p4, 0x1.ee2c2d963a10cp-51, 0x1.ee2c2d963a10dp-51}, + {-0x1.5fdbbe9bba775p4, -0x1.ee2c2d963a10cp-51, -0x1.ee2c2d963a10dp-51}, + {0x1.5fdbbe9bba776p4, -0x1.8474f49a717bdp-49, -0x1.8474f49a717bcp-49}, + {-0x1.5fdbbe9bba776p4, 0x1.8474f49a717bdp-49, 0x1.8474f49a717bcp-49}, + {0x1.6c6cbc45dc8dcp4, -0x1.6a09e667f3b9fp-1, -0x1.6a09e667f3bap-1}, + {-0x1.6c6cbc45dc8dcp4, 0x1.6a09e667f3b9fp-1, 0x1.6a09e667f3bap-1}, + {0x1.6c6cbc45dc8ddp4, -0x1.6a09e667f3bb6p-1, -0x1.6a09e667f3bb5p-1}, + {-0x1.6c6cbc45dc8ddp4, 0x1.6a09e667f3bb6p-1, 0x1.6a09e667f3bb5p-1}, + {0x1.6c6cbc45dc8dep4, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bccp-1}, + {-0x1.6c6cbc45dc8dep4, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {0x1.78fdb9effea45p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.78fdb9effea45p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.78fdb9effea46p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.78fdb9effea46p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.78fdb9effea47p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.78fdb9effea47p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.858eb79a20baep4, -0x1.6a09e667f3befp-1, -0x1.6a09e667f3beep-1}, + {-0x1.858eb79a20baep4, 0x1.6a09e667f3befp-1, 0x1.6a09e667f3beep-1}, + {0x1.858eb79a20bafp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd9p-1}, + {-0x1.858eb79a20bafp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd9p-1}, + {0x1.858eb79a20bbp4, -0x1.6a09e667f3bc2p-1, -0x1.6a09e667f3bc1p-1}, + {-0x1.858eb79a20bbp4, 0x1.6a09e667f3bc2p-1, 0x1.6a09e667f3bc1p-1}, + {0x1.fffffffffffffp62, 0x1.fa7299b17573dp-1, 0x1.fa7299b17573ep-1}, + {-0x1.fffffffffffffp62, -0x1.fa7299b17573dp-1, -0x1.fa7299b17573ep-1}, + {0x1.0p63, 0x1.fff6dfd42dc54p-1, 0x1.fff6dfd42dc55p-1}, + {-0x1.0p63, -0x1.fff6dfd42dc54p-1, -0x1.fff6dfd42dc55p-1}, + {0x1.0000000000001p63, 0x1.e456b818e7397p-1, 0x1.e456b818e7396p-1}, + {-0x1.0000000000001p63, -0x1.e456b818e7397p-1, -0x1.e456b818e7396p-1}, + {0x1.fffffffffffffp26, -0x1.86dcca0d689e8p-1, -0x1.86dcca0d689e7p-1}, + {-0x1.fffffffffffffp26, 0x1.86dcca0d689e8p-1, 0x1.86dcca0d689e7p-1}, + {0x1.0p27, -0x1.86dcc9babb0a4p-1, -0x1.86dcc9babb0a5p-1}, + {-0x1.0p27, 0x1.86dcc9babb0a4p-1, 0x1.86dcc9babb0a5p-1}, + {0x1.0000000000001p27, -0x1.86dcc9155fe18p-1, -0x1.86dcc9155fe19p-1}, + {-0x1.0000000000001p27, 0x1.86dcc9155fe18p-1, 0x1.86dcc9155fe19p-1}, + {0x1.fffffffffffffp23, -0x1.8f22f84d42da2p-1, -0x1.8f22f84d42da1p-1}, + {-0x1.fffffffffffffp23, 0x1.8f22f84d42da2p-1, 0x1.8f22f84d42da1p-1}, + {0x1.0p24, -0x1.8f22f8433d6eep-1, -0x1.8f22f8433d6edp-1}, + {-0x1.0p24, 0x1.8f22f8433d6eep-1, 0x1.8f22f8433d6edp-1}, + {0x1.0000000000001p24, -0x1.8f22f82f32986p-1, -0x1.8f22f82f32985p-1}, + {-0x1.0000000000001p24, 0x1.8f22f82f32986p-1, 0x1.8f22f82f32985p-1}, + {0x1.fffffffffffffp1, -0x1.837b9dddc1eacp-1, -0x1.837b9dddc1eabp-1}, + {-0x1.fffffffffffffp1, 0x1.837b9dddc1eacp-1, 0x1.837b9dddc1eabp-1}, + {0x1.0p2, -0x1.837b9dddc1eaep-1, -0x1.837b9dddc1eafp-1}, + {-0x1.0p2, 0x1.837b9dddc1eaep-1, 0x1.837b9dddc1eafp-1}, + {0x1.0000000000001p2, -0x1.837b9dddc1eb4p-1, -0x1.837b9dddc1eb3p-1}, + {-0x1.0000000000001p2, 0x1.837b9dddc1eb4p-1, 0x1.837b9dddc1eb3p-1}, + {0x1.fffffffffffffp0, 0x1.d18f6ead1b447p-1, 0x1.d18f6ead1b446p-1}, + {-0x1.fffffffffffffp0, -0x1.d18f6ead1b447p-1, -0x1.d18f6ead1b446p-1}, + {0x1.0p1, 0x1.d18f6ead1b446p-1, 0x1.d18f6ead1b445p-1}, + {-0x1.0p1, -0x1.d18f6ead1b446p-1, -0x1.d18f6ead1b445p-1}, + {0x1.0000000000001p1, 0x1.d18f6ead1b444p-1, 0x1.d18f6ead1b445p-1}, + {-0x1.0000000000001p1, -0x1.d18f6ead1b444p-1, -0x1.d18f6ead1b445p-1}, + {0x1.fffffffffffffp-1, 0x1.aed548f090cedp-1, 0x1.aed548f090ceep-1}, + {-0x1.fffffffffffffp-1, -0x1.aed548f090cedp-1, -0x1.aed548f090ceep-1}, + {0x1.0p0, 0x1.aed548f090ceep-1, 0x1.aed548f090cefp-1}, + {-0x1.0p0, -0x1.aed548f090ceep-1, -0x1.aed548f090cefp-1}, + {0x1.0000000000001p0, 0x1.aed548f090cefp-1, 0x1.aed548f090cfp-1}, + {-0x1.0000000000001p0, -0x1.aed548f090cefp-1, -0x1.aed548f090cfp-1}, + {0x1.fffffffffffffp-2, 0x1.eaee8744b05efp-2, 0x1.eaee8744b05fp-2}, + {-0x1.fffffffffffffp-2, -0x1.eaee8744b05efp-2, -0x1.eaee8744b05fp-2}, + {0x1.0p-1, 0x1.eaee8744b05fp-2, 0x1.eaee8744b05efp-2}, + {-0x1.0p-1, -0x1.eaee8744b05fp-2, -0x1.eaee8744b05efp-2}, + {0x1.0000000000001p-1, 0x1.eaee8744b05f2p-2, 0x1.eaee8744b05f1p-2}, + {-0x1.0000000000001p-1, -0x1.eaee8744b05f2p-2, -0x1.eaee8744b05f1p-2}, + {0x1.fffffffffffffp-3, 0x1.faaeed4f31576p-3, 0x1.faaeed4f31575p-3}, + {-0x1.fffffffffffffp-3, -0x1.faaeed4f31576p-3, -0x1.faaeed4f31575p-3}, + {0x1.0p-2, 0x1.faaeed4f31577p-3, 0x1.faaeed4f31576p-3}, + {-0x1.0p-2, -0x1.faaeed4f31577p-3, -0x1.faaeed4f31576p-3}, + {0x1.0000000000001p-2, 0x1.faaeed4f31579p-3, 0x1.faaeed4f31578p-3}, + {-0x1.0000000000001p-2, -0x1.faaeed4f31579p-3, -0x1.faaeed4f31578p-3}, + {0x1.fffffffffffffp-4, 0x1.feaaeee86ee35p-4, 0x1.feaaeee86ee34p-4}, + {-0x1.fffffffffffffp-4, -0x1.feaaeee86ee35p-4, -0x1.feaaeee86ee34p-4}, + {0x1.0p-3, 0x1.feaaeee86ee36p-4, 0x1.feaaeee86ee35p-4}, + {-0x1.0p-3, -0x1.feaaeee86ee36p-4, -0x1.feaaeee86ee35p-4}, + {0x1.0000000000001p-3, 0x1.feaaeee86ee38p-4, 0x1.feaaeee86ee37p-4}, + {-0x1.0000000000001p-3, -0x1.feaaeee86ee38p-4, -0x1.feaaeee86ee37p-4}, + {0x1.fffffffffffffp-5, 0x1.ffaaaeeed4edap-5, 0x1.ffaaaeeed4ed9p-5}, + {-0x1.fffffffffffffp-5, -0x1.ffaaaeeed4edap-5, -0x1.ffaaaeeed4ed9p-5}, + {0x1.0p-4, 0x1.ffaaaeeed4edbp-5, 0x1.ffaaaeeed4edap-5}, + {-0x1.0p-4, -0x1.ffaaaeeed4edbp-5, -0x1.ffaaaeeed4edap-5}, + {0x1.0000000000001p-4, 0x1.ffaaaeeed4eddp-5, 0x1.ffaaaeeed4edcp-5}, + {-0x1.0000000000001p-4, -0x1.ffaaaeeed4eddp-5, -0x1.ffaaaeeed4edcp-5}, + {0x1.fffffffffffffp-6, 0x1.ffeaaaeeee86ep-6, 0x1.ffeaaaeeee86dp-6}, + {-0x1.fffffffffffffp-6, -0x1.ffeaaaeeee86ep-6, -0x1.ffeaaaeeee86dp-6}, + {0x1.0p-5, 0x1.ffeaaaeeee86fp-6, 0x1.ffeaaaeeee86ep-6}, + {-0x1.0p-5, -0x1.ffeaaaeeee86fp-6, -0x1.ffeaaaeeee86ep-6}, + {0x1.0000000000001p-5, 0x1.ffeaaaeeee871p-6, 0x1.ffeaaaeeee87p-6}, + {-0x1.0000000000001p-5, -0x1.ffeaaaeeee871p-6, -0x1.ffeaaaeeee87p-6}, + {0x1.fffffffffffffp-7, 0x1.fffaaaaeeeed4p-7, 0x1.fffaaaaeeeed3p-7}, + {-0x1.fffffffffffffp-7, -0x1.fffaaaaeeeed4p-7, -0x1.fffaaaaeeeed3p-7}, + {0x1.0p-6, 0x1.fffaaaaeeeed5p-7, 0x1.fffaaaaeeeed4p-7}, + {-0x1.0p-6, -0x1.fffaaaaeeeed5p-7, -0x1.fffaaaaeeeed4p-7}, + {0x1.0000000000001p-6, 0x1.fffaaaaeeeed7p-7, 0x1.fffaaaaeeeed6p-7}, + {-0x1.0000000000001p-6, -0x1.fffaaaaeeeed7p-7, -0x1.fffaaaaeeeed6p-7}, + {0x1.fffffffffffffp-15, 0x1.fffffffaaaaaap-15, 0x1.fffffffaaaaa9p-15}, + {-0x1.fffffffffffffp-15, -0x1.fffffffaaaaaap-15, -0x1.fffffffaaaaa9p-15}, + {0x1.0p-14, 0x1.fffffffaaaaabp-15, 0x1.fffffffaaaaaap-15}, + {-0x1.0p-14, -0x1.fffffffaaaaabp-15, -0x1.fffffffaaaaaap-15}, + {0x1.0000000000001p-14, 0x1.fffffffaaaaadp-15, 0x1.fffffffaaaaacp-15}, + {-0x1.0000000000001p-14, -0x1.fffffffaaaaadp-15, -0x1.fffffffaaaaacp-15}, + {0x1.fffffffffffffp-28, 0x1.fffffffffffffp-28, 0x1.ffffffffffffep-28}, + {-0x1.fffffffffffffp-28, -0x1.fffffffffffffp-28, -0x1.ffffffffffffep-28}, + {0x1.0p-27, 0x1.0p-27, 0x1.fffffffffffffp-28}, + {-0x1.0p-27, -0x1.0p-27, -0x1.fffffffffffffp-28}, + {0x1.0000000000001p-27, 0x1.0000000000001p-27, 0x1.0p-27}, + {-0x1.0000000000001p-27, -0x1.0000000000001p-27, -0x1.0p-27}, + {0x1.fffffffffffffp-31, 0x1.fffffffffffffp-31, 0x1.ffffffffffffep-31}, + {-0x1.fffffffffffffp-31, -0x1.fffffffffffffp-31, -0x1.ffffffffffffep-31}, + {0x1.0p-30, 0x1.0p-30, 0x1.fffffffffffffp-31}, + {-0x1.0p-30, -0x1.0p-30, -0x1.fffffffffffffp-31}, + {0x1.0000000000001p-30, 0x1.0000000000001p-30, 0x1.0p-30}, + {-0x1.0000000000001p-30, -0x1.0000000000001p-30, -0x1.0p-30}, + {-0x1.fffffffffffffp1023, -0x1.452fc98b34e97p-8, -0x1.452fc98b34e96p-8}, + {0x1.fffffffffffffp1023, 0x1.452fc98b34e97p-8, 0x1.452fc98b34e96p-8}, + {0x1.fffffffffffffp1023, 0x1.452fc98b34e97p-8, 0x1.452fc98b34e96p-8}, + {-0x1.fffffffffffffp1023, -0x1.452fc98b34e97p-8, -0x1.452fc98b34e96p-8}, + {0x1.fffffffffffffp1023, 0x1.452fc98b34e97p-8, 0x1.452fc98b34e96p-8}, + {-0x1.fffffffffffffp1023, -0x1.452fc98b34e97p-8, -0x1.452fc98b34e96p-8}, + {0x1.ffffffffffffep1023, 0x1.daa3677c6ee8ap-1, 0x1.daa3677c6ee8bp-1}, + {-0x1.ffffffffffffep1023, -0x1.daa3677c6ee8ap-1, -0x1.daa3677c6ee8bp-1}, + {0x1.921fb54442d18p1, 0x1.1a62633145c07p-53, 0x1.1a62633145c06p-53}, + {-0x1.921fb54442d18p1, -0x1.1a62633145c07p-53, -0x1.1a62633145c06p-53}, + {0x1.921fb54442d18p0, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p0, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.0000000000001p0, 0x1.aed548f090cefp-1, 0x1.aed548f090cfp-1}, + {-0x1.0000000000001p0, -0x1.aed548f090cefp-1, -0x1.aed548f090cfp-1}, + {0x1.0p0, 0x1.aed548f090ceep-1, 0x1.aed548f090cefp-1}, + {-0x1.0p0, -0x1.aed548f090ceep-1, -0x1.aed548f090cefp-1}, + {0x1.fffffffffffffp-1, 0x1.aed548f090cedp-1, 0x1.aed548f090ceep-1}, + {-0x1.fffffffffffffp-1, -0x1.aed548f090cedp-1, -0x1.aed548f090ceep-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d18p-1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcdp-1}, + {0x1.0000000000001p-1022, 0x1.0000000000001p-1022, 0x1.0000000000001p-1022}, + {-0x1.0000000000001p-1022, -0x1.0000000000001p-1022, -0x1.0000000000001p-1022}, + {0x1.0p-1022, 0x1.0p-1022, 0x1.0p-1022}, + {-0x1.0p-1022, -0x1.0p-1022, -0x1.0p-1022}, + {0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022, 0x0.fffffffffffffp-1022}, + {-0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022, -0x0.fffffffffffffp-1022}, + {0x0.ffffffffffffep-1022, 0x0.ffffffffffffep-1022, 0x0.ffffffffffffep-1022}, + {-0x0.ffffffffffffep-1022, -0x0.ffffffffffffep-1022, -0x0.ffffffffffffep-1022}, + {0x0.0000000000002p-1022, 0x0.0000000000002p-1022, 0x0.0000000000002p-1022}, + {-0x0.0000000000002p-1022, -0x0.0000000000002p-1022, -0x0.0000000000001p-1022}, + {0x0.0000000000001p-1022, 0x0.0000000000001p-1022, 0x0.0p0}, + {-0x0.0000000000001p-1022, -0x0.0000000000001p-1022, -0x0.0p0}, + {0x0.0p0, 0x0.0p0, 0x0.0p0}, + {-0x0.0p0, -0x0.0p0, -0x0.0p0} + + }; + + for(double[] testCase: testCases) { + failures += testSinCase(testCase[0], testCase[1], testCase[2]); + } + + return failures; + } + + private static int testSinCase(double input, double bound1, double bound2) { + int failures = 0; + failures += Tests.testBounds("Math.sin", input, Math.sin(input), bound1, bound2); + return failures; + } + + private static int testCornerCasesCos() { + int failures = 0; + double[][] testCases = { + {0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {-0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {0x1.7cb7648526f99p-1, 0x1.78daf01036d0dp-1, 0x1.78daf01036d0cp-1}, + {-0x1.7cb7648526f99p-1, 0x1.78daf01036d0dp-1, 0x1.78daf01036d0cp-1}, + {0x1.549ec0c0c5afap-5, 0x1.ff8eb6a91ecbp-1, 0x1.ff8eb6a91ecb1p-1}, + {-0x1.549ec0c0c5afap-5, 0x1.ff8eb6a91ecbp-1, 0x1.ff8eb6a91ecb1p-1}, + {0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {-0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {0x1.efeef61d39ac2p-3, 0x1.f10fc61e2c78fp-1, 0x1.f10fc61e2c78ep-1}, + {-0x1.efeef61d39ac2p-3, 0x1.f10fc61e2c78fp-1, 0x1.f10fc61e2c78ep-1}, + {0x1.c65a170474549p-1, 0x1.434a3645be208p-1, 0x1.434a3645be209p-1}, + {-0x1.c65a170474549p-1, 0x1.434a3645be208p-1, 0x1.434a3645be209p-1}, + {0x1.6b8a6273d7c21p0, 0x1.337fc5b072c53p-3, 0x1.337fc5b072c52p-3}, + {-0x1.6b8a6273d7c21p0, 0x1.337fc5b072c53p-3, 0x1.337fc5b072c52p-3}, + {-0x1.036f4ba7e90aap-2, 0x1.efa7cddb128fcp-1, 0x1.efa7cddb128fbp-1}, + {0x1.036f4ba7e90aap-2, 0x1.efa7cddb128fcp-1, 0x1.efa7cddb128fbp-1}, + {-0x1.1500766c9df2p-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.1500766c9df2p-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.1e2a1563e068ep-2, 0x1.ec231802917bep-1, 0x1.ec231802917bdp-1}, + {0x1.1e2a1563e068ep-2, 0x1.ec231802917bep-1, 0x1.ec231802917bdp-1}, + {-0x1.2115aa73f8d05p5, 0x1.dc044ac92b7fcp-8, 0x1.dc044ac92b7fbp-8}, + {0x1.2115aa73f8d05p5, 0x1.dc044ac92b7fcp-8, 0x1.dc044ac92b7fbp-8}, + {-0x1.34e3bcdf8f69ap2, 0x1.d1fa67c50dd53p-4, 0x1.d1fa67c50dd52p-4}, + {0x1.34e3bcdf8f69ap2, 0x1.d1fa67c50dd53p-4, 0x1.d1fa67c50dd52p-4}, + {-0x1.380000000000bp7, 0x1.e2f8d19fb8db8p-2, 0x1.e2f8d19fb8db9p-2}, + {0x1.380000000000bp7, 0x1.e2f8d19fb8db8p-2, 0x1.e2f8d19fb8db9p-2}, + {-0x1.440000004p6, 0x1.8da9c90c3eda1p-1, 0x1.8da9c90c3eda2p-1}, + {0x1.440000004p6, 0x1.8da9c90c3eda1p-1, 0x1.8da9c90c3eda2p-1}, + {-0x1.550c8ee67a4c4p29, 0x1.b59b320603f83p-1, 0x1.b59b320603f84p-1}, + {0x1.550c8ee67a4c4p29, 0x1.b59b320603f83p-1, 0x1.b59b320603f84p-1}, + {-0x1.711789fdb2e8ap-13, 0x1.ffffff7af6c88p-1, 0x1.ffffff7af6c89p-1}, + {0x1.711789fdb2e8ap-13, 0x1.ffffff7af6c88p-1, 0x1.ffffff7af6c89p-1}, + {-0x1.77e000002p8, 0x1.c1b68ebb0b4fep-2, 0x1.c1b68ebb0b4ffp-2}, + {0x1.77e000002p8, 0x1.c1b68ebb0b4fep-2, 0x1.c1b68ebb0b4ffp-2}, + {-0x1.8106561931b43p0, 0x1.1161e1dad76dcp-4, 0x1.1161e1dad76dbp-4}, + {0x1.8106561931b43p0, 0x1.1161e1dad76dcp-4, 0x1.1161e1dad76dbp-4}, + {-0x1.825be2461cad4p0, 0x1.f828c3226b3d7p-5, 0x1.f828c3226b3d8p-5}, + {0x1.825be2461cad4p0, 0x1.f828c3226b3d7p-5, 0x1.f828c3226b3d8p-5}, + {-0x1.8288755803b08p0, 0x1.f2990d742e9fbp-5, 0x1.f2990d742e9fap-5}, + {0x1.8288755803b08p0, 0x1.f2990d742e9fbp-5, 0x1.f2990d742e9fap-5}, + {-0x1.8a75701f4ccd3p1, -0x1.ff150dda7524dp-1, -0x1.ff150dda7524cp-1}, + {0x1.8a75701f4ccd3p1, -0x1.ff150dda7524dp-1, -0x1.ff150dda7524cp-1}, + {-0x1.b389316f37f37p3, 0x1.015c47c32b574p-1, 0x1.015c47c32b575p-1}, + {0x1.b389316f37f37p3, 0x1.015c47c32b574p-1, 0x1.015c47c32b575p-1}, + {-0x1.c602c465d7d27p6, 0x1.d681a366a0534p-1, 0x1.d681a366a0535p-1}, + {0x1.c602c465d7d27p6, 0x1.d681a366a0534p-1, 0x1.d681a366a0535p-1}, + {-0x1.cfb81fe69664cp4, -0x1.84e896c7543d6p-1, -0x1.84e896c7543d5p-1}, + {0x1.cfb81fe69664cp4, -0x1.84e896c7543d6p-1, -0x1.84e896c7543d5p-1}, + {-0x1.d08f2d86b12c6p13, 0x1.fc5dcfddd54cp-1, 0x1.fc5dcfddd54c1p-1}, + {0x1.d08f2d86b12c6p13, 0x1.fc5dcfddd54cp-1, 0x1.fc5dcfddd54c1p-1}, + {-0x1.de13f0943c494p99, 0x1.fe83235fbe016p-3, 0x1.fe83235fbe015p-3}, + {0x1.de13f0943c494p99, 0x1.fe83235fbe016p-3, 0x1.fe83235fbe015p-3}, + {-0x1.de3c1f1285e8bp3, -0x1.720321239ec5p-1, -0x1.720321239ec4fp-1}, + {0x1.de3c1f1285e8bp3, -0x1.720321239ec5p-1, -0x1.720321239ec4fp-1}, + {-0x1.fffffffffff7fp1023, 0x1.f7143c8bba407p-4, 0x1.f7143c8bba406p-4}, + {0x1.fffffffffff7fp1023, 0x1.f7143c8bba407p-4, 0x1.f7143c8bba406p-4}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.0000000000001p51, 0x1.055e457ac1227p-5, 0x1.055e457ac1228p-5}, + {-0x1.0000000000001p51, 0x1.055e457ac1227p-5, 0x1.055e457ac1228p-5}, + {0x1.0000000000003p-1, 0x1.c1528065b7d4ep-1, 0x1.c1528065b7d4fp-1}, + {-0x1.0000000000003p-1, 0x1.c1528065b7d4ep-1, 0x1.c1528065b7d4fp-1}, + {0x1.0000000000003p-32, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0000000000003p-32, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.000000000002p150, 0x1.fffea444bc05ep-1, 0x1.fffea444bc05fp-1}, + {-0x1.000000000002p150, 0x1.fffea444bc05ep-1, 0x1.fffea444bc05fp-1}, + {0x1.0000000000038p380, -0x1.ebddee876f434p-1, -0x1.ebddee876f433p-1}, + {-0x1.0000000000038p380, -0x1.ebddee876f434p-1, -0x1.ebddee876f433p-1}, + {0x1.0000000000118p380, -0x1.f2ffc51dc6968p-1, -0x1.f2ffc51dc6969p-1}, + {-0x1.0000000000118p380, -0x1.f2ffc51dc6968p-1, -0x1.f2ffc51dc6969p-1}, + {0x1.00000000003ffp641, -0x1.f8fbb4d358b2p-1, -0x1.f8fbb4d358b21p-1}, + {-0x1.00000000003ffp641, -0x1.f8fbb4d358b2p-1, -0x1.f8fbb4d358b21p-1}, + {0x1.0000000001p1, -0x1.aa2265753e668p-2, -0x1.aa2265753e669p-2}, + {-0x1.0000000001p1, -0x1.aa2265753e668p-2, -0x1.aa2265753e669p-2}, + {0x1.000000008p452, 0x1.fd1242c25994dp-1, 0x1.fd1242c25994ep-1}, + {-0x1.000000008p452, 0x1.fd1242c25994dp-1, 0x1.fd1242c25994ep-1}, + {0x1.00000000effafp-7, 0x1.fffc0001554dap-1, 0x1.fffc0001554dbp-1}, + {-0x1.00000000effafp-7, 0x1.fffc0001554dap-1, 0x1.fffc0001554dbp-1}, + {0x1.00000114fefe2p0, 0x1.14a27f2925522p-1, 0x1.14a27f2925523p-1}, + {-0x1.00000114fefe2p0, 0x1.14a27f2925522p-1, 0x1.14a27f2925523p-1}, + {0x1.000007p40, 0x1.bf81e0269c59dp-3, 0x1.bf81e0269c59cp-3}, + {-0x1.000007p40, 0x1.bf81e0269c59dp-3, 0x1.bf81e0269c59cp-3}, + {0x1.00000acadb3d3p0, 0x1.14a26ed1960d6p-1, 0x1.14a26ed1960d7p-1}, + {-0x1.00000acadb3d3p0, 0x1.14a26ed1960d6p-1, 0x1.14a26ed1960d7p-1}, + {0x1.00003p-17, 0x1.ffffffffbfffep-1, 0x1.ffffffffbffffp-1}, + {-0x1.00003p-17, 0x1.ffffffffbfffep-1, 0x1.ffffffffbffffp-1}, + {0x1.00003ffffffaep-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {-0x1.00003ffffffaep-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {0x1.00003ffffffffp-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {-0x1.00003ffffffffp-18, 0x1.ffffffffeffffp-1, 0x1.fffffffffp-1}, + {0x1.00007ffffdeap41, -0x1.dab7efeb35baep-2, -0x1.dab7efeb35badp-2}, + {-0x1.00007ffffdeap41, -0x1.dab7efeb35baep-2, -0x1.dab7efeb35badp-2}, + {0x1.0000ffff8p-19, 0x1.fffffffffcp-1, 0x1.fffffffffbfffp-1}, + {-0x1.0000ffff8p-19, 0x1.fffffffffcp-1, 0x1.fffffffffbfffp-1}, + {0x1.0003fff800051p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {-0x1.0003fff800051p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {0x1.0003fff800096p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {-0x1.0003fff800096p-20, 0x1.ffffffffffp-1, 0x1.fffffffffefffp-1}, + {0x1.000fd2p334, -0x1.fbf2b71a23a58p-2, -0x1.fbf2b71a23a57p-2}, + {-0x1.000fd2p334, -0x1.fbf2b71a23a58p-2, -0x1.fbf2b71a23a57p-2}, + {0x1.003p514, 0x1.fccc87eae7737p-5, 0x1.fccc87eae7736p-5}, + {-0x1.003p514, 0x1.fccc87eae7737p-5, 0x1.fccc87eae7736p-5}, + {0x1.00600000015f4p41, -0x1.a43f40d92b7edp-7, -0x1.a43f40d92b7eep-7}, + {-0x1.00600000015f4p41, -0x1.a43f40d92b7edp-7, -0x1.a43f40d92b7eep-7}, + {0x1.007p-1, 0x1.c11cc38f40ab3p-1, 0x1.c11cc38f40ab2p-1}, + {-0x1.007p-1, 0x1.c11cc38f40ab3p-1, 0x1.c11cc38f40ab2p-1}, + {0x1.007p-21, 0x1.ffffffffffbfcp-1, 0x1.ffffffffffbfdp-1}, + {-0x1.007p-21, 0x1.ffffffffffbfcp-1, 0x1.ffffffffffbfdp-1}, + {0x1.00cp40, 0x1.e9ba98231f734p-8, 0x1.e9ba98231f735p-8}, + {-0x1.00cp40, 0x1.e9ba98231f734p-8, 0x1.e9ba98231f735p-8}, + {0x1.011p-4, 0x1.fefdf48ed649dp-1, 0x1.fefdf48ed649cp-1}, + {-0x1.011p-4, 0x1.fefdf48ed649dp-1, 0x1.fefdf48ed649cp-1}, + {0x1.011p996, -0x1.ffc16a0f12ff2p-1, -0x1.ffc16a0f12ff3p-1}, + {-0x1.011p996, -0x1.ffc16a0f12ff2p-1, -0x1.ffc16a0f12ff3p-1}, + {0x1.02p-2, 0x1.efd5b61a30a38p-1, 0x1.efd5b61a30a39p-1}, + {-0x1.02p-2, 0x1.efd5b61a30a38p-1, 0x1.efd5b61a30a39p-1}, + {0x1.0204260c18307p59, 0x1.c97b8161dc50ap-2, 0x1.c97b8161dc50bp-2}, + {-0x1.0204260c18307p59, 0x1.c97b8161dc50ap-2, 0x1.c97b8161dc50bp-2}, + {0x1.02e78a321155ep1, -0x1.bf26a3c9b9fbfp-2, -0x1.bf26a3c9b9fbep-2}, + {-0x1.02e78a321155ep1, -0x1.bf26a3c9b9fbfp-2, -0x1.bf26a3c9b9fbep-2}, + {0x1.04p-4, 0x1.fef806b1f84e5p-1, 0x1.fef806b1f84e4p-1}, + {-0x1.04p-4, 0x1.fef806b1f84e5p-1, 0x1.fef806b1f84e4p-1}, + {0x1.04bde8bb80258p98, 0x1.fe851fbf87d17p-1, 0x1.fe851fbf87d18p-1}, + {-0x1.04bde8bb80258p98, 0x1.fe851fbf87d17p-1, 0x1.fe851fbf87d18p-1}, + {0x1.077e749e37ceep236, 0x1.70f6a51da8effp-1, 0x1.70f6a51da8efep-1}, + {-0x1.077e749e37ceep236, 0x1.70f6a51da8effp-1, 0x1.70f6a51da8efep-1}, + {0x1.07f8p300, 0x1.6b408c856bda6p-3, 0x1.6b408c856bda5p-3}, + {-0x1.07f8p300, 0x1.6b408c856bda6p-3, 0x1.6b408c856bda5p-3}, + {0x1.07f9bea1b3546p27, 0x1.2b2f965ae40fcp-1, 0x1.2b2f965ae40fdp-1}, + {-0x1.07f9bea1b3546p27, 0x1.2b2f965ae40fcp-1, 0x1.2b2f965ae40fdp-1}, + {0x1.090d18372f2d5p4, -0x1.4eed2f3fc76a8p-1, -0x1.4eed2f3fc76a7p-1}, + {-0x1.090d18372f2d5p4, -0x1.4eed2f3fc76a8p-1, -0x1.4eed2f3fc76a7p-1}, + {0x1.0b4p-3, 0x1.fba59aecee5p-1, 0x1.fba59aecee501p-1}, + {-0x1.0b4p-3, 0x1.fba59aecee5p-1, 0x1.fba59aecee501p-1}, + {0x1.0c0d5c2af3c2ep346, 0x1.fffd1bcda7a7dp-1, 0x1.fffd1bcda7a7ep-1}, + {-0x1.0c0d5c2af3c2ep346, 0x1.fffd1bcda7a7dp-1, 0x1.fffd1bcda7a7ep-1}, + {0x1.0d30596ee91fdp216, -0x1.e4dfe83129286p-1, -0x1.e4dfe83129287p-1}, + {-0x1.0d30596ee91fdp216, -0x1.e4dfe83129286p-1, -0x1.e4dfe83129287p-1}, + {0x1.0d6p0, 0x1.fb8432886a284p-2, 0x1.fb8432886a283p-2}, + {-0x1.0d6p0, 0x1.fb8432886a284p-2, 0x1.fb8432886a283p-2}, + {0x1.0e9474c68831cp-10, 0x1.ffffee202854p-1, 0x1.ffffee202853fp-1}, + {-0x1.0e9474c68831cp-10, 0x1.ffffee202854p-1, 0x1.ffffee202853fp-1}, + {0x1.113bae4049849p2, -0x1.b70d3d5584b1bp-2, -0x1.b70d3d5584b1ap-2}, + {-0x1.113bae4049849p2, -0x1.b70d3d5584b1bp-2, -0x1.b70d3d5584b1ap-2}, + {0x1.12eb87097654p-4, 0x1.fed8df58f626p-1, 0x1.fed8df58f625fp-1}, + {-0x1.12eb87097654p-4, 0x1.fed8df58f626p-1, 0x1.fed8df58f625fp-1}, + {0x1.13cp0, 0x1.e536ae395dfcep-2, 0x1.e536ae395dfcfp-2}, + {-0x1.13cp0, 0x1.e536ae395dfcep-2, 0x1.e536ae395dfcfp-2}, + {0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {-0x1.16e534ee3658p-4, 0x1.fed0476fc75cap-1, 0x1.fed0476fc75c9p-1}, + {0x1.17fffffffea98p-3, 0x1.fb38e82e3193ap-1, 0x1.fb38e82e3193bp-1}, + {-0x1.17fffffffea98p-3, 0x1.fb38e82e3193ap-1, 0x1.fb38e82e3193bp-1}, + {0x1.18p-3, 0x1.fb38e82e3188p-1, 0x1.fb38e82e3187fp-1}, + {-0x1.18p-3, 0x1.fb38e82e3188p-1, 0x1.fb38e82e3187fp-1}, + {0x1.1a191ebbb4d7fp7, -0x1.e59647f1fe9c7p-1, -0x1.e59647f1fe9c8p-1}, + {-0x1.1a191ebbb4d7fp7, -0x1.e59647f1fe9c7p-1, -0x1.e59647f1fe9c8p-1}, + {0x1.1da84f2b7b1d8p7, -0x1.d0dca1f8715bep-4, -0x1.d0dca1f8715bdp-4}, + {-0x1.1da84f2b7b1d8p7, -0x1.d0dca1f8715bep-4, -0x1.d0dca1f8715bdp-4}, + {0x1.201e973251302p0, 0x1.b917ebbc30e1ep-2, 0x1.b917ebbc30e1dp-2}, + {-0x1.201e973251302p0, 0x1.b917ebbc30e1ep-2, 0x1.b917ebbc30e1dp-2}, + {0x1.21e02p-7, 0x1.fffadf12ff414p-1, 0x1.fffadf12ff415p-1}, + {-0x1.21e02p-7, 0x1.fffadf12ff414p-1, 0x1.fffadf12ff415p-1}, + {0x1.27e29a4b985bfp1, -0x1.598a4dab3de5ap-1, -0x1.598a4dab3de59p-1}, + {-0x1.27e29a4b985bfp1, -0x1.598a4dab3de5ap-1, -0x1.598a4dab3de59p-1}, + {0x1.2a1f28dbfb6cp-3, 0x1.fa95c1154abf5p-1, 0x1.fa95c1154abf6p-1}, + {-0x1.2a1f28dbfb6cp-3, 0x1.fa95c1154abf5p-1, 0x1.fa95c1154abf6p-1}, + {0x1.2b8p1, -0x1.6412293adb7bcp-1, -0x1.6412293adb7bdp-1}, + {-0x1.2b8p1, -0x1.6412293adb7bcp-1, -0x1.6412293adb7bdp-1}, + {0x1.31199def72f4dp-7, 0x1.fffa518a7d0e7p-1, 0x1.fffa518a7d0e8p-1}, + {-0x1.31199def72f4dp-7, 0x1.fffa518a7d0e7p-1, 0x1.fffa518a7d0e8p-1}, + {0x1.31260e1485014p4, 0x1.f36895fe177f8p-1, 0x1.f36895fe177f7p-1}, + {-0x1.31260e1485014p4, 0x1.f36895fe177f8p-1, 0x1.f36895fe177f7p-1}, + {0x1.34e964cd103bdp2, 0x1.d36207b4fee17p-4, 0x1.d36207b4fee16p-4}, + {-0x1.34e964cd103bdp2, 0x1.d36207b4fee17p-4, 0x1.d36207b4fee16p-4}, + {0x1.37618a0ba785p1, -0x1.84a37f4fa7616p-1, -0x1.84a37f4fa7617p-1}, + {-0x1.37618a0ba785p1, -0x1.84a37f4fa7616p-1, -0x1.84a37f4fa7617p-1}, + {0x1.379704f5f1eb3p24, -0x1.c830bbc99e229p-39, -0x1.c830bbc99e22ap-39}, + {-0x1.379704f5f1eb3p24, -0x1.c830bbc99e229p-39, -0x1.c830bbc99e22ap-39}, + {0x1.3b61dd166d47p2, 0x1.b5daaa233bd5p-3, 0x1.b5daaa233bd4fp-3}, + {-0x1.3b61dd166d47p2, 0x1.b5daaa233bd5p-3, 0x1.b5daaa233bd4fp-3}, + {0x1.3c011022acbdp37, -0x1.ffd00dc4db401p-4, -0x1.ffd00dc4db4p-4}, + {-0x1.3c011022acbdp37, -0x1.ffd00dc4db401p-4, -0x1.ffd00dc4db4p-4}, + {0x1.3e7788e900b7p727, -0x1.14052b4016ff5p-1, -0x1.14052b4016ff6p-1}, + {-0x1.3e7788e900b7p727, -0x1.14052b4016ff5p-1, -0x1.14052b4016ff6p-1}, + {0x1.423eafdcc2779p-10, 0x1.ffffe6a5e4198p-1, 0x1.ffffe6a5e4197p-1}, + {-0x1.423eafdcc2779p-10, 0x1.ffffe6a5e4198p-1, 0x1.ffffe6a5e4197p-1}, + {0x1.4321828c1b538p119, -0x1.fe09fc3d16feep-6, -0x1.fe09fc3d16fedp-6}, + {-0x1.4321828c1b538p119, -0x1.fe09fc3d16feep-6, -0x1.fe09fc3d16fedp-6}, + {0x1.43506cb22975dp22, 0x1.b685d949a27ap-14, 0x1.b685d949a27a1p-14}, + {-0x1.43506cb22975dp22, 0x1.b685d949a27ap-14, 0x1.b685d949a27a1p-14}, + {0x1.439f63495786ap67, 0x1.fe398090e203cp-1, 0x1.fe398090e203bp-1}, + {-0x1.439f63495786ap67, 0x1.fe398090e203cp-1, 0x1.fe398090e203bp-1}, + {0x1.457538a6bd073p-4, 0x1.fe6274e000974p-1, 0x1.fe6274e000973p-1}, + {-0x1.457538a6bd073p-4, 0x1.fe6274e000974p-1, 0x1.fe6274e000973p-1}, + {0x1.478fc08p43, 0x1.09fcb69359c0ap-1, 0x1.09fcb69359c09p-1}, + {-0x1.478fc08p43, 0x1.09fcb69359c0ap-1, 0x1.09fcb69359c09p-1}, + {0x1.48a45797cbe63p61, -0x1.20c2158511e79p-9, -0x1.20c2158511e78p-9}, + {-0x1.48a45797cbe63p61, -0x1.20c2158511e79p-9, -0x1.20c2158511e78p-9}, + {0x1.4a62e0e12c173p-1, 0x1.990d17aae253p-1, 0x1.990d17aae2531p-1}, + {-0x1.4a62e0e12c173p-1, 0x1.990d17aae253p-1, 0x1.990d17aae2531p-1}, + {0x1.4c596642a9488p9, 0x1.fdd4f1e00b387p-3, 0x1.fdd4f1e00b388p-3}, + {-0x1.4c596642a9488p9, 0x1.fdd4f1e00b387p-3, 0x1.fdd4f1e00b388p-3}, + {0x1.4dp-4, 0x1.fe4f141032f38p-1, 0x1.fe4f141032f37p-1}, + {-0x1.4dp-4, 0x1.fe4f141032f38p-1, 0x1.fe4f141032f37p-1}, + {0x1.4f0f308p488, 0x1.94e9f45d43c14p-2, 0x1.94e9f45d43c13p-2}, + {-0x1.4f0f308p488, 0x1.94e9f45d43c14p-2, 0x1.94e9f45d43c13p-2}, + {0x1.52f00ep793, 0x1.9355f69ad4326p-2, 0x1.9355f69ad4327p-2}, + {-0x1.52f00ep793, 0x1.9355f69ad4326p-2, 0x1.9355f69ad4327p-2}, + {0x1.52f06c730ec02p2, 0x1.1a19be8bea10ap-1, 0x1.1a19be8bea10bp-1}, + {-0x1.52f06c730ec02p2, 0x1.1a19be8bea10ap-1, 0x1.1a19be8bea10bp-1}, + {0x1.53e7d5845fe3dp220, 0x1.385d92ec0c734p-1, 0x1.385d92ec0c733p-1}, + {-0x1.53e7d5845fe3dp220, 0x1.385d92ec0c734p-1, 0x1.385d92ec0c733p-1}, + {0x1.59p-20, 0x1.fffffffffe2f1p-1, 0x1.fffffffffe2fp-1}, + {-0x1.59p-20, 0x1.fffffffffe2f1p-1, 0x1.fffffffffe2fp-1}, + {0x1.592f1176f098p86, -0x1.ffd7bc28ded92p-1, -0x1.ffd7bc28ded91p-1}, + {-0x1.592f1176f098p86, -0x1.ffd7bc28ded92p-1, -0x1.ffd7bc28ded91p-1}, + {0x1.5999999dc09dcp1, -0x1.cee28b3d79799p-1, -0x1.cee28b3d7979ap-1}, + {-0x1.5999999dc09dcp1, -0x1.cee28b3d79799p-1, -0x1.cee28b3d7979ap-1}, + {0x1.5bea01p468, 0x1.c1f1eb08c2604p-1, 0x1.c1f1eb08c2605p-1}, + {-0x1.5bea01p468, 0x1.c1f1eb08c2604p-1, 0x1.c1f1eb08c2605p-1}, + {0x1.5cb80a6135e5ap1000, 0x1.fffe35ab09a65p-1, 0x1.fffe35ab09a66p-1}, + {-0x1.5cb80a6135e5ap1000, 0x1.fffe35ab09a65p-1, 0x1.fffe35ab09a66p-1}, + {0x1.5d5be48730d2dp13, -0x1.07b85f606e75dp-3, -0x1.07b85f606e75ep-3}, + {-0x1.5d5be48730d2dp13, -0x1.07b85f606e75dp-3, -0x1.07b85f606e75ep-3}, + {0x1.614p-21, 0x1.ffffffffff862p-1, 0x1.ffffffffff863p-1}, + {-0x1.614p-21, 0x1.ffffffffff862p-1, 0x1.ffffffffff863p-1}, + {0x1.62adc8a660364p1, -0x1.dd3a806e89cf2p-1, -0x1.dd3a806e89cf1p-1}, + {-0x1.62adc8a660364p1, -0x1.dd3a806e89cf2p-1, -0x1.dd3a806e89cf1p-1}, + {0x1.64ef438p142, -0x1.4308b14f4b6eep-1, -0x1.4308b14f4b6edp-1}, + {-0x1.64ef438p142, -0x1.4308b14f4b6eep-1, -0x1.4308b14f4b6edp-1}, + {0x1.652p0, 0x1.6623d2eb6add2p-3, 0x1.6623d2eb6add1p-3}, + {-0x1.652p0, 0x1.6623d2eb6add2p-3, 0x1.6623d2eb6add1p-3}, + {0x1.65865b2cb08a2p-7, 0x1.fff832c50f472p-1, 0x1.fff832c50f471p-1}, + {-0x1.65865b2cb08a2p-7, 0x1.fff832c50f472p-1, 0x1.fff832c50f471p-1}, + {0x1.6a937daabc20ep375, 0x1.acc251be33023p-1, 0x1.acc251be33022p-1}, + {-0x1.6a937daabc20ep375, 0x1.acc251be33023p-1, 0x1.acc251be33022p-1}, + {0x1.6ac5b262ca1ffp849, -0x1.14ae72e6ba22fp-61, -0x1.14ae72e6ba22ep-61}, + {-0x1.6ac5b262ca1ffp849, -0x1.14ae72e6ba22fp-61, -0x1.14ae72e6ba22ep-61}, + {0x1.6f7bdef7bdef4p3, 0x1.e0619960a11c6p-2, 0x1.e0619960a11c7p-2}, + {-0x1.6f7bdef7bdef4p3, 0x1.e0619960a11c6p-2, 0x1.e0619960a11c7p-2}, + {0x1.739ce759ce738p200, 0x1.8d23f97901a3p-1, 0x1.8d23f97901a31p-1}, + {-0x1.739ce759ce738p200, 0x1.8d23f97901a3p-1, 0x1.8d23f97901a31p-1}, + {0x1.7450c3f49d0b2p-11, 0x1.fffff78a14ba1p-1, 0x1.fffff78a14bap-1}, + {-0x1.7450c3f49d0b2p-11, 0x1.fffff78a14ba1p-1, 0x1.fffff78a14bap-1}, + {0x1.749fe53f963fdp0, 0x1.d6f1c727fb2ccp-4, 0x1.d6f1c727fb2cbp-4}, + {-0x1.749fe53f963fdp0, 0x1.d6f1c727fb2ccp-4, 0x1.d6f1c727fb2cbp-4}, + {0x1.74af6725c6206p1, -0x1.f284b5028c184p-1, -0x1.f284b5028c185p-1}, + {-0x1.74af6725c6206p1, -0x1.f284b5028c184p-1, -0x1.f284b5028c185p-1}, + {0x1.7550d28ffccc4p1, -0x1.f3165a0b306b2p-1, -0x1.f3165a0b306b1p-1}, + {-0x1.7550d28ffccc4p1, -0x1.f3165a0b306b2p-1, -0x1.f3165a0b306b1p-1}, + {0x1.775e397cd6aap6, 0x1.d66d2078ebdecp-1, 0x1.d66d2078ebdebp-1}, + {-0x1.775e397cd6aap6, 0x1.d66d2078ebdecp-1, 0x1.d66d2078ebdebp-1}, + {0x1.799302bf7f29p-1, 0x1.7af9a13085f53p-1, 0x1.7af9a13085f54p-1}, + {-0x1.799302bf7f29p-1, 0x1.7af9a13085f53p-1, 0x1.7af9a13085f54p-1}, + {0x1.799fffffffffdp-6, 0x1.ffdd2fdac0c25p-1, 0x1.ffdd2fdac0c24p-1}, + {-0x1.799fffffffffdp-6, 0x1.ffdd2fdac0c25p-1, 0x1.ffdd2fdac0c24p-1}, + {0x1.7a3692ca9449p-7, 0x1.fff744f185a73p-1, 0x1.fff744f185a74p-1}, + {-0x1.7a3692ca9449p-7, 0x1.fff744f185a73p-1, 0x1.fff744f185a74p-1}, + {0x1.7a66a638ac5b5p-1, 0x1.7a6b326b690fbp-1, 0x1.7a6b326b690fap-1}, + {-0x1.7a66a638ac5b5p-1, 0x1.7a6b326b690fbp-1, 0x1.7a6b326b690fap-1}, + {0x1.7ba65462b49ap0, 0x1.671fdb64ffbeep-4, 0x1.671fdb64ffbedp-4}, + {-0x1.7ba65462b49ap0, 0x1.671fdb64ffbeep-4, 0x1.671fdb64ffbedp-4}, + {0x1.7cdf37cdf37c9p239, 0x1.ffa55490f206ep-1, 0x1.ffa55490f206fp-1}, + {-0x1.7cdf37cdf37c9p239, 0x1.ffa55490f206ep-1, 0x1.ffa55490f206fp-1}, + {0x1.7d542565f472ep0, 0x1.4c5b5970a3a49p-4, 0x1.4c5b5970a3a48p-4}, + {-0x1.7d542565f472ep0, 0x1.4c5b5970a3a49p-4, 0x1.4c5b5970a3a48p-4}, + {0x1.7da0751649058p0, 0x1.479a5667c63f6p-4, 0x1.479a5667c63f5p-4}, + {-0x1.7da0751649058p0, 0x1.479a5667c63f6p-4, 0x1.479a5667c63f5p-4}, + {0x1.7e0ddcda6cc0dp-7, 0x1.fff717511dcb5p-1, 0x1.fff717511dcb6p-1}, + {-0x1.7e0ddcda6cc0dp-7, 0x1.fff717511dcb5p-1, 0x1.fff717511dcb6p-1}, + {0x1.7f6p-21, 0x1.ffffffffff707p-1, 0x1.ffffffffff708p-1}, + {-0x1.7f6p-21, 0x1.ffffffffff707p-1, 0x1.ffffffffff708p-1}, + {0x1.7f90117d44c74p100, -0x1.fff9e1554698p-1, -0x1.fff9e15546981p-1}, + {-0x1.7f90117d44c74p100, -0x1.fff9e1554698p-1, -0x1.fff9e15546981p-1}, + {0x1.7ffffffffef7ap-6, 0x1.ffdc006bff7eap-1, 0x1.ffdc006bff7e9p-1}, + {-0x1.7ffffffffef7ap-6, 0x1.ffdc006bff7eap-1, 0x1.ffdc006bff7e9p-1}, + {0x1.7fffffffffa26p-6, 0x1.ffdc006bff7e8p-1, 0x1.ffdc006bff7e7p-1}, + {-0x1.7fffffffffa26p-6, 0x1.ffdc006bff7e8p-1, 0x1.ffdc006bff7e7p-1}, + {0x1.7ffffffffff8p-6, 0x1.ffdc006bff7e7p-1, 0x1.ffdc006bff7e6p-1}, + {-0x1.7ffffffffff8p-6, 0x1.ffdc006bff7e7p-1, 0x1.ffdc006bff7e6p-1}, + {0x1.80ep-1, 0x1.760718ab44398p-1, 0x1.760718ab44397p-1}, + {-0x1.80ep-1, 0x1.760718ab44398p-1, 0x1.760718ab44397p-1}, + {0x1.81ae0dffa3b33p959, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.81ae0dffa3b33p959, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.81d612289c5cfp1, -0x1.fbdc48125b345p-1, -0x1.fbdc48125b346p-1}, + {-0x1.81d612289c5cfp1, -0x1.fbdc48125b345p-1, -0x1.fbdc48125b346p-1}, + {0x1.8220192270a0ep0, 0x1.ff9e396651ccap-5, 0x1.ff9e396651cc9p-5}, + {-0x1.8220192270a0ep0, 0x1.ff9e396651ccap-5, 0x1.ff9e396651cc9p-5}, + {0x1.822bb780e9104p0, 0x1.fe2b26dddb5c9p-5, 0x1.fe2b26dddb5c8p-5}, + {-0x1.822bb780e9104p0, 0x1.fe2b26dddb5c9p-5, 0x1.fe2b26dddb5c8p-5}, + {0x1.82c119c4b8e49p0, 0x1.eb87cff7c9115p-5, 0x1.eb87cff7c9116p-5}, + {-0x1.82c119c4b8e49p0, 0x1.eb87cff7c9115p-5, 0x1.eb87cff7c9116p-5}, + {0x1.82c119c4b9fc4p0, 0x1.eb87cff7a62b7p-5, 0x1.eb87cff7a62b8p-5}, + {-0x1.82c119c4b9fc4p0, 0x1.eb87cff7a62b7p-5, 0x1.eb87cff7a62b8p-5}, + {0x1.82c119c4ba808p0, 0x1.eb87cff795ab1p-5, 0x1.eb87cff795ab2p-5}, + {-0x1.82c119c4ba808p0, 0x1.eb87cff795ab1p-5, 0x1.eb87cff795ab2p-5}, + {0x1.832c9fc76527p0, 0x1.de1d17ab0d6a5p-5, 0x1.de1d17ab0d6a4p-5}, + {-0x1.832c9fc76527p0, 0x1.de1d17ab0d6a5p-5, 0x1.de1d17ab0d6a4p-5}, + {0x1.833956ce7d1f9p0, 0x1.dc86e7bec0c45p-5, 0x1.dc86e7bec0c44p-5}, + {-0x1.833956ce7d1f9p0, 0x1.dc86e7bec0c45p-5, 0x1.dc86e7bec0c44p-5}, + {0x1.834574eb1c099p0, 0x1.db03cbb942a7bp-5, 0x1.db03cbb942a7ap-5}, + {-0x1.834574eb1c099p0, 0x1.db03cbb942a7bp-5, 0x1.db03cbb942a7ap-5}, + {0x1.83aba5688e13ep0, 0x1.ce431710d1507p-5, 0x1.ce431710d1508p-5}, + {-0x1.83aba5688e13ep0, 0x1.ce431710d1507p-5, 0x1.ce431710d1508p-5}, + {0x1.83b38bbafd75bp0, 0x1.cd46b3a77f6ddp-5, 0x1.cd46b3a77f6dep-5}, + {-0x1.83b38bbafd75bp0, 0x1.cd46b3a77f6ddp-5, 0x1.cd46b3a77f6dep-5}, + {0x1.86a017cb1c31cp16, -0x1.ff29bc666bee7p-1, -0x1.ff29bc666bee6p-1}, + {-0x1.86a017cb1c31cp16, -0x1.ff29bc666bee7p-1, -0x1.ff29bc666bee6p-1}, + {0x1.8720588p392, -0x1.7968916e4c646p-2, -0x1.7968916e4c647p-2}, + {-0x1.8720588p392, -0x1.7968916e4c646p-2, -0x1.7968916e4c647p-2}, + {0x1.88a2288a22888p9, 0x1.fb97c7e452918p-1, 0x1.fb97c7e452917p-1}, + {-0x1.88a2288a22888p9, 0x1.fb97c7e452918p-1, 0x1.fb97c7e452917p-1}, + {0x1.8cf013991c308p1000, -0x1.ae44a5f01bf63p-1, -0x1.ae44a5f01bf64p-1}, + {-0x1.8cf013991c308p1000, -0x1.ae44a5f01bf63p-1, -0x1.ae44a5f01bf64p-1}, + {0x1.9p-2, 0x1.d96e82f71a9dcp-1, 0x1.d96e82f71a9ddp-1}, + {-0x1.9p-2, 0x1.d96e82f71a9dcp-1, 0x1.d96e82f71a9ddp-1}, + {0x1.9p0, 0x1.0fd9d5c093df5p-7, 0x1.0fd9d5c093df4p-7}, + {-0x1.9p0, 0x1.0fd9d5c093df5p-7, 0x1.0fd9d5c093df4p-7}, + {0x1.90000000006bp0, 0x1.0fd9d5c05e5fdp-7, 0x1.0fd9d5c05e5fcp-7}, + {-0x1.90000000006bp0, 0x1.0fd9d5c05e5fdp-7, 0x1.0fd9d5c05e5fcp-7}, + {0x1.900c206d44162p6, 0x1.bc8be725417d8p-1, 0x1.bc8be725417d9p-1}, + {-0x1.900c206d44162p6, 0x1.bc8be725417d8p-1, 0x1.bc8be725417d9p-1}, + {0x1.900c2af7baef3p-19, 0x1.fffffffff63b6p-1, 0x1.fffffffff63b7p-1}, + {-0x1.900c2af7baef3p-19, 0x1.fffffffff63b6p-1, 0x1.fffffffff63b7p-1}, + {0x1.900f11bd8955dp6, 0x1.bd464c9352d11p-1, 0x1.bd464c9352d1p-1}, + {-0x1.900f11bd8955dp6, 0x1.bd464c9352d11p-1, 0x1.bd464c9352d1p-1}, + {0x1.910b35c3253d4p100, 0x1.fffffda85cdd1p-1, 0x1.fffffda85cddp-1}, + {-0x1.910b35c3253d4p100, 0x1.fffffda85cdd1p-1, 0x1.fffffda85cddp-1}, + {0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {-0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {0x1.922p0, -0x1.2aeef4b9ea1aep-18, -0x1.2aeef4b9ea1afp-18}, + {-0x1.922p0, -0x1.2aeef4b9ea1aep-18, -0x1.2aeef4b9ea1afp-18}, + {0x1.9220354442d18p0, -0x1.ffffffffd9048p-18, -0x1.ffffffffd9049p-18}, + {-0x1.9220354442d18p0, -0x1.ffffffffd9048p-18, -0x1.ffffffffd9049p-18}, + {0x1.9251f93aeb59dp12, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.9251f93aeb59dp12, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.943be221d909ap2, 0x1.ffb8c4d1f78a8p-1, 0x1.ffb8c4d1f78a9p-1}, + {-0x1.943be221d909ap2, 0x1.ffb8c4d1f78a8p-1, 0x1.ffb8c4d1f78a9p-1}, + {0x1.94af699302875p-7, 0x1.fff6011fdddabp-1, 0x1.fff6011fdddacp-1}, + {-0x1.94af699302875p-7, 0x1.fff6011fdddabp-1, 0x1.fff6011fdddacp-1}, + {0x1.999999ab7b0edp-2, 0x1.d7954e7a3ee99p-1, 0x1.d7954e7a3ee9ap-1}, + {-0x1.999999ab7b0edp-2, 0x1.d7954e7a3ee99p-1, 0x1.d7954e7a3ee9ap-1}, + {0x1.999999bd4190bp-2, 0x1.d7954e76c8e31p-1, 0x1.d7954e76c8e3p-1}, + {-0x1.999999bd4190bp-2, 0x1.d7954e76c8e31p-1, 0x1.d7954e76c8e3p-1}, + {0x1.9bd0f19479a24p2, 0x1.fa23cfb820224p-1, 0x1.fa23cfb820225p-1}, + {-0x1.9bd0f19479a24p2, 0x1.fa23cfb820224p-1, 0x1.fa23cfb820225p-1}, + {0x1.9c55835e7e83ep8, -0x1.6a09e667f3af1p-1, -0x1.6a09e667f3afp-1}, + {-0x1.9c55835e7e83ep8, -0x1.6a09e667f3af1p-1, -0x1.6a09e667f3afp-1}, + {0x1.9c9942b14448dp-7, 0x1.fff59c1255809p-1, 0x1.fff59c125580ap-1}, + {-0x1.9c9942b14448dp-7, 0x1.fff59c1255809p-1, 0x1.fff59c125580ap-1}, + {0x1.9d3d92485e2b5p523, 0x1.ffece5cab4ca5p-1, 0x1.ffece5cab4ca6p-1}, + {-0x1.9d3d92485e2b5p523, 0x1.ffece5cab4ca5p-1, 0x1.ffece5cab4ca6p-1}, + {0x1.a0d068341a08p1000, -0x1.ff55301d3a781p-5, -0x1.ff55301d3a78p-5}, + {-0x1.a0d068341a08p1000, -0x1.ff55301d3a781p-5, -0x1.ff55301d3a78p-5}, + {0x1.a7ep-1, 0x1.5a5615acd0dcp-1, 0x1.5a5615acd0dc1p-1}, + {-0x1.a7ep-1, 0x1.5a5615acd0dcp-1, 0x1.5a5615acd0dc1p-1}, + {0x1.a858343863965p119, 0x1.766ad27a1de5p-14, 0x1.766ad27a1de4fp-14}, + {-0x1.a858343863965p119, 0x1.766ad27a1de5p-14, 0x1.766ad27a1de4fp-14}, + {0x1.ab190633d88eap3, 0x1.6bd4d5be72494p-1, 0x1.6bd4d5be72493p-1}, + {-0x1.ab190633d88eap3, 0x1.6bd4d5be72494p-1, 0x1.6bd4d5be72493p-1}, + {0x1.af4bd2f4bd2fp-21, 0x1.ffffffffff4a5p-1, 0x1.ffffffffff4a6p-1}, + {-0x1.af4bd2f4bd2fp-21, 0x1.ffffffffff4a5p-1, 0x1.ffffffffff4a6p-1}, + {0x1.afa70300aee6p72, 0x1.7ff2934ad29a8p-1, 0x1.7ff2934ad29a7p-1}, + {-0x1.afa70300aee6p72, 0x1.7ff2934ad29a8p-1, 0x1.7ff2934ad29a7p-1}, + {0x1.b5ab427cffb4cp94, 0x1.ff866aebdce0ap-1, 0x1.ff866aebdce0bp-1}, + {-0x1.b5ab427cffb4cp94, 0x1.ff866aebdce0ap-1, 0x1.ff866aebdce0bp-1}, + {0x1.b951f1572eba5p23, -0x1.f54f5227a4e84p-60, -0x1.f54f5227a4e83p-60}, + {-0x1.b951f1572eba5p23, -0x1.f54f5227a4e84p-60, -0x1.f54f5227a4e83p-60}, + {0x1.b96e5b96e5b91p-8, 0x1.fffd06d35579cp-1, 0x1.fffd06d35579dp-1}, + {-0x1.b96e5b96e5b91p-8, 0x1.fffd06d35579cp-1, 0x1.fffd06d35579dp-1}, + {0x1.ba3b18395d17bp8, -0x1.7c4128e2aff4cp-1, -0x1.7c4128e2aff4bp-1}, + {-0x1.ba3b18395d17bp8, -0x1.7c4128e2aff4cp-1, -0x1.7c4128e2aff4bp-1}, + {0x1.bab62ed655019p970, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.bab62ed655019p970, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.bd55aa411ab46p-13, 0x1.ffffff3e53446p-1, 0x1.ffffff3e53447p-1}, + {-0x1.bd55aa411ab46p-13, 0x1.ffffff3e53446p-1, 0x1.ffffff3e53447p-1}, + {0x1.bd616d4fe95cdp36, -0x1.7fdb07b9f77ep-1, -0x1.7fdb07b9f77e1p-1}, + {-0x1.bd616d4fe95cdp36, -0x1.7fdb07b9f77ep-1, -0x1.7fdb07b9f77e1p-1}, + {0x1.beap-6, 0x1.ffcf4da76222dp-1, 0x1.ffcf4da76222cp-1}, + {-0x1.beap-6, 0x1.ffcf4da76222dp-1, 0x1.ffcf4da76222cp-1}, + {0x1.c11516af585a4p1, -0x1.ddee13357ec6fp-1, -0x1.ddee13357ec7p-1}, + {-0x1.c11516af585a4p1, -0x1.ddee13357ec6fp-1, -0x1.ddee13357ec7p-1}, + {0x1.c75e54de4c06ep2, 0x1.58cccec059da2p-1, 0x1.58cccec059da1p-1}, + {-0x1.c75e54de4c06ep2, 0x1.58cccec059da2p-1, 0x1.58cccec059da1p-1}, + {0x1.cb44e86bc192bp648, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.cb44e86bc192bp648, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.cb44e86bc192bp649, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.cb44e86bc192bp649, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.cd5a6f8762affp1, -0x1.ca281d7fe44bp-1, -0x1.ca281d7fe44b1p-1}, + {-0x1.cd5a6f8762affp1, -0x1.ca281d7fe44bp-1, -0x1.ca281d7fe44b1p-1}, + {0x1.d0cb95f02ad77p464, 0x1.e80ad4fe54c72p-5, 0x1.e80ad4fe54c71p-5}, + {-0x1.d0cb95f02ad77p464, 0x1.e80ad4fe54c72p-5, 0x1.e80ad4fe54c71p-5}, + {0x1.d31bd604903ap2, 0x1.0df8eb409efe4p-1, 0x1.0df8eb409efe3p-1}, + {-0x1.d31bd604903ap2, 0x1.0df8eb409efe4p-1, 0x1.0df8eb409efe3p-1}, + {0x1.d32f4610180f6p-5, 0x1.ff2ae968efe71p-1, 0x1.ff2ae968efe7p-1}, + {-0x1.d32f4610180f6p-5, 0x1.ff2ae968efe71p-1, 0x1.ff2ae968efe7p-1}, + {0x1.d96e058p488, -0x1.cec307a674d3fp-3, -0x1.cec307a674d3ep-3}, + {-0x1.d96e058p488, -0x1.cec307a674d3fp-3, -0x1.cec307a674d3ep-3}, + {0x1.db0803c392b4cp15, -0x1.ac8dbf9cdc955p-5, -0x1.ac8dbf9cdc954p-5}, + {-0x1.db0803c392b4cp15, -0x1.ac8dbf9cdc955p-5, -0x1.ac8dbf9cdc954p-5}, + {0x1.db0803c3ff51dp15, -0x1.ac94870ca6317p-5, -0x1.ac94870ca6316p-5}, + {-0x1.db0803c3ff51dp15, -0x1.ac94870ca6317p-5, -0x1.ac94870ca6316p-5}, + {0x1.dc4p-5, 0x1.ff229073fd8b6p-1, 0x1.ff229073fd8b5p-1}, + {-0x1.dc4p-5, 0x1.ff229073fd8b6p-1, 0x1.ff229073fd8b5p-1}, + {0x1.dcf73dcf73dccp-5, 0x1.ff21e5f976p-1, 0x1.ff21e5f975fffp-1}, + {-0x1.dcf73dcf73dccp-5, 0x1.ff21e5f976p-1, 0x1.ff21e5f975fffp-1}, + {0x1.dffffffffffffp-1, 0x1.2f011326420e5p-1, 0x1.2f011326420e6p-1}, + {-0x1.dffffffffffffp-1, 0x1.2f011326420e5p-1, 0x1.2f011326420e6p-1}, + {0x1.e123691a7c4bep26, 0x1.f72c8e16dbc79p-1, 0x1.f72c8e16dbc78p-1}, + {-0x1.e123691a7c4bep26, 0x1.f72c8e16dbc79p-1, 0x1.f72c8e16dbc78p-1}, + {0x1.e666666f9cf49p0, -0x1.4b0c6bb623f58p-2, -0x1.4b0c6bb623f57p-2}, + {-0x1.e666666f9cf49p0, -0x1.4b0c6bb623f58p-2, -0x1.4b0c6bb623f57p-2}, + {0x1.e83accfc50b7p995, 0x1.fd74b55875885p-1, 0x1.fd74b55875884p-1}, + {-0x1.e83accfc50b7p995, 0x1.fd74b55875885p-1, 0x1.fd74b55875884p-1}, + {0x1.e8ep-7, 0x1.fff169b6ab7d1p-1, 0x1.fff169b6ab7d2p-1}, + {-0x1.e8ep-7, 0x1.fff169b6ab7d1p-1, 0x1.fff169b6ab7d2p-1}, + {0x1.eaf5ea5317442p4, 0x1.7d39c9f1b0b3cp-1, 0x1.7d39c9f1b0b3dp-1}, + {-0x1.eaf5ea5317442p4, 0x1.7d39c9f1b0b3cp-1, 0x1.7d39c9f1b0b3dp-1}, + {0x1.eb0c2b00b1b83p4, 0x1.7f13af7081a68p-1, 0x1.7f13af7081a67p-1}, + {-0x1.eb0c2b00b1b83p4, 0x1.7f13af7081a68p-1, 0x1.7f13af7081a67p-1}, + {0x1.ebc6b555311c4p15, -0x1.7ad7b88a1fe1p-1, -0x1.7ad7b88a1fe0fp-1}, + {-0x1.ebc6b555311c4p15, -0x1.7ad7b88a1fe1p-1, -0x1.7ad7b88a1fe0fp-1}, + {0x1.ef7bdef7bdef2p239, 0x1.b06b2b58a2a24p-5, 0x1.b06b2b58a2a23p-5}, + {-0x1.ef7bdef7bdef2p239, 0x1.b06b2b58a2a24p-5, 0x1.b06b2b58a2a23p-5}, + {0x1.efbbeefbbeef8p15, 0x1.fe6ded53172a7p-1, 0x1.fe6ded53172a6p-1}, + {-0x1.efbbeefbbeef8p15, 0x1.fe6ded53172a7p-1, 0x1.fe6ded53172a6p-1}, + {0x1.f07c1f07c1ef7p239, -0x1.fe2bcb87a7e16p-1, -0x1.fe2bcb87a7e15p-1}, + {-0x1.f07c1f07c1ef7p239, -0x1.fe2bcb87a7e16p-1, -0x1.fe2bcb87a7e15p-1}, + {0x1.f0f2b5e060b29p1, -0x1.79d08d6b3a883p-1, -0x1.79d08d6b3a882p-1}, + {-0x1.f0f2b5e060b29p1, -0x1.79d08d6b3a883p-1, -0x1.79d08d6b3a882p-1}, + {0x1.f4p-3, 0x1.f0d11d321178ep-1, 0x1.f0d11d321178dp-1}, + {-0x1.f4p-3, 0x1.f0d11d321178ep-1, 0x1.f0d11d321178dp-1}, + {0x1.f43d49f947e87p9, 0x1.e3ff5b15f723ep-4, 0x1.e3ff5b15f723dp-4}, + {-0x1.f43d49f947e87p9, 0x1.e3ff5b15f723ep-4, 0x1.e3ff5b15f723dp-4}, + {0x1.f7fffffffffffp1, -0x1.6636c9f6a87aap-1, -0x1.6636c9f6a87a9p-1}, + {-0x1.f7fffffffffffp1, -0x1.6636c9f6a87aap-1, -0x1.6636c9f6a87a9p-1}, + {0x1.f8fffffffffffp-6, 0x1.ffc1be3309286p-1, 0x1.ffc1be3309285p-1}, + {-0x1.f8fffffffffffp-6, 0x1.ffc1be3309286p-1, 0x1.ffc1be3309285p-1}, + {0x1.f9p-6, 0x1.ffc1be3309285p-1, 0x1.ffc1be3309286p-1}, + {-0x1.f9p-6, 0x1.ffc1be3309285p-1, 0x1.ffc1be3309286p-1}, + {0x1.fa0236523ce54p344, -0x1.fffffffcab0d6p-1, -0x1.fffffffcab0d5p-1}, + {-0x1.fa0236523ce54p344, -0x1.fffffffcab0d6p-1, -0x1.fffffffcab0d5p-1}, + {0x1.fceab54d37dap-4, 0x1.fc0d98ace2308p-1, 0x1.fc0d98ace2309p-1}, + {-0x1.fceab54d37dap-4, 0x1.fc0d98ace2308p-1, 0x1.fc0d98ace2309p-1}, + {0x1.fd0072fffffffp2, -0x1.9589bca128b92p-4, -0x1.9589bca128b91p-4}, + {-0x1.fd0072fffffffp2, -0x1.9589bca128b92p-4, -0x1.9589bca128b91p-4}, + {0x1.fe0f827673422p62, -0x1.4d304b07fc898p-2, -0x1.4d304b07fc897p-2}, + {-0x1.fe0f827673422p62, -0x1.4d304b07fc898p-2, -0x1.4d304b07fc897p-2}, + {0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {-0x1.feb1f7920e248p-2, 0x1.c1a27ae836f13p-1, 0x1.c1a27ae836f12p-1}, + {0x1.feeffffffffc6p995, -0x1.936b64e955979p-1, -0x1.936b64e955978p-1}, + {-0x1.feeffffffffc6p995, -0x1.936b64e955979p-1, -0x1.936b64e955978p-1}, + {0x1.ff8ffffffffffp-7, 0x1.fff007147ea57p-1, 0x1.fff007147ea58p-1}, + {-0x1.ff8ffffffffffp-7, 0x1.fff007147ea57p-1, 0x1.fff007147ea58p-1}, + {0x1.ff8ffffffffffp-10, 0x1.ffffc01bfe443p-1, 0x1.ffffc01bfe442p-1}, + {-0x1.ff8ffffffffffp-10, 0x1.ffffc01bfe443p-1, 0x1.ffffc01bfe442p-1}, + {0x1.ff8ffffffffffp870, 0x1.7cc9fb75317aep-1, 0x1.7cc9fb75317afp-1}, + {-0x1.ff8ffffffffffp870, 0x1.7cc9fb75317aep-1, 0x1.7cc9fb75317afp-1}, + {0x1.ffcfff8p19, 0x1.d6aea48015589p-1, 0x1.d6aea48015588p-1}, + {-0x1.ffcfff8p19, 0x1.d6aea48015589p-1, 0x1.d6aea48015588p-1}, + {0x1.ffcfff8p365, -0x1.6a9972eee19bbp-2, -0x1.6a9972eee19bap-2}, + {-0x1.ffcfff8p365, -0x1.6a9972eee19bbp-2, -0x1.6a9972eee19bap-2}, + {0x1.ffcffffffff6cp720, -0x1.3aaa15f7544b7p-1, -0x1.3aaa15f7544b6p-1}, + {-0x1.ffcffffffff6cp720, -0x1.3aaa15f7544b7p-1, -0x1.3aaa15f7544b6p-1}, + {0x1.ffcfffffffff9p320, 0x1.3f164bce055c5p-1, 0x1.3f164bce055c4p-1}, + {-0x1.ffcfffffffff9p320, 0x1.3f164bce055c5p-1, 0x1.3f164bce055c4p-1}, + {0x1.ffcffffffffffp-11, 0x1.fffff002fff15p-1, 0x1.fffff002fff14p-1}, + {-0x1.ffcffffffffffp-11, 0x1.fffff002fff15p-1, 0x1.fffff002fff14p-1}, + {0x1.ffcffffffffffp405, -0x1.ffffff987f986p-1, -0x1.ffffff987f985p-1}, + {-0x1.ffcffffffffffp405, -0x1.ffffff987f986p-1, -0x1.ffffff987f985p-1}, + {0x1.ffcffffffffffp567, -0x1.ffff6235a25eep-1, -0x1.ffff6235a25edp-1}, + {-0x1.ffcffffffffffp567, -0x1.ffff6235a25eep-1, -0x1.ffff6235a25edp-1}, + {0x1.ffefff8ffffffp16, 0x1.fdf11ae4608b1p-3, 0x1.fdf11ae4608bp-3}, + {-0x1.ffefff8ffffffp16, 0x1.fdf11ae4608b1p-3, 0x1.fdf11ae4608bp-3}, + {0x1.ffeffffffffccp995, 0x1.8f5525ab4583cp-1, 0x1.8f5525ab4583dp-1}, + {-0x1.ffeffffffffccp995, 0x1.8f5525ab4583cp-1, 0x1.8f5525ab4583dp-1}, + {0x1.ffeffffffffffp77, 0x1.a0af44a45c057p-8, 0x1.a0af44a45c056p-8}, + {-0x1.ffeffffffffffp77, 0x1.a0af44a45c057p-8, 0x1.a0af44a45c056p-8}, + {0x1.ffeffffffffffp122, -0x1.df7546c31bf8dp-1, -0x1.df7546c31bf8cp-1}, + {-0x1.ffeffffffffffp122, -0x1.df7546c31bf8dp-1, -0x1.df7546c31bf8cp-1}, + {0x1.ffeffffffffffp179, -0x1.825a7bea27d5bp-1, -0x1.825a7bea27d5cp-1}, + {-0x1.ffeffffffffffp179, -0x1.825a7bea27d5bp-1, -0x1.825a7bea27d5cp-1}, + {0x1.ffeffffffffffp238, -0x1.1be2ab2078d54p-1, -0x1.1be2ab2078d55p-1}, + {-0x1.ffeffffffffffp238, -0x1.1be2ab2078d54p-1, -0x1.1be2ab2078d55p-1}, + {0x1.fff0000002511p492, -0x1.a4cc5f838f529p-7, -0x1.a4cc5f838f52ap-7}, + {-0x1.fff0000002511p492, -0x1.a4cc5f838f529p-7, -0x1.a4cc5f838f52ap-7}, + {0x1.fff1fffffffffp41, 0x1.f16437d6119f9p-10, 0x1.f16437d6119f8p-10}, + {-0x1.fff1fffffffffp41, 0x1.f16437d6119f9p-10, 0x1.f16437d6119f8p-10}, + {0x1.ffffc7fffffffp45, 0x1.898324c2f1cfcp-11, 0x1.898324c2f1cfdp-11}, + {-0x1.ffffc7fffffffp45, 0x1.898324c2f1cfcp-11, 0x1.898324c2f1cfdp-11}, + {0x1.ffffdf1ffffffp-3, 0x1.f0154c00688f8p-1, 0x1.f0154c00688f9p-1}, + {-0x1.ffffdf1ffffffp-3, 0x1.f0154c00688f8p-1, 0x1.f0154c00688f9p-1}, + {0x1.fffff8fffffffp-6, 0x1.ffc00157126a8p-1, 0x1.ffc00157126a7p-1}, + {-0x1.fffff8fffffffp-6, 0x1.ffc00157126a8p-1, 0x1.ffc00157126a7p-1}, + {0x1.fffffbfffffffp968, -0x1.e0d9f0f38c73fp-2, -0x1.e0d9f0f38c74p-2}, + {-0x1.fffffbfffffffp968, -0x1.e0d9f0f38c73fp-2, -0x1.e0d9f0f38c74p-2}, + {0x1.fffffcfffffffp40, 0x1.fff4699dd560bp-1, 0x1.fff4699dd560cp-1}, + {-0x1.fffffcfffffffp40, 0x1.fff4699dd560bp-1, 0x1.fff4699dd560cp-1}, + {0x1.ffffff000004p-5, 0x1.ff0015559f228p-1, 0x1.ff0015559f229p-1}, + {-0x1.ffffff000004p-5, 0x1.ff0015559f228p-1, 0x1.ff0015559f229p-1}, + {0x1.ffffff8p119, -0x1.9c6951cccd39cp-2, -0x1.9c6951cccd39bp-2}, + {-0x1.ffffff8p119, -0x1.9c6951cccd39cp-2, -0x1.9c6951cccd39bp-2}, + {0x1.ffffff8p192, -0x1.f2c2263590035p-1, -0x1.f2c2263590034p-1}, + {-0x1.ffffff8p192, -0x1.f2c2263590035p-1, -0x1.f2c2263590034p-1}, + {0x1.ffffff8p543, 0x1.c7884d6cfb551p-1, 0x1.c7884d6cfb552p-1}, + {-0x1.ffffff8p543, 0x1.c7884d6cfb551p-1, 0x1.c7884d6cfb552p-1}, + {0x1.ffffffc3fffffp500, 0x1.e66c79e776a1fp-2, 0x1.e66c79e776a1ep-2}, + {-0x1.ffffffc3fffffp500, 0x1.e66c79e776a1fp-2, 0x1.e66c79e776a1ep-2}, + {0x1.ffffffe1fffffp700, 0x1.c7c9a9c57c0b2p-3, 0x1.c7c9a9c57c0b3p-3}, + {-0x1.ffffffe1fffffp700, 0x1.c7c9a9c57c0b2p-3, 0x1.c7c9a9c57c0b3p-3}, + {0x1.ffffffff0f0ffp400, 0x1.7bb28daf5f9aep-1, 0x1.7bb28daf5f9adp-1}, + {-0x1.ffffffff0f0ffp400, 0x1.7bb28daf5f9aep-1, 0x1.7bb28daf5f9adp-1}, + {0x1.ffffffff3ffffp-4, 0x1.fc015527d8bb3p-1, 0x1.fc015527d8bb4p-1}, + {-0x1.ffffffff3ffffp-4, 0x1.fc015527d8bb3p-1, 0x1.fc015527d8bb4p-1}, + {0x1.ffffffff8ffffp3, -0x1.ea5257eb66e3cp-1, -0x1.ea5257eb66e3bp-1}, + {-0x1.ffffffff8ffffp3, -0x1.ea5257eb66e3cp-1, -0x1.ea5257eb66e3bp-1}, + {0x1.fffffffffbcffp1, -0x1.4eaa606dbef97p-1, -0x1.4eaa606dbef96p-1}, + {-0x1.fffffffffbcffp1, -0x1.4eaa606dbef97p-1, -0x1.4eaa606dbef96p-1}, + {0x1.fffffffffe0b5p720, -0x1.fc9cd6b5f0095p-1, -0x1.fc9cd6b5f0094p-1}, + {-0x1.fffffffffe0b5p720, -0x1.fc9cd6b5f0095p-1, -0x1.fc9cd6b5f0094p-1}, + {0x1.fffffffffe7ffp41, 0x1.e96ac045dd139p-3, 0x1.e96ac045dd138p-3}, + {-0x1.fffffffffe7ffp41, 0x1.e96ac045dd139p-3, 0x1.e96ac045dd138p-3}, + {0x1.fffffffffee09p720, -0x1.fcaf39cfb94d5p-1, -0x1.fcaf39cfb94d4p-1}, + {-0x1.fffffffffee09p720, -0x1.fcaf39cfb94d5p-1, -0x1.fcaf39cfb94d4p-1}, + {0x1.ffffffffffdffp40, 0x1.8432232a6d1dap-1, 0x1.8432232a6d1dbp-1}, + {-0x1.ffffffffffdffp40, 0x1.8432232a6d1dap-1, 0x1.8432232a6d1dbp-1}, + {0x1.ffffffffffeffp41, 0x1.9e375143139dap-6, 0x1.9e375143139d9p-6}, + {-0x1.ffffffffffeffp41, 0x1.9e375143139dap-6, 0x1.9e375143139d9p-6}, + {0x1.fffffffffff4ap-8, 0x1.fffc000155552p-1, 0x1.fffc000155553p-1}, + {-0x1.fffffffffff4ap-8, 0x1.fffc000155552p-1, 0x1.fffc000155553p-1}, + {0x1.fffffffffff78p920, 0x1.463a895c4ea5dp-1, 0x1.463a895c4ea5cp-1}, + {-0x1.fffffffffff78p920, 0x1.463a895c4ea5dp-1, 0x1.463a895c4ea5cp-1}, + {0x1.fffffffffffd5p995, 0x1.3c1a48635cf38p-1, 0x1.3c1a48635cf39p-1}, + {-0x1.fffffffffffd5p995, 0x1.3c1a48635cf38p-1, 0x1.3c1a48635cf39p-1}, + {0x1.fffffffffffe8p720, 0x1.91c4e0708bd48p-1, 0x1.91c4e0708bd49p-1}, + {-0x1.fffffffffffe8p720, 0x1.91c4e0708bd48p-1, 0x1.91c4e0708bd49p-1}, + {0x1.fffffffffffebp920, -0x1.3e15cb849b5eap-1, -0x1.3e15cb849b5ebp-1}, + {-0x1.fffffffffffebp920, -0x1.3e15cb849b5eap-1, -0x1.3e15cb849b5ebp-1}, + {0x1.ffffffffffff1p245, -0x1.816808349b80ep-1, -0x1.816808349b80dp-1}, + {-0x1.ffffffffffff1p245, -0x1.816808349b80ep-1, -0x1.816808349b80dp-1}, + {0x1.ffffffffffff4p845, 0x1.4699c814c5f07p-1, 0x1.4699c814c5f08p-1}, + {-0x1.ffffffffffff4p845, 0x1.4699c814c5f07p-1, 0x1.4699c814c5f08p-1}, + {0x1.ffffffffffff4p1020, -0x1.815e92b7a2a01p-1, -0x1.815e92b7a2a02p-1}, + {-0x1.ffffffffffff4p1020, -0x1.815e92b7a2a01p-1, -0x1.815e92b7a2a02p-1}, + {0x1.ffffffffffffcp45, -0x1.3e8d028153202p-10, -0x1.3e8d028153201p-10}, + {-0x1.ffffffffffffcp45, -0x1.3e8d028153202p-10, -0x1.3e8d028153201p-10}, + {0x1.ffffffffffffep105, 0x1.7d6765714c786p-1, 0x1.7d6765714c785p-1}, + {-0x1.ffffffffffffep105, 0x1.7d6765714c786p-1, 0x1.7d6765714c785p-1}, + {0x1.ffffffffffffep480, -0x1.f869fb14d2569p-3, -0x1.f869fb14d2568p-3}, + {-0x1.ffffffffffffep480, -0x1.f869fb14d2569p-3, -0x1.f869fb14d2568p-3}, + {0x1.ffffffffffffep970, -0x1.80a75b369d3c4p-1, -0x1.80a75b369d3c3p-1}, + {-0x1.ffffffffffffep970, -0x1.80a75b369d3c4p-1, -0x1.80a75b369d3c3p-1}, + {0x1.0000000000001p42, -0x1.9dba69e853bd8p-4, -0x1.9dba69e853bd7p-4}, + {-0x1.0000000000001p42, -0x1.9dba69e853bd8p-4, -0x1.9dba69e853bd7p-4}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.999999999999ap-13, 0x1.ffffff5c28f5dp-1, 0x1.ffffff5c28f5cp-1}, + {-0x1.999999999999ap-13, 0x1.ffffff5c28f5dp-1, 0x1.ffffff5c28f5cp-1}, + {0x1.999999999999ap-12, 0x1.fffffd70a3d79p-1, 0x1.fffffd70a3d7ap-1}, + {-0x1.999999999999ap-12, 0x1.fffffd70a3d79p-1, 0x1.fffffd70a3d7ap-1}, + {0x1.3333333333334p-11, 0x1.fffffa3d70a6ap-1, 0x1.fffffa3d70a69p-1}, + {-0x1.3333333333334p-11, 0x1.fffffa3d70a6ap-1, 0x1.fffffa3d70a69p-1}, + {0x1.999999999999ap-11, 0x1.fffff5c28f64ep-1, 0x1.fffff5c28f64fp-1}, + {-0x1.999999999999ap-11, 0x1.fffff5c28f64ep-1, 0x1.fffff5c28f64fp-1}, + {0x1.0p-10, 0x1.fffff00000155p-1, 0x1.fffff00000156p-1}, + {-0x1.0p-10, 0x1.fffff00000155p-1, 0x1.fffff00000156p-1}, + {0x1.3333333333333p-10, 0x1.ffffe8f5c2bbap-1, 0x1.ffffe8f5c2bb9p-1}, + {-0x1.3333333333333p-10, 0x1.ffffe8f5c2bbap-1, 0x1.ffffe8f5c2bb9p-1}, + {0x1.6666666666666p-10, 0x1.ffffe0a3d75c3p-1, 0x1.ffffe0a3d75c4p-1}, + {-0x1.6666666666666p-10, 0x1.ffffe0a3d75c3p-1, 0x1.ffffe0a3d75c4p-1}, + {0x1.9999999999999p-10, 0x1.ffffd70a3dfc7p-1, 0x1.ffffd70a3dfc8p-1}, + {-0x1.9999999999999p-10, 0x1.ffffd70a3dfc7p-1, 0x1.ffffd70a3dfc8p-1}, + {0x1.cccccccccccccp-10, 0x1.ffffcc28f6a28p-1, 0x1.ffffcc28f6a29p-1}, + {-0x1.cccccccccccccp-10, 0x1.ffffcc28f6a28p-1, 0x1.ffffcc28f6a29p-1}, + {0x1.0666666666666p-7, 0x1.fffbcc2a6e87p-1, 0x1.fffbcc2a6e86fp-1}, + {-0x1.0666666666666p-7, 0x1.fffbcc2a6e87p-1, 0x1.fffbcc2a6e86fp-1}, + {0x1.cccccccccccccp-7, 0x1.fff30a4b6fcc1p-1, 0x1.fff30a4b6fcc2p-1}, + {-0x1.cccccccccccccp-7, 0x1.fff30a4b6fcc1p-1, 0x1.fff30a4b6fcc2p-1}, + {0x1.4999999999999p-6, 0x1.ffe57a780f38cp-1, 0x1.ffe57a780f38dp-1}, + {-0x1.4999999999999p-6, 0x1.ffe57a780f38cp-1, 0x1.ffe57a780f38dp-1}, + {0x1.accccccccccccp-6, 0x1.ffd31cd0e1d63p-1, 0x1.ffd31cd0e1d62p-1}, + {-0x1.accccccccccccp-6, 0x1.ffd31cd0e1d63p-1, 0x1.ffd31cd0e1d62p-1}, + {0x1.08p-5, 0x1.ffbbf18207543p-1, 0x1.ffbbf18207542p-1}, + {-0x1.08p-5, 0x1.ffbbf18207543p-1, 0x1.ffbbf18207542p-1}, + {0x1.399999999999ap-5, 0x1.ff9ff8c3299f5p-1, 0x1.ff9ff8c3299f6p-1}, + {-0x1.399999999999ap-5, 0x1.ff9ff8c3299f5p-1, 0x1.ff9ff8c3299f6p-1}, + {0x1.6b33333333334p-5, 0x1.ff7f32d77c5b2p-1, 0x1.ff7f32d77c5b1p-1}, + {-0x1.6b33333333334p-5, 0x1.ff7f32d77c5b2p-1, 0x1.ff7f32d77c5b1p-1}, + {0x1.9cccccccccccep-5, 0x1.ff59a00dbc409p-1, 0x1.ff59a00dbc408p-1}, + {-0x1.9cccccccccccep-5, 0x1.ff59a00dbc409p-1, 0x1.ff59a00dbc408p-1}, + {0x1.ce66666666666p-5, 0x1.ff2f40c02e60fp-1, 0x1.ff2f40c02e61p-1}, + {-0x1.ce66666666666p-5, 0x1.ff2f40c02e60fp-1, 0x1.ff2f40c02e61p-1}, + {0x1.5e7fc4369bdadp-1, 0x1.8ca46c7d8975ep-1, 0x1.8ca46c7d8975fp-1}, + {-0x1.5e7fc4369bdadp-1, 0x1.8ca46c7d8975ep-1, 0x1.8ca46c7d8975fp-1}, + {0x1.4e7fc4369bdadp0, 0x1.0b5d3802fc799p-2, 0x1.0b5d3802fc79ap-2}, + {-0x1.4e7fc4369bdadp0, 0x1.0b5d3802fc799p-2, 0x1.0b5d3802fc79ap-2}, + {0x1.edbfa651e9c84p0, -0x1.66b96f53323afp-2, -0x1.66b96f53323bp-2}, + {-0x1.edbfa651e9c84p0, -0x1.66b96f53323afp-2, -0x1.66b96f53323bp-2}, + {0x1.467fc4369bdadp1, -0x1.a93554888c33p-1, -0x1.a93554888c32fp-1}, + {-0x1.467fc4369bdadp1, -0x1.a93554888c33p-1, -0x1.a93554888c32fp-1}, + {0x1.961fb54442d18p1, -0x1.ffc00155527d3p-1, -0x1.ffc00155527d2p-1}, + {-0x1.961fb54442d18p1, -0x1.ffc00155527d3p-1, -0x1.ffc00155527d2p-1}, + {0x1.e5bfa651e9c83p1, -0x1.96907c5c7c25cp-1, -0x1.96907c5c7c25bp-1}, + {-0x1.e5bfa651e9c83p1, -0x1.96907c5c7c25cp-1, -0x1.96907c5c7c25bp-1}, + {0x1.1aafcbafc85f7p2, -0x1.2a1e5a50f948dp-2, -0x1.2a1e5a50f948cp-2}, + {-0x1.1aafcbafc85f7p2, -0x1.2a1e5a50f948dp-2, -0x1.2a1e5a50f948cp-2}, + {0x1.427fc4369bdadp2, 0x1.4894f695dc56cp-2, 0x1.4894f695dc56bp-2}, + {-0x1.427fc4369bdadp2, 0x1.4894f695dc56cp-2, 0x1.4894f695dc56bp-2}, + {0x1.6a4fbcbd6f562p2, 0x1.a016ea3a692cep-1, 0x1.a016ea3a692cfp-1}, + {-0x1.6a4fbcbd6f562p2, 0x1.a016ea3a692cep-1, 0x1.a016ea3a692cfp-1}, + {0x1.6af2eff0a2896p2, 0x1.a30a69f5537ecp-1, 0x1.a30a69f5537ebp-1}, + {-0x1.6af2eff0a2896p2, 0x1.a30a69f5537ecp-1, 0x1.a30a69f5537ebp-1}, + {0x1.43c62a9d02414p2, 0x1.5bd62e8b04ad6p-2, 0x1.5bd62e8b04ad5p-2}, + {-0x1.43c62a9d02414p2, 0x1.5bd62e8b04ad6p-2, 0x1.5bd62e8b04ad5p-2}, + {0x1.1c99654961f92p2, -0x1.0cb71f671e634p-2, -0x1.0cb71f671e635p-2}, + {-0x1.1c99654961f92p2, -0x1.0cb71f671e634p-2, -0x1.0cb71f671e635p-2}, + {0x1.ead93feb8361fp1, -0x1.89d86aa8521c1p-1, -0x1.89d86aa8521c2p-1}, + {-0x1.ead93feb8361fp1, -0x1.89d86aa8521c1p-1, -0x1.89d86aa8521c2p-1}, + {0x1.9c7fb54442d1ap1, -0x1.fe51ac554a16bp-1, -0x1.fe51ac554a16ap-1}, + {-0x1.9c7fb54442d1ap1, -0x1.fe51ac554a16bp-1, -0x1.fe51ac554a16ap-1}, + {0x1.4e262a9d02415p1, -0x1.b97c04d08bc5dp-1, -0x1.b97c04d08bc5ep-1}, + {-0x1.4e262a9d02415p1, -0x1.b97c04d08bc5dp-1, -0x1.b97c04d08bc5ep-1}, + {0x1.ff993feb8362p0, -0x1.a8ac8a3e58f6dp-2, -0x1.a8ac8a3e58f6cp-2}, + {-0x1.ff993feb8362p0, -0x1.a8ac8a3e58f6dp-2, -0x1.a8ac8a3e58f6cp-2}, + {0x1.62e62a9d02416p0, 0x1.77a8b9b3d254bp-3, 0x1.77a8b9b3d254ap-3}, + {-0x1.62e62a9d02416p0, 0x1.77a8b9b3d254bp-3, 0x1.77a8b9b3d254ap-3}, + {0x1.8c662a9d02419p-1, 0x1.6e1061205dd79p-1, 0x1.6e1061205dd7ap-1}, + {-0x1.8c662a9d02419p-1, 0x1.6e1061205dd79p-1, 0x1.6e1061205dd7ap-1}, + {-0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {-0x1.95ec8b9e03d54p0, -0x1.e6669a270c36dp-7, -0x1.e6669a270c36ep-7}, + {0x1.95ec8b9e03d54p0, -0x1.e6669a270c36dp-7, -0x1.e6669a270c36ep-7}, + {-0x1.832efa2a435a9p0, 0x1.ddd1ec25e209fp-5, 0x1.ddd1ec25e20ap-5}, + {0x1.832efa2a435a9p0, 0x1.ddd1ec25e209fp-5, 0x1.ddd1ec25e20ap-5}, + {-0x1.707168b682dfep0, 0x1.0cab9115640dap-3, 0x1.0cab9115640d9p-3}, + {0x1.707168b682dfep0, 0x1.0cab9115640dap-3, 0x1.0cab9115640d9p-3}, + {-0x1.5db3d742c2653p0, 0x1.a0723a95492eep-3, 0x1.a0723a95492edp-3}, + {0x1.5db3d742c2653p0, 0x1.a0723a95492eep-3, 0x1.a0723a95492edp-3}, + {-0x1.4af645cf01ea8p0, 0x1.18fee96a1a586p-2, 0x1.18fee96a1a585p-2}, + {0x1.4af645cf01ea8p0, 0x1.18fee96a1a586p-2, 0x1.18fee96a1a585p-2}, + {-0x1.3838b45b416fdp0, 0x1.6043621b13be3p-2, 0x1.6043621b13be2p-2}, + {0x1.3838b45b416fdp0, 0x1.6043621b13be3p-2, 0x1.6043621b13be2p-2}, + {-0x1.257b22e780f52p0, 0x1.a5a4ccf40d9dap-2, 0x1.a5a4ccf40d9d9p-2}, + {0x1.257b22e780f52p0, 0x1.a5a4ccf40d9dap-2, 0x1.a5a4ccf40d9d9p-2}, + {-0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {-0x1.ea5c3ed5b385p-1, 0x1.26976a6c4e0f8p-1, 0x1.26976a6c4e0f9p-1}, + {0x1.ea5c3ed5b385p-1, 0x1.26976a6c4e0f8p-1, 0x1.26976a6c4e0f9p-1}, + {-0x1.d4b87dab670ap-1, 0x1.3805a1882009fp-1, 0x1.3805a188200ap-1}, + {0x1.d4b87dab670ap-1, 0x1.3805a1882009fp-1, 0x1.3805a188200ap-1}, + {-0x1.bf14bc811a8fp-1, 0x1.48e52e0a65bcbp-1, 0x1.48e52e0a65bccp-1}, + {0x1.bf14bc811a8fp-1, 0x1.48e52e0a65bcbp-1, 0x1.48e52e0a65bccp-1}, + {-0x1.a970fb56ce14p-1, 0x1.592e58ea0a9efp-1, 0x1.592e58ea0a9eep-1}, + {0x1.a970fb56ce14p-1, 0x1.592e58ea0a9efp-1, 0x1.592e58ea0a9eep-1}, + {-0x1.93cd3a2c8199p-1, 0x1.68d9afe052d1fp-1, 0x1.68d9afe052d2p-1}, + {0x1.93cd3a2c8199p-1, 0x1.68d9afe052d1fp-1, 0x1.68d9afe052d2p-1}, + {-0x1.7e297902351ep-1, 0x1.77e008d0775e7p-1, 0x1.77e008d0775e8p-1}, + {0x1.7e297902351ep-1, 0x1.77e008d0775e7p-1, 0x1.77e008d0775e8p-1}, + {-0x1.6885b7d7e8a3p-1, 0x1.863a850e438fep-1, 0x1.863a850e438ffp-1}, + {0x1.6885b7d7e8a3p-1, 0x1.863a850e438fep-1, 0x1.863a850e438ffp-1}, + {-0x1.52e1f6ad9c28p-1, 0x1.93e2948233fcep-1, 0x1.93e2948233fcfp-1}, + {0x1.52e1f6ad9c28p-1, 0x1.93e2948233fcep-1, 0x1.93e2948233fcfp-1}, + {-0x1.3d3e35834fadp-1, 0x1.a0d1f8a9a791dp-1, 0x1.a0d1f8a9a791ep-1}, + {0x1.3d3e35834fadp-1, 0x1.a0d1f8a9a791dp-1, 0x1.a0d1f8a9a791ep-1}, + {-0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {-0x1.d8f7208e6b82cp-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cfp-1}, + {0x1.d8f7208e6b82cp-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cfp-1}, + {-0x1.9dd83c7c9e126p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {0x1.9dd83c7c9e126p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {-0x1.62b9586ad0a2p-2, 0x1.e196026182986p-1, 0x1.e196026182985p-1}, + {0x1.62b9586ad0a2p-2, 0x1.e196026182986p-1, 0x1.e196026182985p-1}, + {-0x1.279a74590331ap-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {0x1.279a74590331ap-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {-0x1.d8f7208e6b829p-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {0x1.d8f7208e6b829p-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {-0x1.62b9586ad0a1ep-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {0x1.62b9586ad0a1ep-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {-0x1.d8f7208e6b826p-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {0x1.d8f7208e6b826p-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {-0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {-0x1.d8f7208e6b82dp-5, 0x1.ff259b7ab9f5p-1, 0x1.ff259b7ab9f4fp-1}, + {0x1.d8f7208e6b82dp-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {-0x1.d8f7208e6b82dp-4, 0x1.fc97283a42479p-1, 0x1.fc97283a4247ap-1}, + {0x1.62b9586ad0a22p-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {-0x1.62b9586ad0a22p-3, 0x1.f856d48db797ep-1, 0x1.f856d48db797dp-1}, + {0x1.d8f7208e6b82dp-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {-0x1.d8f7208e6b82dp-3, 0x1.f26840e7b2189p-1, 0x1.f26840e7b2188p-1}, + {0x1.279a74590331cp-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {-0x1.279a74590331cp-2, 0x1.ead07cc635696p-1, 0x1.ead07cc635697p-1}, + {0x1.62b9586ad0a22p-2, 0x1.e196026182985p-1, 0x1.e196026182986p-1}, + {-0x1.62b9586ad0a22p-2, 0x1.e196026182985p-1, 0x1.e196026182986p-1}, + {0x1.9dd83c7c9e128p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {-0x1.9dd83c7c9e128p-2, 0x1.d6c0b125791dp-1, 0x1.d6c0b125791cfp-1}, + {0x1.d8f7208e6b82ep-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cdp-1}, + {-0x1.d8f7208e6b82ep-2, 0x1.ca59c6fa3d9cep-1, 0x1.ca59c6fa3d9cdp-1}, + {0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {-0x1.0a0b02501c799p-1, 0x1.bc6bd861e13dep-1, 0x1.bc6bd861e13dfp-1}, + {0x1.3d3e35834faccp-1, 0x1.a0d1f8a9a792p-1, 0x1.a0d1f8a9a791fp-1}, + {-0x1.3d3e35834faccp-1, 0x1.a0d1f8a9a792p-1, 0x1.a0d1f8a9a791fp-1}, + {0x1.52e1f6ad9c27cp-1, 0x1.93e2948233fd1p-1, 0x1.93e2948233fdp-1}, + {-0x1.52e1f6ad9c27cp-1, 0x1.93e2948233fd1p-1, 0x1.93e2948233fdp-1}, + {0x1.6885b7d7e8a2cp-1, 0x1.863a850e439p-1, 0x1.863a850e43901p-1}, + {-0x1.6885b7d7e8a2cp-1, 0x1.863a850e439p-1, 0x1.863a850e43901p-1}, + {0x1.7e297902351dcp-1, 0x1.77e008d0775eap-1, 0x1.77e008d0775e9p-1}, + {-0x1.7e297902351dcp-1, 0x1.77e008d0775eap-1, 0x1.77e008d0775e9p-1}, + {0x1.93cd3a2c8198cp-1, 0x1.68d9afe052d22p-1, 0x1.68d9afe052d21p-1}, + {-0x1.93cd3a2c8198cp-1, 0x1.68d9afe052d22p-1, 0x1.68d9afe052d21p-1}, + {0x1.a970fb56ce13cp-1, 0x1.592e58ea0a9f2p-1, 0x1.592e58ea0a9f1p-1}, + {-0x1.a970fb56ce13cp-1, 0x1.592e58ea0a9f2p-1, 0x1.592e58ea0a9f1p-1}, + {0x1.bf14bc811a8ecp-1, 0x1.48e52e0a65bcep-1, 0x1.48e52e0a65bcfp-1}, + {-0x1.bf14bc811a8ecp-1, 0x1.48e52e0a65bcep-1, 0x1.48e52e0a65bcfp-1}, + {0x1.d4b87dab6709cp-1, 0x1.3805a188200a2p-1, 0x1.3805a188200a3p-1}, + {-0x1.d4b87dab6709cp-1, 0x1.3805a188200a2p-1, 0x1.3805a188200a3p-1}, + {0x1.ea5c3ed5b384cp-1, 0x1.26976a6c4e0fcp-1, 0x1.26976a6c4e0fbp-1}, + {-0x1.ea5c3ed5b384cp-1, 0x1.26976a6c4e0fcp-1, 0x1.26976a6c4e0fbp-1}, + {0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {-0x1.12bd9173c07abp0, 0x1.e8c405f36f85cp-2, 0x1.e8c405f36f85bp-2}, + {0x1.257b22e780f56p0, 0x1.a5a4ccf40d9cbp-2, 0x1.a5a4ccf40d9ccp-2}, + {-0x1.257b22e780f56p0, 0x1.a5a4ccf40d9cbp-2, 0x1.a5a4ccf40d9ccp-2}, + {0x1.3838b45b41701p0, 0x1.6043621b13bd4p-2, 0x1.6043621b13bd3p-2}, + {-0x1.3838b45b41701p0, 0x1.6043621b13bd4p-2, 0x1.6043621b13bd3p-2}, + {0x1.4af645cf01eacp0, 0x1.18fee96a1a576p-2, 0x1.18fee96a1a577p-2}, + {-0x1.4af645cf01eacp0, 0x1.18fee96a1a576p-2, 0x1.18fee96a1a577p-2}, + {0x1.5db3d742c2657p0, 0x1.a0723a95492cfp-3, 0x1.a0723a95492cep-3}, + {-0x1.5db3d742c2657p0, 0x1.a0723a95492cfp-3, 0x1.a0723a95492cep-3}, + {0x1.707168b682e02p0, 0x1.0cab9115640bap-3, 0x1.0cab9115640b9p-3}, + {-0x1.707168b682e02p0, 0x1.0cab9115640bap-3, 0x1.0cab9115640b9p-3}, + {0x1.832efa2a435adp0, 0x1.ddd1ec25e201fp-5, 0x1.ddd1ec25e202p-5}, + {-0x1.832efa2a435adp0, 0x1.ddd1ec25e201fp-5, 0x1.ddd1ec25e202p-5}, + {0x1.95ec8b9e03d58p0, -0x1.e6669a270c56dp-7, -0x1.e6669a270c56ep-7}, + {-0x1.95ec8b9e03d58p0, -0x1.e6669a270c56dp-7, -0x1.e6669a270c56ep-7}, + {0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {-0x1.a8aa1d11c44ffp0, -0x1.682f3cc3c7a09p-4, -0x1.682f3cc3c7a08p-4}, + {0x1.04aff6d330942p0, 0x1.0cb3469a29ea6p-1, 0x1.0cb3469a29ea7p-1}, + {-0x1.04aff6d330942p0, 0x1.0cb3469a29ea6p-1, 0x1.0cb3469a29ea7p-1}, + {0x1.04b09e98dcdb4p0, 0x1.0cb228fa7f811p-1, 0x1.0cb228fa7f812p-1}, + {-0x1.04b09e98dcdb4p0, 0x1.0cb228fa7f811p-1, 0x1.0cb228fa7f812p-1}, + {0x1.04b1465e89226p0, 0x1.0cb10b5a61b06p-1, 0x1.0cb10b5a61b05p-1}, + {-0x1.04b1465e89226p0, 0x1.0cb10b5a61b06p-1, 0x1.0cb10b5a61b05p-1}, + {0x1.04b1ee2435698p0, 0x1.0cafedb9d078bp-1, 0x1.0cafedb9d078ap-1}, + {-0x1.04b1ee2435698p0, 0x1.0cafedb9d078bp-1, 0x1.0cafedb9d078ap-1}, + {0x1.04b295e9e1b0ap0, 0x1.0caed018cbda8p-1, 0x1.0caed018cbda7p-1}, + {-0x1.04b295e9e1b0ap0, 0x1.0caed018cbda8p-1, 0x1.0caed018cbda7p-1}, + {0x1.04b33daf8df7cp0, 0x1.0cadb27753d65p-1, 0x1.0cadb27753d66p-1}, + {-0x1.04b33daf8df7cp0, 0x1.0cadb27753d65p-1, 0x1.0cadb27753d66p-1}, + {0x1.04b3e5753a3eep0, 0x1.0cac94d5686cbp-1, 0x1.0cac94d5686cap-1}, + {-0x1.04b3e5753a3eep0, 0x1.0cac94d5686cbp-1, 0x1.0cac94d5686cap-1}, + {0x1.04b48d3ae686p0, 0x1.0cab7733099dfp-1, 0x1.0cab7733099ep-1}, + {-0x1.04b48d3ae686p0, 0x1.0cab7733099dfp-1, 0x1.0cab7733099ep-1}, + {0x1.04b5350092ccfp0, 0x1.0caa5990376bp-1, 0x1.0caa5990376b1p-1}, + {-0x1.04b5350092ccfp0, 0x1.0caa5990376bp-1, 0x1.0caa5990376b1p-1}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.279a74590331bp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35eep-1}, + {-0x1.279a74590331bp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35eep-1}, + {0x1.279a74590331cp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35ecp-1}, + {-0x1.279a74590331cp-1, 0x1.ad02c771c35edp-1, 0x1.ad02c771c35ecp-1}, + {0x1.279a74590331dp-1, 0x1.ad02c771c35ecp-1, 0x1.ad02c771c35edp-1}, + {-0x1.279a74590331dp-1, 0x1.ad02c771c35ecp-1, 0x1.ad02c771c35edp-1}, + {0x1.bb67ae8584ca9p0, -0x1.48d1ddd2b2b4p-3, -0x1.48d1ddd2b2b3fp-3}, + {-0x1.bb67ae8584ca9p0, -0x1.48d1ddd2b2b4p-3, -0x1.48d1ddd2b2b3fp-3}, + {0x1.bb67ae8584caap0, -0x1.48d1ddd2b2b47p-3, -0x1.48d1ddd2b2b48p-3}, + {-0x1.bb67ae8584caap0, -0x1.48d1ddd2b2b47p-3, -0x1.48d1ddd2b2b48p-3}, + {0x1.bb67ae8584cabp0, -0x1.48d1ddd2b2b4fp-3, -0x1.48d1ddd2b2b5p-3}, + {-0x1.bb67ae8584cabp0, -0x1.48d1ddd2b2b4fp-3, -0x1.48d1ddd2b2b5p-3}, + {0x1.bffffffffffffp-2, 0x1.cfc6cfa52adap-1, 0x1.cfc6cfa52ad9fp-1}, + {-0x1.bffffffffffffp-2, 0x1.cfc6cfa52adap-1, 0x1.cfc6cfa52ad9fp-1}, + {0x1.cp-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {-0x1.cp-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {0x1.c000000000001p-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {-0x1.c000000000001p-2, 0x1.cfc6cfa52ad9fp-1, 0x1.cfc6cfa52adap-1}, + {0x1.5ffffffffffffp-1, 0x1.8bb105a5dc901p-1, 0x1.8bb105a5dc902p-1}, + {-0x1.5ffffffffffffp-1, 0x1.8bb105a5dc901p-1, 0x1.8bb105a5dc902p-1}, + {0x1.6p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc901p-1}, + {-0x1.6p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc901p-1}, + {0x1.6000000000001p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc8ffp-1}, + {-0x1.6000000000001p-1, 0x1.8bb105a5dc9p-1, 0x1.8bb105a5dc8ffp-1}, + {0x1.2ffffffffffffp0, 0x1.7ef4842f0bcd1p-2, 0x1.7ef4842f0bcd2p-2}, + {-0x1.2ffffffffffffp0, 0x1.7ef4842f0bcd1p-2, 0x1.7ef4842f0bcd2p-2}, + {0x1.3p0, 0x1.7ef4842f0bccdp-2, 0x1.7ef4842f0bccep-2}, + {-0x1.3p0, 0x1.7ef4842f0bccdp-2, 0x1.7ef4842f0bccep-2}, + {0x1.3000000000001p0, 0x1.7ef4842f0bccap-2, 0x1.7ef4842f0bcc9p-2}, + {-0x1.3000000000001p0, 0x1.7ef4842f0bccap-2, 0x1.7ef4842f0bcc9p-2}, + {0x1.37fffffffffffp1, -0x1.863efa361dc22p-1, -0x1.863efa361dc23p-1}, + {-0x1.37fffffffffffp1, -0x1.863efa361dc22p-1, -0x1.863efa361dc23p-1}, + {0x1.38p1, -0x1.863efa361dc25p-1, -0x1.863efa361dc26p-1}, + {-0x1.38p1, -0x1.863efa361dc25p-1, -0x1.863efa361dc26p-1}, + {0x1.3800000000001p1, -0x1.863efa361dc28p-1, -0x1.863efa361dc27p-1}, + {-0x1.3800000000001p1, -0x1.863efa361dc28p-1, -0x1.863efa361dc27p-1}, + {0x1.069c8b46b3792p-4, 0x1.fef2b2d21cf6cp-1, 0x1.fef2b2d21cf6dp-1}, + {-0x1.069c8b46b3792p-4, 0x1.fef2b2d21cf6cp-1, 0x1.fef2b2d21cf6dp-1}, + {0x1.069c8b46b3792p-3, 0x1.fbcbe693bd8edp-1, 0x1.fbcbe693bd8ecp-1}, + {-0x1.069c8b46b3792p-3, 0x1.fbcbe693bd8edp-1, 0x1.fbcbe693bd8ecp-1}, + {0x1.89ead0ea0d35bp-3, 0x1.f68eebfcbb5e8p-1, 0x1.f68eebfcbb5e9p-1}, + {-0x1.89ead0ea0d35bp-3, 0x1.f68eebfcbb5e8p-1, 0x1.f68eebfcbb5e9p-1}, + {0x1.069c8b46b3792p-2, 0x1.ef4145b4aedp-1, 0x1.ef4145b4aecffp-1}, + {-0x1.069c8b46b3792p-2, 0x1.ef4145b4aedp-1, 0x1.ef4145b4aecffp-1}, + {0x1.4843ae1860576p-2, 0x1.e5eaa286fbbc6p-1, 0x1.e5eaa286fbbc7p-1}, + {-0x1.4843ae1860576p-2, 0x1.e5eaa286fbbc6p-1, 0x1.e5eaa286fbbc7p-1}, + {0x1.89ead0ea0d35ap-2, 0x1.da94d54dd4c08p-1, 0x1.da94d54dd4c09p-1}, + {-0x1.89ead0ea0d35ap-2, 0x1.da94d54dd4c08p-1, 0x1.da94d54dd4c09p-1}, + {0x1.cb91f3bbba13ep-2, 0x1.cd4bca9cb5c71p-1, 0x1.cd4bca9cb5c72p-1}, + {-0x1.cb91f3bbba13ep-2, 0x1.cd4bca9cb5c71p-1, 0x1.cd4bca9cb5c72p-1}, + {0x1.069c8b46b3791p-1, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c41p-1}, + {-0x1.069c8b46b3791p-1, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c41p-1}, + {0x1.27701caf89e83p-1, 0x1.ad19e2535aa96p-1, 0x1.ad19e2535aa97p-1}, + {-0x1.27701caf89e83p-1, 0x1.ad19e2535aa96p-1, 0x1.ad19e2535aa97p-1}, + {0x1.4843ae1860575p-1, 0x1.9a52e2e0fbcb4p-1, 0x1.9a52e2e0fbcb3p-1}, + {-0x1.4843ae1860575p-1, 0x1.9a52e2e0fbcb4p-1, 0x1.9a52e2e0fbcb3p-1}, + {0x1.69173f8136c67p-1, 0x1.85dc3ea1bbceap-1, 0x1.85dc3ea1bbce9p-1}, + {-0x1.69173f8136c67p-1, 0x1.85dc3ea1bbceap-1, 0x1.85dc3ea1bbce9p-1}, + {0x1.89ead0ea0d359p-1, 0x1.6fcb7c6b8b91ap-1, 0x1.6fcb7c6b8b919p-1}, + {-0x1.89ead0ea0d359p-1, 0x1.6fcb7c6b8b91ap-1, 0x1.6fcb7c6b8b919p-1}, + {0x1.aabe6252e3a4bp-1, 0x1.5837d2817cf3p-1, 0x1.5837d2817cf31p-1}, + {-0x1.aabe6252e3a4bp-1, 0x1.5837d2817cf3p-1, 0x1.5837d2817cf31p-1}, + {0x1.cb91f3bbba13dp-1, 0x1.3f3a0e28bedd4p-1, 0x1.3f3a0e28bedd5p-1}, + {-0x1.cb91f3bbba13dp-1, 0x1.3f3a0e28bedd4p-1, 0x1.3f3a0e28bedd5p-1}, + {0x1.ec6585249082fp-1, 0x1.24ec799171643p-1, 0x1.24ec799171642p-1}, + {-0x1.ec6585249082fp-1, 0x1.24ec799171643p-1, 0x1.24ec799171642p-1}, + {0x1.069c8b46b3791p0, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {-0x1.069c8b46b3791p0, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {0x1.170653fb1eb0ap0, 0x1.d9a3a336edb76p-2, 0x1.d9a3a336edb77p-2}, + {-0x1.170653fb1eb0ap0, 0x1.d9a3a336edb76p-2, 0x1.d9a3a336edb77p-2}, + {0x1.27701caf89e83p0, 0x1.9e7f8652b4758p-2, 0x1.9e7f8652b4759p-2}, + {-0x1.27701caf89e83p0, 0x1.9e7f8652b4758p-2, 0x1.9e7f8652b4759p-2}, + {0x1.37d9e563f51fcp0, 0x1.61a76077aee08p-2, 0x1.61a76077aee07p-2}, + {-0x1.37d9e563f51fcp0, 0x1.61a76077aee08p-2, 0x1.61a76077aee07p-2}, + {0x1.4843ae1860575p0, 0x1.235b331d8f749p-2, 0x1.235b331d8f748p-2}, + {-0x1.4843ae1860575p0, 0x1.235b331d8f749p-2, 0x1.235b331d8f748p-2}, + {0x1.58ad76cccb8eep0, 0x1.c7b90e3024594p-3, 0x1.c7b90e3024593p-3}, + {-0x1.58ad76cccb8eep0, 0x1.c7b90e3024594p-3, 0x1.c7b90e3024593p-3}, + {0x1.69173f8136c67p0, 0x1.46dc4f4ce83dap-3, 0x1.46dc4f4ce83dbp-3}, + {-0x1.69173f8136c67p0, 0x1.46dc4f4ce83dap-3, 0x1.46dc4f4ce83dbp-3}, + {0x1.79810835a1fep0, 0x1.894f70befbb9ap-4, 0x1.894f70befbb99p-4}, + {-0x1.79810835a1fep0, 0x1.894f70befbb9ap-4, 0x1.894f70befbb99p-4}, + {0x1.89ead0ea0d359p0, 0x1.069107ae9333p-5, 0x1.069107ae9332fp-5}, + {-0x1.89ead0ea0d359p0, 0x1.069107ae9333p-5, 0x1.069107ae9332fp-5}, + {0x1.9a54999e786d2p0, -0x1.069107ae9327ep-5, -0x1.069107ae9327fp-5}, + {-0x1.9a54999e786d2p0, -0x1.069107ae9327ep-5, -0x1.069107ae9327fp-5}, + {0x1.aabe6252e3a4bp0, -0x1.894f70befbb41p-4, -0x1.894f70befbb42p-4}, + {-0x1.aabe6252e3a4bp0, -0x1.894f70befbb41p-4, -0x1.894f70befbb42p-4}, + {0x1.bb282b074edc4p0, -0x1.46dc4f4ce83afp-3, -0x1.46dc4f4ce83aep-3}, + {-0x1.bb282b074edc4p0, -0x1.46dc4f4ce83afp-3, -0x1.46dc4f4ce83aep-3}, + {0x1.cb91f3bbba13dp0, -0x1.c7b90e3024569p-3, -0x1.c7b90e3024568p-3}, + {-0x1.cb91f3bbba13dp0, -0x1.c7b90e3024569p-3, -0x1.c7b90e3024568p-3}, + {0x1.dbfbbc70254b6p0, -0x1.235b331d8f734p-2, -0x1.235b331d8f733p-2}, + {-0x1.dbfbbc70254b6p0, -0x1.235b331d8f734p-2, -0x1.235b331d8f733p-2}, + {0x1.ec6585249082fp0, -0x1.61a76077aedf3p-2, -0x1.61a76077aedf2p-2}, + {-0x1.ec6585249082fp0, -0x1.61a76077aedf3p-2, -0x1.61a76077aedf2p-2}, + {0x1.fccf4dd8fbba8p0, -0x1.9e7f8652b4744p-2, -0x1.9e7f8652b4743p-2}, + {-0x1.fccf4dd8fbba8p0, -0x1.9e7f8652b4744p-2, -0x1.9e7f8652b4743p-2}, + {0x1.069c8b46b3791p1, -0x1.d9a3a336edb66p-2, -0x1.d9a3a336edb65p-2}, + {-0x1.069c8b46b3791p1, -0x1.d9a3a336edb66p-2, -0x1.d9a3a336edb65p-2}, + {0x1.0ed16fa0e914ep1, -0x1.096ac02ec42c2p-1, -0x1.096ac02ec42c3p-1}, + {-0x1.0ed16fa0e914ep1, -0x1.096ac02ec42c2p-1, -0x1.096ac02ec42c3p-1}, + {0x1.170653fb1eb0bp1, -0x1.24ec79917163ep-1, -0x1.24ec79917163dp-1}, + {-0x1.170653fb1eb0bp1, -0x1.24ec79917163ep-1, -0x1.24ec79917163dp-1}, + {0x1.1f3b3855544c8p1, -0x1.3f3a0e28bedd1p-1, -0x1.3f3a0e28beddp-1}, + {-0x1.1f3b3855544c8p1, -0x1.3f3a0e28bedd1p-1, -0x1.3f3a0e28beddp-1}, + {0x1.27701caf89e85p1, -0x1.5837d2817cf2fp-1, -0x1.5837d2817cf2ep-1}, + {-0x1.27701caf89e85p1, -0x1.5837d2817cf2fp-1, -0x1.5837d2817cf2ep-1}, + {0x1.2fa50109bf842p1, -0x1.6fcb7c6b8b91ap-1, -0x1.6fcb7c6b8b919p-1}, + {-0x1.2fa50109bf842p1, -0x1.6fcb7c6b8b91ap-1, -0x1.6fcb7c6b8b919p-1}, + {0x1.37d9e563f51ffp1, -0x1.85dc3ea1bbcebp-1, -0x1.85dc3ea1bbceap-1}, + {-0x1.37d9e563f51ffp1, -0x1.85dc3ea1bbcebp-1, -0x1.85dc3ea1bbceap-1}, + {0x1.400ec9be2abbcp1, -0x1.9a52e2e0fbcb6p-1, -0x1.9a52e2e0fbcb5p-1}, + {-0x1.400ec9be2abbcp1, -0x1.9a52e2e0fbcb6p-1, -0x1.9a52e2e0fbcb5p-1}, + {0x1.4843ae1860579p1, -0x1.ad19e2535aa9ap-1, -0x1.ad19e2535aa99p-1}, + {-0x1.4843ae1860579p1, -0x1.ad19e2535aa9ap-1, -0x1.ad19e2535aa99p-1}, + {0x1.5078927295f36p1, -0x1.be1d7c3534c44p-1, -0x1.be1d7c3534c45p-1}, + {-0x1.5078927295f36p1, -0x1.be1d7c3534c44p-1, -0x1.be1d7c3534c45p-1}, + {0x1.58ad76cccb8f3p1, -0x1.cd4bca9cb5c76p-1, -0x1.cd4bca9cb5c75p-1}, + {-0x1.58ad76cccb8f3p1, -0x1.cd4bca9cb5c76p-1, -0x1.cd4bca9cb5c75p-1}, + {0x1.60e25b27012bp1, -0x1.da94d54dd4c0dp-1, -0x1.da94d54dd4c0cp-1}, + {-0x1.60e25b27012bp1, -0x1.da94d54dd4c0dp-1, -0x1.da94d54dd4c0cp-1}, + {0x1.69173f8136c6dp1, -0x1.e5eaa286fbbcbp-1, -0x1.e5eaa286fbbcap-1}, + {-0x1.69173f8136c6dp1, -0x1.e5eaa286fbbcbp-1, -0x1.e5eaa286fbbcap-1}, + {0x1.714c23db6c62ap1, -0x1.ef4145b4aed04p-1, -0x1.ef4145b4aed03p-1}, + {-0x1.714c23db6c62ap1, -0x1.ef4145b4aed04p-1, -0x1.ef4145b4aed03p-1}, + {0x1.79810835a1fe7p1, -0x1.f68eebfcbb5ecp-1, -0x1.f68eebfcbb5ebp-1}, + {-0x1.79810835a1fe7p1, -0x1.f68eebfcbb5ecp-1, -0x1.f68eebfcbb5ebp-1}, + {0x1.81b5ec8fd79a4p1, -0x1.fbcbe693bd8efp-1, -0x1.fbcbe693bd8fp-1}, + {-0x1.81b5ec8fd79a4p1, -0x1.fbcbe693bd8efp-1, -0x1.fbcbe693bd8fp-1}, + {0x1.89ead0ea0d35bp1, -0x1.fef2b2d21cf6cp-1, -0x1.fef2b2d21cf6bp-1}, + {-0x1.89ead0ea0d35bp1, -0x1.fef2b2d21cf6cp-1, -0x1.fef2b2d21cf6bp-1}, + {-0x1.81b5ec8fd799fp2, 0x1.ef4145b4aecffp-1, 0x1.ef4145b4aedp-1}, + {0x1.81b5ec8fd799fp2, 0x1.ef4145b4aecffp-1, 0x1.ef4145b4aedp-1}, + {-0x1.714c23db6c626p2, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c3fp-1}, + {0x1.714c23db6c626p2, 0x1.be1d7c3534c4p-1, 0x1.be1d7c3534c3fp-1}, + {-0x1.60e25b27012adp2, 0x1.6fcb7c6b8b919p-1, 0x1.6fcb7c6b8b918p-1}, + {0x1.60e25b27012adp2, 0x1.6fcb7c6b8b919p-1, 0x1.6fcb7c6b8b918p-1}, + {-0x1.5078927295f34p2, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {0x1.5078927295f34p2, 0x1.096ac02ec42c8p-1, 0x1.096ac02ec42c9p-1}, + {-0x1.400ec9be2abbbp2, 0x1.235b331d8f748p-2, 0x1.235b331d8f749p-2}, + {0x1.400ec9be2abbbp2, 0x1.235b331d8f748p-2, 0x1.235b331d8f749p-2}, + {-0x1.2fa50109bf842p2, 0x1.069107ae9332cp-5, 0x1.069107ae9332dp-5}, + {0x1.2fa50109bf842p2, 0x1.069107ae9332cp-5, 0x1.069107ae9332dp-5}, + {-0x1.1f3b3855544c9p2, -0x1.c7b90e3024569p-3, -0x1.c7b90e302456ap-3}, + {0x1.1f3b3855544c9p2, -0x1.c7b90e3024569p-3, -0x1.c7b90e302456ap-3}, + {-0x1.0ed16fa0e915p2, -0x1.d9a3a336edb63p-2, -0x1.d9a3a336edb62p-2}, + {0x1.0ed16fa0e915p2, -0x1.d9a3a336edb63p-2, -0x1.d9a3a336edb62p-2}, + {-0x1.fccf4dd8fbbaep1, -0x1.5837d2817cf28p-1, -0x1.5837d2817cf27p-1}, + {0x1.fccf4dd8fbbaep1, -0x1.5837d2817cf28p-1, -0x1.5837d2817cf27p-1}, + {-0x1.dbfbbc70254bcp1, -0x1.ad19e2535aa9p-1, -0x1.ad19e2535aa8fp-1}, + {0x1.dbfbbc70254bcp1, -0x1.ad19e2535aa9p-1, -0x1.ad19e2535aa8fp-1}, + {-0x1.bb282b074edcap1, -0x1.e5eaa286fbbc3p-1, -0x1.e5eaa286fbbc2p-1}, + {0x1.bb282b074edcap1, -0x1.e5eaa286fbbc3p-1, -0x1.e5eaa286fbbc2p-1}, + {-0x1.9a54999e786d8p1, -0x1.fef2b2d21cf6bp-1, -0x1.fef2b2d21cf6cp-1}, + {0x1.9a54999e786d8p1, -0x1.fef2b2d21cf6bp-1, -0x1.fef2b2d21cf6cp-1}, + {-0x1.79810835a1fe6p1, -0x1.f68eebfcbb5ebp-1, -0x1.f68eebfcbb5eap-1}, + {0x1.79810835a1fe6p1, -0x1.f68eebfcbb5ebp-1, -0x1.f68eebfcbb5eap-1}, + {-0x1.58ad76cccb8f4p1, -0x1.cd4bca9cb5c77p-1, -0x1.cd4bca9cb5c78p-1}, + {0x1.58ad76cccb8f4p1, -0x1.cd4bca9cb5c77p-1, -0x1.cd4bca9cb5c78p-1}, + {-0x1.37d9e563f5202p1, -0x1.85dc3ea1bbcf3p-1, -0x1.85dc3ea1bbcf2p-1}, + {0x1.37d9e563f5202p1, -0x1.85dc3ea1bbcf3p-1, -0x1.85dc3ea1bbcf2p-1}, + {-0x1.170653fb1eb1p1, -0x1.24ec79917164ep-1, -0x1.24ec79917164fp-1}, + {0x1.170653fb1eb1p1, -0x1.24ec79917164ep-1, -0x1.24ec79917164fp-1}, + {-0x1.ec6585249083cp0, -0x1.61a76077aee24p-2, -0x1.61a76077aee23p-2}, + {0x1.ec6585249083cp0, -0x1.61a76077aee24p-2, -0x1.61a76077aee23p-2}, + {-0x1.aabe6252e3a58p0, -0x1.894f70befbc1p-4, -0x1.894f70befbc11p-4}, + {0x1.aabe6252e3a58p0, -0x1.894f70befbc1p-4, -0x1.894f70befbc11p-4}, + {-0x1.69173f8136c74p0, 0x1.46dc4f4ce8374p-3, 0x1.46dc4f4ce8373p-3}, + {0x1.69173f8136c74p0, 0x1.46dc4f4ce8374p-3, 0x1.46dc4f4ce8373p-3}, + {-0x1.27701caf89e9p0, 0x1.9e7f8652b4729p-2, 0x1.9e7f8652b4728p-2}, + {0x1.27701caf89e9p0, 0x1.9e7f8652b4729p-2, 0x1.9e7f8652b4728p-2}, + {-0x1.cb91f3bbba157p-1, 0x1.3f3a0e28bedcp-1, 0x1.3f3a0e28bedbfp-1}, + {0x1.cb91f3bbba157p-1, 0x1.3f3a0e28bedcp-1, 0x1.3f3a0e28bedbfp-1}, + {-0x1.4843ae186058ep-1, 0x1.9a52e2e0fbca5p-1, 0x1.9a52e2e0fbca4p-1}, + {0x1.4843ae186058ep-1, 0x1.9a52e2e0fbca5p-1, 0x1.9a52e2e0fbca4p-1}, + {-0x1.89ead0ea0d38ap-2, 0x1.da94d54dd4bffp-1, 0x1.da94d54dd4cp-1}, + {0x1.89ead0ea0d38ap-2, 0x1.da94d54dd4bffp-1, 0x1.da94d54dd4cp-1}, + {-0x1.069c8b46b37fp-3, 0x1.fbcbe693bd8eap-1, 0x1.fbcbe693bd8e9p-1}, + {0x1.069c8b46b37fp-3, 0x1.fbcbe693bd8eap-1, 0x1.fbcbe693bd8e9p-1}, + {0x1.069c8b46b3734p-3, 0x1.fbcbe693bd8fp-1, 0x1.fbcbe693bd8efp-1}, + {-0x1.069c8b46b3734p-3, 0x1.fbcbe693bd8fp-1, 0x1.fbcbe693bd8efp-1}, + {0x1.89ead0ea0d32cp-2, 0x1.da94d54dd4c11p-1, 0x1.da94d54dd4c12p-1}, + {-0x1.89ead0ea0d32cp-2, 0x1.da94d54dd4c11p-1, 0x1.da94d54dd4c12p-1}, + {0x1.4843ae186055fp-1, 0x1.9a52e2e0fbcc1p-1, 0x1.9a52e2e0fbccp-1}, + {-0x1.4843ae186055fp-1, 0x1.9a52e2e0fbcc1p-1, 0x1.9a52e2e0fbccp-1}, + {0x1.cb91f3bbba128p-1, 0x1.3f3a0e28bede4p-1, 0x1.3f3a0e28bede5p-1}, + {-0x1.cb91f3bbba128p-1, 0x1.3f3a0e28bede4p-1, 0x1.3f3a0e28bede5p-1}, + {0x1.27701caf89e78p0, 0x1.9e7f8652b478p-2, 0x1.9e7f8652b4781p-2}, + {-0x1.27701caf89e78p0, 0x1.9e7f8652b478p-2, 0x1.9e7f8652b4781p-2}, + {0x1.69173f8136c5cp0, 0x1.46dc4f4ce8431p-3, 0x1.46dc4f4ce8432p-3}, + {-0x1.69173f8136c5cp0, 0x1.46dc4f4ce8431p-3, 0x1.46dc4f4ce8432p-3}, + {0x1.aabe6252e3a4p0, -0x1.894f70befba92p-4, -0x1.894f70befba93p-4}, + {-0x1.aabe6252e3a4p0, -0x1.894f70befba92p-4, -0x1.894f70befba93p-4}, + {0x1.ec65852490824p0, -0x1.61a76077aedcap-2, -0x1.61a76077aedc9p-2}, + {-0x1.ec65852490824p0, -0x1.61a76077aedcap-2, -0x1.61a76077aedc9p-2}, + {0x1.170653fb1eb04p1, -0x1.24ec799171627p-1, -0x1.24ec799171626p-1}, + {-0x1.170653fb1eb04p1, -0x1.24ec799171627p-1, -0x1.24ec799171626p-1}, + {0x1.37d9e563f51f6p1, -0x1.85dc3ea1bbcd3p-1, -0x1.85dc3ea1bbcd4p-1}, + {-0x1.37d9e563f51f6p1, -0x1.85dc3ea1bbcd3p-1, -0x1.85dc3ea1bbcd4p-1}, + {0x1.58ad76cccb8e8p1, -0x1.cd4bca9cb5c63p-1, -0x1.cd4bca9cb5c62p-1}, + {-0x1.58ad76cccb8e8p1, -0x1.cd4bca9cb5c63p-1, -0x1.cd4bca9cb5c62p-1}, + {0x1.79810835a1fdap1, -0x1.f68eebfcbb5e2p-1, -0x1.f68eebfcbb5e1p-1}, + {-0x1.79810835a1fdap1, -0x1.f68eebfcbb5e2p-1, -0x1.f68eebfcbb5e1p-1}, + {0x1.9a54999e786ccp1, -0x1.fef2b2d21cf6ep-1, -0x1.fef2b2d21cf6fp-1}, + {-0x1.9a54999e786ccp1, -0x1.fef2b2d21cf6ep-1, -0x1.fef2b2d21cf6fp-1}, + {0x1.bb282b074edbep1, -0x1.e5eaa286fbbd2p-1, -0x1.e5eaa286fbbd1p-1}, + {-0x1.bb282b074edbep1, -0x1.e5eaa286fbbd2p-1, -0x1.e5eaa286fbbd1p-1}, + {0x1.dbfbbc70254bp1, -0x1.ad19e2535aaaap-1, -0x1.ad19e2535aaabp-1}, + {-0x1.dbfbbc70254bp1, -0x1.ad19e2535aaaap-1, -0x1.ad19e2535aaabp-1}, + {0x1.fccf4dd8fbba2p1, -0x1.5837d2817cf4bp-1, -0x1.5837d2817cf4ap-1}, + {-0x1.fccf4dd8fbba2p1, -0x1.5837d2817cf4bp-1, -0x1.5837d2817cf4ap-1}, + {0x1.0ed16fa0e914ap2, -0x1.d9a3a336edbb8p-2, -0x1.d9a3a336edbb7p-2}, + {-0x1.0ed16fa0e914ap2, -0x1.d9a3a336edbb8p-2, -0x1.d9a3a336edbb7p-2}, + {0x1.1f3b3855544c3p2, -0x1.c7b90e3024625p-3, -0x1.c7b90e3024624p-3}, + {-0x1.1f3b3855544c3p2, -0x1.c7b90e3024625p-3, -0x1.c7b90e3024624p-3}, + {0x1.2fa50109bf83cp2, 0x1.069107ae9302dp-5, 0x1.069107ae9302cp-5}, + {-0x1.2fa50109bf83cp2, 0x1.069107ae9302dp-5, 0x1.069107ae9302cp-5}, + {0x1.400ec9be2abb5p2, 0x1.235b331d8f6ecp-2, 0x1.235b331d8f6edp-2}, + {-0x1.400ec9be2abb5p2, 0x1.235b331d8f6ecp-2, 0x1.235b331d8f6edp-2}, + {0x1.5078927295f2ep2, 0x1.096ac02ec429fp-1, 0x1.096ac02ec42ap-1}, + {-0x1.5078927295f2ep2, 0x1.096ac02ec429fp-1, 0x1.096ac02ec42ap-1}, + {0x1.60e25b27012a7p2, 0x1.6fcb7c6b8b8f7p-1, 0x1.6fcb7c6b8b8f8p-1}, + {-0x1.60e25b27012a7p2, 0x1.6fcb7c6b8b8f7p-1, 0x1.6fcb7c6b8b8f8p-1}, + {0x1.714c23db6c62p2, 0x1.be1d7c3534c28p-1, 0x1.be1d7c3534c29p-1}, + {-0x1.714c23db6c62p2, 0x1.be1d7c3534c28p-1, 0x1.be1d7c3534c29p-1}, + {0x1.81b5ec8fd7999p2, 0x1.ef4145b4aecf3p-1, 0x1.ef4145b4aecf4p-1}, + {-0x1.81b5ec8fd7999p2, 0x1.ef4145b4aecf3p-1, 0x1.ef4145b4aecf4p-1}, + {0x1.effffffffffffp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {-0x1.effffffffffffp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {0x1.fp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {-0x1.fp-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {0x1.f000000000001p-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {-0x1.f000000000001p-5, 0x1.ff0fd2c96adfcp-1, 0x1.ff0fd2c96adfbp-1}, + {0x1.f7fffffffffffp-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {-0x1.f7fffffffffffp-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {0x1.f8p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {-0x1.f8p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {0x1.f800000000001p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {-0x1.f800000000001p-4, 0x1.fc210055467fep-1, 0x1.fc210055467ffp-1}, + {0x1.4bfffffffffffp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {-0x1.4bfffffffffffp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {0x1.4cp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {-0x1.4cp-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {0x1.4c00000000001p-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {-0x1.4c00000000001p-3, 0x1.f94984b2552e2p-1, 0x1.f94984b2552e1p-1}, + {0x1.3333333333332p-2, 0x1.e921dd42f09bbp-1, 0x1.e921dd42f09bap-1}, + {-0x1.3333333333332p-2, 0x1.e921dd42f09bbp-1, 0x1.e921dd42f09bap-1}, + {0x1.3333333333333p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {-0x1.3333333333333p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {0x1.3333333333334p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {-0x1.3333333333334p-2, 0x1.e921dd42f09bap-1, 0x1.e921dd42f09bbp-1}, + {0x1.594317acc4ef8p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0fp-1}, + {-0x1.594317acc4ef8p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0fp-1}, + {0x1.594317acc4ef9p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0eep-1}, + {-0x1.594317acc4ef9p-1, 0x1.8feedb86bf0efp-1, 0x1.8feedb86bf0eep-1}, + {0x1.594317acc4efap-1, 0x1.8feedb86bf0eep-1, 0x1.8feedb86bf0edp-1}, + {-0x1.594317acc4efap-1, 0x1.8feedb86bf0eep-1, 0x1.8feedb86bf0edp-1}, + {0x1.8ffffffffffffp-1, 0x1.6b898fa9efb5ep-1, 0x1.6b898fa9efb5dp-1}, + {-0x1.8ffffffffffffp-1, 0x1.6b898fa9efb5ep-1, 0x1.6b898fa9efb5dp-1}, + {0x1.9p-1, 0x1.6b898fa9efb5dp-1, 0x1.6b898fa9efb5ep-1}, + {-0x1.9p-1, 0x1.6b898fa9efb5dp-1, 0x1.6b898fa9efb5ep-1}, + {0x1.9000000000001p-1, 0x1.6b898fa9efb5cp-1, 0x1.6b898fa9efb5dp-1}, + {-0x1.9000000000001p-1, 0x1.6b898fa9efb5cp-1, 0x1.6b898fa9efb5dp-1}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.921fb54442d17p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {-0x1.921fb54442d17p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {0x1.921fb54442d18p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {-0x1.921fb54442d18p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {0x1.921fb54442d19p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {-0x1.921fb54442d19p-5, 0x1.ff621e3796d7ep-1, 0x1.ff621e3796d7dp-1}, + {0x1.921fb54442d17p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {-0x1.921fb54442d17p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {0x1.921fb54442d18p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {-0x1.921fb54442d18p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {0x1.921fb54442d19p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {-0x1.921fb54442d19p-4, 0x1.fd88da3d12526p-1, 0x1.fd88da3d12525p-1}, + {0x1.921fb54442d17p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {-0x1.921fb54442d17p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {0x1.921fb54442d18p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {-0x1.921fb54442d18p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {0x1.921fb54442d19p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {-0x1.921fb54442d19p-3, 0x1.f6297cff75cbp-1, 0x1.f6297cff75cb1p-1}, + {0x1.921fb54442d17p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {-0x1.921fb54442d17p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {0x1.921fb54442d18p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {-0x1.921fb54442d18p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {0x1.921fb54442d19p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {-0x1.921fb54442d19p-2, 0x1.d906bcf328d46p-1, 0x1.d906bcf328d47p-1}, + {0x1.921fb54442d17p-1, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d17p-1, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcdp-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {-0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {0x1.921fb54442d19p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {-0x1.921fb54442d19p-1, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcdp-1}, + {0x1.921fb54442d17p0, 0x1.469898cc51702p-52, 0x1.469898cc51701p-52}, + {-0x1.921fb54442d17p0, 0x1.469898cc51702p-52, 0x1.469898cc51701p-52}, + {0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {-0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {0x1.921fb54442d19p0, -0x1.72cece675d1fdp-53, -0x1.72cece675d1fcp-53}, + {-0x1.921fb54442d19p0, -0x1.72cece675d1fdp-53, -0x1.72cece675d1fcp-53}, + {0x1.921fb54442d17p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p2, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p3, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p5, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p6, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d17p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d17p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.921fb54442d19p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.921fb54442d19p7, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d1p1, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {-0x1.2d97c7f3321d1p1, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {0x1.2d97c7f3321d2p1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {-0x1.2d97c7f3321d2p1, -0x1.6a09e667f3bccp-1, -0x1.6a09e667f3bcbp-1}, + {0x1.2d97c7f3321d3p1, -0x1.6a09e667f3bcfp-1, -0x1.6a09e667f3bcep-1}, + {-0x1.2d97c7f3321d3p1, -0x1.6a09e667f3bcfp-1, -0x1.6a09e667f3bcep-1}, + {0x1.f6a7a2955385dp1, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {-0x1.f6a7a2955385dp1, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {0x1.f6a7a2955385ep1, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {-0x1.f6a7a2955385ep1, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcdp-1}, + {0x1.f6a7a2955385fp1, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {-0x1.f6a7a2955385fp1, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bcap-1}, + {0x1.2d97c7f3321d1p2, -0x1.34f272993d141p-50, -0x1.34f272993d142p-50}, + {-0x1.2d97c7f3321d1p2, -0x1.34f272993d141p-50, -0x1.34f272993d142p-50}, + {0x1.2d97c7f3321d2p2, -0x1.a79394c9e8a0ap-53, -0x1.a79394c9e8a0bp-53}, + {-0x1.2d97c7f3321d2p2, -0x1.a79394c9e8a0ap-53, -0x1.a79394c9e8a0bp-53}, + {0x1.2d97c7f3321d3p2, 0x1.961b1acd85d7dp-51, 0x1.961b1acd85d7ep-51}, + {-0x1.2d97c7f3321d3p2, 0x1.961b1acd85d7dp-51, 0x1.961b1acd85d7ep-51}, + {0x1.5fdbbe9bba774p2, 0x1.6a09e667f3bc6p-1, 0x1.6a09e667f3bc5p-1}, + {-0x1.5fdbbe9bba774p2, 0x1.6a09e667f3bc6p-1, 0x1.6a09e667f3bc5p-1}, + {0x1.5fdbbe9bba775p2, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bccp-1}, + {-0x1.5fdbbe9bba775p2, 0x1.6a09e667f3bcbp-1, 0x1.6a09e667f3bccp-1}, + {0x1.5fdbbe9bba776p2, 0x1.6a09e667f3bd1p-1, 0x1.6a09e667f3bdp-1}, + {-0x1.5fdbbe9bba776p2, 0x1.6a09e667f3bd1p-1, 0x1.6a09e667f3bdp-1}, + {0x1.c463abeccb2bap2, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd3p-1}, + {-0x1.c463abeccb2bap2, 0x1.6a09e667f3bd4p-1, 0x1.6a09e667f3bd3p-1}, + {0x1.c463abeccb2bbp2, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {-0x1.c463abeccb2bbp2, 0x1.6a09e667f3bcep-1, 0x1.6a09e667f3bcfp-1}, + {0x1.c463abeccb2bcp2, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bc8p-1}, + {-0x1.c463abeccb2bcp2, 0x1.6a09e667f3bc9p-1, 0x1.6a09e667f3bc8p-1}, + {0x1.f6a7a2955385dp2, 0x1.583ebeff65cc2p-50, 0x1.583ebeff65cc3p-50}, + {-0x1.f6a7a2955385dp2, 0x1.583ebeff65cc2p-50, 0x1.583ebeff65cc3p-50}, + {0x1.f6a7a2955385ep2, 0x1.60fafbfd97309p-52, 0x1.60fafbfd97308p-52}, + {-0x1.f6a7a2955385ep2, 0x1.60fafbfd97309p-52, 0x1.60fafbfd97308p-52}, + {0x1.f6a7a2955385fp2, -0x1.4f8282013467cp-51, -0x1.4f8282013467bp-51}, + {-0x1.f6a7a2955385fp2, -0x1.4f8282013467cp-51, -0x1.4f8282013467bp-51}, + {0x1.1475cc9eedeffp3, -0x1.6a09e667f3bb9p-1, -0x1.6a09e667f3bbap-1}, + {-0x1.1475cc9eedeffp3, -0x1.6a09e667f3bb9p-1, -0x1.6a09e667f3bbap-1}, + {0x1.1475cc9eedfp3, -0x1.6a09e667f3bc5p-1, -0x1.6a09e667f3bc4p-1}, + {-0x1.1475cc9eedfp3, -0x1.6a09e667f3bc5p-1, -0x1.6a09e667f3bc4p-1}, + {0x1.1475cc9eedf01p3, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {-0x1.1475cc9eedf01p3, -0x1.6a09e667f3bdp-1, -0x1.6a09e667f3bd1p-1}, + {0x1.2d97c7f3321d1p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d1p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d2p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d2p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d3p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d3p3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.46b9c347764a2p3, -0x1.6a09e667f3bep-1, -0x1.6a09e667f3be1p-1}, + {-0x1.46b9c347764a2p3, -0x1.6a09e667f3bep-1, -0x1.6a09e667f3be1p-1}, + {0x1.46b9c347764a3p3, -0x1.6a09e667f3bd5p-1, -0x1.6a09e667f3bd4p-1}, + {-0x1.46b9c347764a3p3, -0x1.6a09e667f3bd5p-1, -0x1.6a09e667f3bd4p-1}, + {0x1.46b9c347764a4p3, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {-0x1.46b9c347764a4p3, -0x1.6a09e667f3bc9p-1, -0x1.6a09e667f3bcap-1}, + {0x1.5fdbbe9bba774p3, -0x1.3dc585b2c7422p-49, -0x1.3dc585b2c7421p-49}, + {-0x1.5fdbbe9bba774p3, -0x1.3dc585b2c7422p-49, -0x1.3dc585b2c7421p-49}, + {0x1.5fdbbe9bba775p3, -0x1.ee2c2d963a10cp-52, -0x1.ee2c2d963a10dp-52}, + {-0x1.5fdbbe9bba775p3, -0x1.ee2c2d963a10cp-52, -0x1.ee2c2d963a10dp-52}, + {0x1.5fdbbe9bba776p3, 0x1.8474f49a717bdp-50, 0x1.8474f49a717bcp-50}, + {-0x1.5fdbbe9bba776p3, 0x1.8474f49a717bdp-50, 0x1.8474f49a717bcp-50}, + {0x1.78fdb9effea45p3, 0x1.6a09e667f3bb9p-1, 0x1.6a09e667f3bb8p-1}, + {-0x1.78fdb9effea45p3, 0x1.6a09e667f3bb9p-1, 0x1.6a09e667f3bb8p-1}, + {0x1.78fdb9effea46p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc3p-1}, + {-0x1.78fdb9effea46p3, 0x1.6a09e667f3bc4p-1, 0x1.6a09e667f3bc3p-1}, + {0x1.78fdb9effea47p3, 0x1.6a09e667f3bcfp-1, 0x1.6a09e667f3bdp-1}, + {-0x1.78fdb9effea47p3, 0x1.6a09e667f3bcfp-1, 0x1.6a09e667f3bdp-1}, + {0x1.ab41b09886fe8p3, 0x1.6a09e667f3be1p-1, 0x1.6a09e667f3bep-1}, + {-0x1.ab41b09886fe8p3, 0x1.6a09e667f3be1p-1, 0x1.6a09e667f3bep-1}, + {0x1.ab41b09886fe9p3, 0x1.6a09e667f3bd6p-1, 0x1.6a09e667f3bd5p-1}, + {-0x1.ab41b09886fe9p3, 0x1.6a09e667f3bd6p-1, 0x1.6a09e667f3bd5p-1}, + {0x1.ab41b09886feap3, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.ab41b09886feap3, 0x1.6a09e667f3bcap-1, 0x1.6a09e667f3bcbp-1}, + {0x1.c463abeccb2bap3, 0x1.4f6babe5db9e2p-49, 0x1.4f6babe5db9e1p-49}, + {-0x1.c463abeccb2bap3, 0x1.4f6babe5db9e2p-49, 0x1.4f6babe5db9e1p-49}, + {0x1.c463abeccb2bbp3, 0x1.3daeaf976e788p-51, 0x1.3daeaf976e787p-51}, + {-0x1.c463abeccb2bbp3, 0x1.3daeaf976e788p-51, 0x1.3daeaf976e787p-51}, + {0x1.c463abeccb2bcp3, -0x1.6128a83448c3cp-50, -0x1.6128a83448c3dp-50}, + {-0x1.c463abeccb2bcp3, -0x1.6128a83448c3cp-50, -0x1.6128a83448c3dp-50}, + {0x1.dd85a7410f58bp3, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb7p-1}, + {-0x1.dd85a7410f58bp3, -0x1.6a09e667f3bb8p-1, -0x1.6a09e667f3bb7p-1}, + {0x1.dd85a7410f58cp3, -0x1.6a09e667f3bc3p-1, -0x1.6a09e667f3bc4p-1}, + {-0x1.dd85a7410f58cp3, -0x1.6a09e667f3bc3p-1, -0x1.6a09e667f3bc4p-1}, + {0x1.dd85a7410f58dp3, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {-0x1.dd85a7410f58dp3, -0x1.6a09e667f3bcep-1, -0x1.6a09e667f3bcfp-1}, + {0x1.f6a7a2955385dp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385dp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385ep3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385ep3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.f6a7a2955385fp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.f6a7a2955385fp3, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.07e4cef4cbd96p4, -0x1.6a09e667f3bf8p-1, -0x1.6a09e667f3bf9p-1}, + {-0x1.07e4cef4cbd96p4, -0x1.6a09e667f3bf8p-1, -0x1.6a09e667f3bf9p-1}, + {0x1.07e4cef4cbd97p4, -0x1.6a09e667f3be2p-1, -0x1.6a09e667f3be1p-1}, + {-0x1.07e4cef4cbd97p4, -0x1.6a09e667f3be2p-1, -0x1.6a09e667f3be1p-1}, + {0x1.07e4cef4cbd98p4, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bccp-1}, + {-0x1.07e4cef4cbd98p4, -0x1.6a09e667f3bcbp-1, -0x1.6a09e667f3bccp-1}, + {0x1.1475cc9eedeffp4, -0x1.b088e90c77fd1p-48, -0x1.b088e90c77fd2p-48}, + {-0x1.1475cc9eedeffp4, -0x1.b088e90c77fd1p-48, -0x1.b088e90c77fd2p-48}, + {0x1.1475cc9eedfp4, -0x1.6111d218effa2p-49, -0x1.6111d218effa3p-49}, + {-0x1.1475cc9eedfp4, -0x1.6111d218effa2p-49, -0x1.6111d218effa3p-49}, + {0x1.1475cc9eedf01p4, 0x1.3ddc5bce200bbp-50, 0x1.3ddc5bce200bcp-50}, + {-0x1.1475cc9eedf01p4, 0x1.3ddc5bce200bbp-50, 0x1.3ddc5bce200bcp-50}, + {0x1.2106ca4910068p4, 0x1.6a09e667f3bacp-1, 0x1.6a09e667f3babp-1}, + {-0x1.2106ca4910068p4, 0x1.6a09e667f3bacp-1, 0x1.6a09e667f3babp-1}, + {0x1.2106ca4910069p4, 0x1.6a09e667f3bc3p-1, 0x1.6a09e667f3bc2p-1}, + {-0x1.2106ca4910069p4, 0x1.6a09e667f3bc3p-1, 0x1.6a09e667f3bc2p-1}, + {0x1.2106ca491006ap4, 0x1.6a09e667f3bd9p-1, 0x1.6a09e667f3bdap-1}, + {-0x1.2106ca491006ap4, 0x1.6a09e667f3bd9p-1, 0x1.6a09e667f3bdap-1}, + {0x1.2d97c7f3321d1p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d1p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d2p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d2p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.2d97c7f3321d3p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.2d97c7f3321d3p4, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.3a28c59d54339p4, 0x1.6a09e667f3bf9p-1, 0x1.6a09e667f3bfap-1}, + {-0x1.3a28c59d54339p4, 0x1.6a09e667f3bf9p-1, 0x1.6a09e667f3bfap-1}, + {0x1.3a28c59d5433ap4, 0x1.6a09e667f3be2p-1, 0x1.6a09e667f3be3p-1}, + {-0x1.3a28c59d5433ap4, 0x1.6a09e667f3be2p-1, 0x1.6a09e667f3be3p-1}, + {0x1.3a28c59d5433bp4, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {-0x1.3a28c59d5433bp4, 0x1.6a09e667f3bccp-1, 0x1.6a09e667f3bcbp-1}, + {0x1.46b9c347764a2p4, 0x1.b95bfc26022b1p-48, 0x1.b95bfc26022b2p-48}, + {-0x1.46b9c347764a2p4, 0x1.b95bfc26022b1p-48, 0x1.b95bfc26022b2p-48}, + {0x1.46b9c347764a3p4, 0x1.72b7f84c04563p-49, 0x1.72b7f84c04562p-49}, + {-0x1.46b9c347764a3p4, 0x1.72b7f84c04563p-49, 0x1.72b7f84c04562p-49}, + {0x1.46b9c347764a4p4, -0x1.1a900f67f753ap-50, -0x1.1a900f67f753bp-50}, + {-0x1.46b9c347764a4p4, -0x1.1a900f67f753ap-50, -0x1.1a900f67f753bp-50}, + {0x1.534ac0f19860bp4, -0x1.6a09e667f3babp-1, -0x1.6a09e667f3bacp-1}, + {-0x1.534ac0f19860bp4, -0x1.6a09e667f3babp-1, -0x1.6a09e667f3bacp-1}, + {0x1.534ac0f19860cp4, -0x1.6a09e667f3bc2p-1, -0x1.6a09e667f3bc1p-1}, + {-0x1.534ac0f19860cp4, -0x1.6a09e667f3bc2p-1, -0x1.6a09e667f3bc1p-1}, + {0x1.534ac0f19860dp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd9p-1}, + {-0x1.534ac0f19860dp4, -0x1.6a09e667f3bd8p-1, -0x1.6a09e667f3bd9p-1}, + {0x1.5fdbbe9bba774p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba774p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba775p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba775p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.5fdbbe9bba776p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.5fdbbe9bba776p4, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.6c6cbc45dc8dcp4, -0x1.6a09e667f3bfap-1, -0x1.6a09e667f3bf9p-1}, + {-0x1.6c6cbc45dc8dcp4, -0x1.6a09e667f3bfap-1, -0x1.6a09e667f3bf9p-1}, + {0x1.6c6cbc45dc8ddp4, -0x1.6a09e667f3be3p-1, -0x1.6a09e667f3be4p-1}, + {-0x1.6c6cbc45dc8ddp4, -0x1.6a09e667f3be3p-1, -0x1.6a09e667f3be4p-1}, + {0x1.6c6cbc45dc8dep4, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bccp-1}, + {-0x1.6c6cbc45dc8dep4, -0x1.6a09e667f3bcdp-1, -0x1.6a09e667f3bccp-1}, + {0x1.78fdb9effea45p4, -0x1.c22f0f3f8c592p-48, -0x1.c22f0f3f8c591p-48}, + {-0x1.78fdb9effea45p4, -0x1.c22f0f3f8c592p-48, -0x1.c22f0f3f8c591p-48}, + {0x1.78fdb9effea46p4, -0x1.845e1e7f18b23p-49, -0x1.845e1e7f18b24p-49}, + {-0x1.78fdb9effea46p4, -0x1.845e1e7f18b23p-49, -0x1.845e1e7f18b24p-49}, + {0x1.78fdb9effea47p4, 0x1.ee8786039d373p-51, 0x1.ee8786039d374p-51}, + {-0x1.78fdb9effea47p4, 0x1.ee8786039d373p-51, 0x1.ee8786039d374p-51}, + {0x1.858eb79a20baep4, 0x1.6a09e667f3baap-1, 0x1.6a09e667f3babp-1}, + {-0x1.858eb79a20baep4, 0x1.6a09e667f3baap-1, 0x1.6a09e667f3babp-1}, + {0x1.858eb79a20bafp4, 0x1.6a09e667f3bc1p-1, 0x1.6a09e667f3bcp-1}, + {-0x1.858eb79a20bafp4, 0x1.6a09e667f3bc1p-1, 0x1.6a09e667f3bcp-1}, + {0x1.858eb79a20bbp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd7p-1}, + {-0x1.858eb79a20bbp4, 0x1.6a09e667f3bd8p-1, 0x1.6a09e667f3bd7p-1}, + {0x1.fffffffffffffp62, -0x1.2ccaf641d4262p-3, -0x1.2ccaf641d4261p-3}, + {-0x1.fffffffffffffp62, -0x1.2ccaf641d4262p-3, -0x1.2ccaf641d4261p-3}, + {0x1.0p63, 0x1.82aa375b3c33ep-7, 0x1.82aa375b3c33fp-7}, + {-0x1.0p63, 0x1.82aa375b3c33ep-7, 0x1.82aa375b3c33fp-7}, + {0x1.0000000000001p63, 0x1.4c0622a6e35dep-2, 0x1.4c0622a6e35ddp-2}, + {-0x1.0000000000001p63, 0x1.4c0622a6e35dep-2, 0x1.4c0622a6e35ddp-2}, + {0x1.fffffffffffffp26, 0x1.4ab650b8c6073p-1, 0x1.4ab650b8c6074p-1}, + {-0x1.fffffffffffffp26, 0x1.4ab650b8c6073p-1, 0x1.4ab650b8c6074p-1}, + {0x1.0p27, 0x1.4ab6511a7d39bp-1, 0x1.4ab6511a7d39ap-1}, + {-0x1.0p27, 0x1.4ab6511a7d39bp-1, 0x1.4ab6511a7d39ap-1}, + {0x1.0000000000001p27, 0x1.4ab651ddeb9e6p-1, 0x1.4ab651ddeb9e7p-1}, + {-0x1.0000000000001p27, 0x1.4ab651ddeb9e6p-1, 0x1.4ab651ddeb9e7p-1}, + {0x1.fffffffffffffp23, 0x1.40ad67e777b1ep-1, 0x1.40ad67e777b1dp-1}, + {-0x1.fffffffffffffp23, 0x1.40ad67e777b1ep-1, 0x1.40ad67e777b1dp-1}, + {0x1.0p24, 0x1.40ad67f3f0c9ap-1, 0x1.40ad67f3f0c9bp-1}, + {-0x1.0p24, 0x1.40ad67f3f0c9ap-1, 0x1.40ad67f3f0c9bp-1}, + {0x1.0000000000001p24, 0x1.40ad680ce2f92p-1, 0x1.40ad680ce2f93p-1}, + {-0x1.0000000000001p24, 0x1.40ad680ce2f92p-1, 0x1.40ad680ce2f93p-1}, + {0x1.fffffffffffffp1, -0x1.4eaa606db24c4p-1, -0x1.4eaa606db24c3p-1}, + {-0x1.fffffffffffffp1, -0x1.4eaa606db24c4p-1, -0x1.4eaa606db24c3p-1}, + {0x1.0p2, -0x1.4eaa606db24c1p-1, -0x1.4eaa606db24cp-1}, + {-0x1.0p2, -0x1.4eaa606db24c1p-1, -0x1.4eaa606db24cp-1}, + {0x1.0000000000001p2, -0x1.4eaa606db24bbp-1, -0x1.4eaa606db24bap-1}, + {-0x1.0000000000001p2, -0x1.4eaa606db24bbp-1, -0x1.4eaa606db24bap-1}, + {0x1.fffffffffffffp0, -0x1.aa22657537201p-2, -0x1.aa22657537202p-2}, + {-0x1.fffffffffffffp0, -0x1.aa22657537201p-2, -0x1.aa22657537202p-2}, + {0x1.0p1, -0x1.aa22657537205p-2, -0x1.aa22657537204p-2}, + {-0x1.0p1, -0x1.aa22657537205p-2, -0x1.aa22657537204p-2}, + {0x1.0000000000001p1, -0x1.aa2265753720cp-2, -0x1.aa2265753720bp-2}, + {-0x1.0000000000001p1, -0x1.aa2265753720cp-2, -0x1.aa2265753720bp-2}, + {0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {-0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {-0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {-0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {0x1.fffffffffffffp-2, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {-0x1.fffffffffffffp-2, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {0x1.0p-1, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {-0x1.0p-1, 0x1.c1528065b7d5p-1, 0x1.c1528065b7d4fp-1}, + {0x1.0000000000001p-1, 0x1.c1528065b7d4fp-1, 0x1.c1528065b7d5p-1}, + {-0x1.0000000000001p-1, 0x1.c1528065b7d4fp-1, 0x1.c1528065b7d5p-1}, + {0x1.fffffffffffffp-3, 0x1.f01549f7deea2p-1, 0x1.f01549f7deea1p-1}, + {-0x1.fffffffffffffp-3, 0x1.f01549f7deea2p-1, 0x1.f01549f7deea1p-1}, + {0x1.0p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {-0x1.0p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {0x1.0000000000001p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {-0x1.0000000000001p-2, 0x1.f01549f7deea1p-1, 0x1.f01549f7deea2p-1}, + {0x1.fffffffffffffp-4, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {-0x1.fffffffffffffp-4, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {0x1.0p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {-0x1.0p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {0x1.0000000000001p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {-0x1.0000000000001p-3, 0x1.fc015527d5bd3p-1, 0x1.fc015527d5bd4p-1}, + {0x1.fffffffffffffp-5, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {-0x1.fffffffffffffp-5, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {0x1.0p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {-0x1.0p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {0x1.0000000000001p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {-0x1.0000000000001p-4, 0x1.ff0015549f4d3p-1, 0x1.ff0015549f4d4p-1}, + {0x1.fffffffffffffp-6, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {-0x1.fffffffffffffp-6, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {0x1.0p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {-0x1.0p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {0x1.0000000000001p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {-0x1.0000000000001p-5, 0x1.ffc00155527d3p-1, 0x1.ffc00155527d2p-1}, + {0x1.fffffffffffffp-7, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {-0x1.fffffffffffffp-7, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {0x1.0p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {-0x1.0p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {0x1.0000000000001p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {-0x1.0000000000001p-6, 0x1.fff000155549fp-1, 0x1.fff00015554ap-1}, + {0x1.fffffffffffffp-15, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {-0x1.fffffffffffffp-15, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {0x1.0p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {-0x1.0p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {0x1.0000000000001p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {-0x1.0000000000001p-14, 0x1.fffffffp-1, 0x1.fffffff000001p-1}, + {0x1.fffffffffffffp-28, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.fffffffffffffp-28, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0000000000001p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0000000000001p-27, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.fffffffffffffp-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.fffffffffffffp-31, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {0x1.0000000000001p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.0000000000001p-30, 0x1.0p0, 0x1.fffffffffffffp-1}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {-0x1.fffffffffffffp1023, -0x1.fffe62ecfab75p-1, -0x1.fffe62ecfab76p-1}, + {0x1.ffffffffffffep1023, 0x1.7ffdfb4c5309p-2, 0x1.7ffdfb4c5308fp-2}, + {-0x1.ffffffffffffep1023, 0x1.7ffdfb4c5309p-2, 0x1.7ffdfb4c5308fp-2}, + {0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {-0x1.921fb54442d18p1, -0x1.0p0, -0x1.fffffffffffffp-1}, + {0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {-0x1.921fb54442d18p0, 0x1.1a62633145c07p-54, 0x1.1a62633145c06p-54}, + {0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {-0x1.0000000000001p0, 0x1.14a280fb5068ap-1, 0x1.14a280fb50689p-1}, + {0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {-0x1.0p0, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068bp-1}, + {0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {-0x1.fffffffffffffp-1, 0x1.14a280fb5068cp-1, 0x1.14a280fb5068dp-1}, + {0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {-0x1.921fb54442d18p-1, 0x1.6a09e667f3bcdp-1, 0x1.6a09e667f3bccp-1}, + {0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {-0x1.0p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.fffffffffffffp-1022, 0x1.0p0, 0x1.0p0}, + {0x0.ffffffffffffep-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.ffffffffffffep-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000002p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000002p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {-0x0.0000000000001p-1022, 0x1.0p0, 0x1.0p0}, + {0x0.0p0, 0x1.0p0, 0x1.0p0}, + {-0x0.0p0, 0x1.0p0, 0x1.0p0} + }; + + for(double[] testCase: testCases) { + failures += testCosCase(testCase[0], testCase[1], testCase[2]); + } + + return failures; + } + + private static int testCosCase(double input, double bound1, double bound2) { + int failures = 0; + failures += Tests.testBounds("Math.cos", input, Math.cos(input), bound1, bound2); + return failures; + } +} diff --git a/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java b/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java new file mode 100644 index 00000000000..6f566c33eb9 --- /dev/null +++ b/jdk/test/java/lang/String/concat/CompactStringsInitialCoder.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 StringConcatFactory MH_INLINE_SIZED_EXACT strategy does not work with -XX:-CompactStrings + * @bug 8148869 + * + * @compile -XDstringConcat=indy -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * + * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:+CompactStrings CompactStringsInitialCoder + * + * @compile -XDstringConcat=indy -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * + * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 CompactStringsInitialCoder.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -XX:-CompactStrings CompactStringsInitialCoder +*/ +import java.lang.StringBuilder; + +public class CompactStringsInitialCoder { + + static String strEmpty = ""; + static String strLatin1 = "\u0042"; + static String strUTF16 = "\u4242"; + static char charLatin1 = '\u0042'; + static char charUTF16 = '\u4242'; + + public static void main(String[] args) throws Exception { + test("\u0042", "" + '\u0042'); + test("\u4242", "" + '\u4242'); + + test("\u0042", "" + charLatin1); + test("\u4242", "" + charUTF16); + + test("\u0042", strEmpty + '\u0042'); + test("\u4242", strEmpty + '\u4242'); + + test("\u0042\u0042", strLatin1 + '\u0042'); + test("\u0042\u4242", strLatin1 + '\u4242'); + test("\u4242\u0042", strUTF16 + '\u0042'); + test("\u4242\u4242", strUTF16 + '\u4242'); + + test("\u0042\u0042", "\u0042" + charLatin1); + test("\u0042\u4242", "\u0042" + charUTF16); + test("\u4242\u0042", "\u4242" + charLatin1); + test("\u4242\u4242", "\u4242" + charUTF16); + + test("\u0042\u0042", "" + charLatin1 + charLatin1); + test("\u0042\u4242", "" + charLatin1 + charUTF16); + test("\u4242\u0042", "" + charUTF16 + charLatin1); + test("\u4242\u4242", "" + charUTF16 + charUTF16); + } + + public static void test(String expected, String actual) { + if (!expected.equals(actual)) { + StringBuilder sb = new StringBuilder(); + sb.append("Expected = "); + sb.append(expected); + sb.append(", actual = "); + sb.append(actual); + throw new IllegalStateException(sb.toString()); + } + } + + +} diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcat.java b/jdk/test/java/lang/String/concat/ImplicitStringConcat.java index 5eb78602498..f0ef90d02db 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcat.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcat.java @@ -26,70 +26,70 @@ * @summary test implicit String concatenations * * @compile ImplicitStringConcat.java - * @run main/othervm ImplicitStringConcat + * @run main/othervm -Xverify:all ImplicitStringConcat * * @compile -XDstringConcat=inline ImplicitStringConcat.java - * @run main/othervm ImplicitStringConcat + * @run main/othervm -Xverify:all ImplicitStringConcat * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcat.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcat.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcat */ import java.lang.StringBuilder; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java index 0cc0a2a7887..108cce0b23b 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatArgCount.java @@ -26,70 +26,70 @@ * @summary Test multiple number of arguments to concatenate. * * @compile ImplicitStringConcatArgCount.java - * @run main/othervm ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all ImplicitStringConcatArgCount * * @compile -XDallowStringFolding=false -XDstringConcat=inline ImplicitStringConcatArgCount.java - * @run main/othervm ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all ImplicitStringConcatArgCount * * @compile -XDallowStringFolding=false -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatArgCount.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount * * @compile -XDallowStringFolding=false -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatArgCount.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatArgCount */ public class ImplicitStringConcatArgCount { static final String s = "f"; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java index f8e677b12bb..0ae6137e9fe 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatBoundaries.java @@ -26,70 +26,70 @@ * @summary Test the boundary values for concatenation arguments. * * @compile ImplicitStringConcatBoundaries.java - * @run main/othervm ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all ImplicitStringConcatBoundaries * * @compile -XDstringConcat=inline ImplicitStringConcatBoundaries.java - * @run main/othervm ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all ImplicitStringConcatBoundaries * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatBoundaries.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatBoundaries.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries */ diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java index 7af7e7d5e05..00780b0758a 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatMany.java @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations with lots of arguments. * * @compile ImplicitStringConcatMany.java - * @run main/othervm ImplicitStringConcatMany + * @run main/othervm -Xverify:all ImplicitStringConcatMany * * @compile -XDstringConcat=inline ImplicitStringConcatMany.java - * @run main/othervm ImplicitStringConcatMany + * @run main/othervm -Xverify:all ImplicitStringConcatMany * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatMany.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatMany.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatMany */ import java.lang.reflect.Field; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java index cc14a100cec..bea78ca8693 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatManyLongs.java @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations with lots of arguments (two-slot version) * * @compile ImplicitStringConcatManyLongs.java - * @run main/othervm ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all ImplicitStringConcatManyLongs * * @compile -XDstringConcat=inline ImplicitStringConcatManyLongs.java - * @run main/othervm ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all ImplicitStringConcatManyLongs * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatManyLongs.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatManyLongs.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatManyLongs */ import java.lang.reflect.Field; diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template index 10fd57f0616..f832cef1f03 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes-head.template @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations, multiple shapes. * * @compile ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=inline ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes */ public class ImplicitStringConcatShapes { public static void test(String expected, String actual) { diff --git a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java index c4a673721ae..5ed9d863810 100644 --- a/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java +++ b/jdk/test/java/lang/String/concat/ImplicitStringConcatShapes.java @@ -26,70 +26,70 @@ * @summary Test implicit String concatenations, multiple shapes. * * @compile ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=inline ImplicitStringConcatShapes.java - * @run main/othervm ImplicitStringConcatShapes + * @run main/othervm -Xverify:all ImplicitStringConcatShapes * * @compile -XDstringConcat=indy -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * * @compile -XDstringConcat=indyWithConstants -source 1.9 -target 1.9 ImplicitStringConcatShapes.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatShapes */ public class ImplicitStringConcatShapes { public static void test(String expected, String actual) { diff --git a/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java b/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java new file mode 100644 index 00000000000..31b29cd30fd --- /dev/null +++ b/jdk/test/java/lang/String/concat/StringConcatFactoryEmptyMethods.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * 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.io.Serializable; +import java.lang.invoke.*; +import java.util.concurrent.Callable; + +/** + * @test + * @summary StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested + * @bug 8148787 + * + * @compile StringConcatFactoryEmptyMethods.java + * + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryEmptyMethods + * +*/ +public class StringConcatFactoryEmptyMethods { + + public static void main(String[] args) throws Throwable { + StringConcatFactory.makeConcat( + MethodHandles.lookup(), + "foo", + MethodType.methodType(String.class) + ); + + StringConcatFactory.makeConcatWithConstants( + MethodHandles.lookup(), + "foo", + MethodType.methodType(String.class), + "" + ); + } + +} diff --git a/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java b/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java index e1a3e8085c6..a174e3e4ffe 100644 --- a/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java +++ b/jdk/test/java/lang/String/concat/StringConcatFactoryInvariants.java @@ -31,33 +31,33 @@ import java.util.concurrent.Callable; * * @compile StringConcatFactoryInvariants.java * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT StringConcatFactoryInvariants * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true StringConcatFactoryInvariants * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants * - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants - * @run main/othervm -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants + * @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true StringConcatFactoryInvariants * */ public class StringConcatFactoryInvariants { diff --git a/jdk/test/java/lang/ref/CleanerTest.java b/jdk/test/java/lang/ref/CleanerTest.java index fedcaf88713..396fbed88bd 100644 --- a/jdk/test/java/lang/ref/CleanerTest.java +++ b/jdk/test/java/lang/ref/CleanerTest.java @@ -41,14 +41,17 @@ import jdk.internal.ref.CleanerFactory; import sun.hotspot.WhiteBox; +import jdk.test.lib.Utils; + import org.testng.Assert; import org.testng.TestNG; import org.testng.annotations.Test; /* * @test - * @library /lib/testlibrary /test/lib + * @library /test/lib/share/classes /lib/testlibrary /test/lib * @build sun.hotspot.WhiteBox + * @build jdk.test.lib.Utils * @modules java.base/jdk.internal.misc java.base/jdk.internal.ref * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run testng/othervm @@ -88,8 +91,7 @@ public class CleanerTest { CleanableCase s = setupPhantom(COMMON, cleaner); cleaner = null; - Assert.assertTrue(checkCleaned(s.getSemaphore()), - "Cleaner cleanup should have occurred"); + checkCleaned(s.getSemaphore(), true, "Cleaner was cleaned:"); } /** @@ -124,8 +126,7 @@ public class CleanerTest { CleanableCase s = setupPhantom(COMMON, cleaner); cleaner = null; - Assert.assertTrue(checkCleaned(s.getSemaphore()), - "Cleaner cleanup should have occurred"); + checkCleaned(s.getSemaphore(), true, "Cleaner was cleaned:"); } /** @@ -213,16 +214,11 @@ public class CleanerTest { CleanableCase cc = setupPhantom(COMMON, test.getCleanable()); test.clearCleanable(); // release this hard reference - boolean result = checkCleaned(test.getSemaphore()); - if (result) { - Assert.assertEquals(r, CleanableCase.EV_CLEAN, - "cleaned; but not expected"); - } else { - Assert.assertNotEquals(r, CleanableCase.EV_CLEAN, - "not cleaned; expected cleaning"); - } - Assert.assertTrue(checkCleaned(cc.getSemaphore()), - "The reference to the Cleanable should have been freed"); + checkCleaned(test.getSemaphore(), + r == CleanableCase.EV_CLEAN, + "Cleanable was cleaned:"); + checkCleaned(cc.getSemaphore(), true, + "The reference to the Cleanable was freed:"); } /** @@ -278,27 +274,32 @@ public class CleanerTest { * Check a semaphore having been released by cleanup handler. * Force a number of GC cycles to give the GC a chance to process * the Reference and for the cleanup action to be run. + * Use a larger number of cycles to wait for an expected cleaning to occur. * * @param semaphore a Semaphore - * @return true if the semaphores has 1 permit, false otherwise. + * @param expectCleaned true if cleaning should occur + * @param msg a message to explain the error */ - static boolean checkCleaned(Semaphore semaphore) { - int cycle = 0; - for (; cycle < 3; cycle++) { + static void checkCleaned(Semaphore semaphore, boolean expectCleaned, + String msg) { + long max_cycles = expectCleaned ? 10 : 3; + long cycle = 0; + for (; cycle < max_cycles; cycle++) { + // Force GC + whitebox.fullGC(); + try { - if (semaphore.tryAcquire(10L, TimeUnit.MILLISECONDS)) { + if (semaphore.tryAcquire(Utils.adjustTimeout(10L), TimeUnit.MILLISECONDS)) { System.out.printf(" Cleanable cleaned in cycle: %d%n", cycle); - return true; + Assert.assertEquals(true, expectCleaned, msg); + return; } } catch (InterruptedException ie) { // retry in outer loop } - // Force GC - whitebox.fullGC(); } // Object has not been cleaned - System.out.printf(" Cleanable not cleaned%n"); - return false; // Failing result + Assert.assertEquals(false, expectCleaned, msg); } /** @@ -622,7 +623,7 @@ public class CleanerTest { System.gc(); Assert.assertNotEquals(map.get(k2), data, "value should not be found in the map"); - final int CYCLE_MAX = 30; + final long CYCLE_MAX = Utils.adjustTimeout(30L); for (int i = 1; map.size() > 0 && i < CYCLE_MAX; i++) { map.forEach( (k, v) -> System.out.printf(" k: %s, v: %s%n", k, v)); try { @@ -699,7 +700,7 @@ public class CleanerTest { } obj = null; - Assert.assertTrue(checkCleaned(s1), "reference should be cleaned;"); + checkCleaned(s1, true, "reference was cleaned:"); cleaner = null; } @@ -713,7 +714,7 @@ public class CleanerTest { Object obj = new Object(); CleanableCase s = setupPhantom(cleaner, obj); obj = null; - Assert.assertTrue(checkCleaned(s.getSemaphore()), - "Object cleaning should have occurred using CleanerFactor.cleaner()"); + checkCleaned(s.getSemaphore(), true, + "Object was cleaned using CleanerFactor.cleaner():"); } } diff --git a/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java b/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java index ef97aa3f225..6659cd861d2 100644 --- a/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java +++ b/jdk/test/java/net/NetworkInterface/NetworkInterfaceStreamTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ * @build java.util.stream.OpTestCase * @run testng/othervm NetworkInterfaceStreamTest * @run testng/othervm -Djava.net.preferIPv4Stack=true NetworkInterfaceStreamTest + * @key intermittent */ import org.testng.annotations.Test; diff --git a/jdk/test/java/rmi/Naming/DefaultRegistryPort.java b/jdk/test/java/rmi/Naming/DefaultRegistryPort.java index a1f2b7adfc6..0c5efcb55d8 100644 --- a/jdk/test/java/rmi/Naming/DefaultRegistryPort.java +++ b/jdk/test/java/rmi/Naming/DefaultRegistryPort.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ * java.rmi/sun.rmi.transport.tcp * @build TestLibrary * @run main/othervm DefaultRegistryPort + * @key intermittent */ /* diff --git a/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java b/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java index 7016e00f43c..eb4d408227b 100644 --- a/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java +++ b/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * 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 @@ * java.rmi/sun.rmi.transport.tcp * @build TestLibrary Legal LegalRegistryNames_Stub * @run main/othervm LegalRegistryNames + * @key intermittent */ import java.net.InetAddress; diff --git a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java index 7f36832e98a..12188414001 100644 --- a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java +++ b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java @@ -58,7 +58,7 @@ public class AltSecurityManager implements Runnable { public AltSecurityManager(int port) { if (port <= 0) { - TestLibrary.bomb("Port must be greater then 0."); + TestLibrary.bomb("Port must be greater than 0."); } this.regPort = port; diff --git a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java index 4209bdccc57..9525535447c 100644 --- a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java +++ b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,7 @@ * java.rmi/sun.rmi.transport.tcp * @build TestLibrary * @run main/othervm CloseServerSocket + * @key intermittent */ import java.io.IOException; diff --git a/jdk/test/java/security/SecureRandom/DefaultProvider.java b/jdk/test/java/security/SecureRandom/DefaultProvider.java index 50b4719acc6..597f2352a4b 100644 --- a/jdk/test/java/security/SecureRandom/DefaultProvider.java +++ b/jdk/test/java/security/SecureRandom/DefaultProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,12 +43,7 @@ public class DefaultProvider { out.println("TEST: Default provider with constructor"); SecureRandom secureRandom = new SecureRandom(); String provider = secureRandom.getProvider().getName(); - if (OS_NAME.startsWith(SUNOS)) { - if (!provider.startsWith("SunPKCS11-")) { - throw new RuntimeException("Unexpected provider name: " - + provider); - } - } else if (!provider.equals("SUN")) { + if (!provider.equals("SUN")) { throw new RuntimeException("Unexpected provider name: " + provider); } @@ -77,16 +72,6 @@ public class DefaultProvider { instance = SecureRandom.getInstance(algorithm); assertInstance(instance, algorithm, provider); out.println("Passed."); - - if (OS_NAME.startsWith(SUNOS)) { - out.println( - "TEST: PKCS11 is supported on Solaris by SunPKCS11 provider"); - algorithm = "PKCS11"; - provider = "SunPKCS11-Solaris"; - instance = SecureRandom.getInstance(algorithm); - assertInstance(instance, algorithm, provider); - out.println("Passed."); - } } private static void assertInstance(SecureRandom instance, diff --git a/jdk/test/java/time/tck/java/time/TCKDuration.java b/jdk/test/java/time/tck/java/time/TCKDuration.java index 40eefd0603c..1e83db7ab8f 100644 --- a/jdk/test/java/time/tck/java/time/TCKDuration.java +++ b/jdk/test/java/time/tck/java/time/TCKDuration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2496,8 +2496,9 @@ public class TCKDuration extends AbstractTCKTest { //----------------------------------------------------------------------- @Test public void test_toNanos() { - Duration test = Duration.ofSeconds(321, 123456789); - assertEquals(test.toNanos(), 321123456789L); + assertEquals(Duration.ofSeconds(321, 123456789).toNanos(), 321123456789L); + assertEquals(Duration.ofNanos(Long.MAX_VALUE).toNanos(), 9223372036854775807L); + assertEquals(Duration.ofNanos(Long.MIN_VALUE).toNanos(), -9223372036854775808L); } @Test @@ -2512,13 +2513,26 @@ public class TCKDuration extends AbstractTCKTest { test.toNanos(); } + @Test + public void test_toNanos_min() { + Duration test = Duration.ofSeconds(0, Long.MIN_VALUE); + assertEquals(test.toNanos(), Long.MIN_VALUE); + } + + @Test(expectedExceptions=ArithmeticException.class) + public void test_toNanos_tooSmall() { + Duration test = Duration.ofSeconds(0, Long.MIN_VALUE).minusNanos(1); + test.toNanos(); + } + //----------------------------------------------------------------------- // toMillis() //----------------------------------------------------------------------- @Test public void test_toMillis() { - Duration test = Duration.ofSeconds(321, 123456789); - assertEquals(test.toMillis(), 321000 + 123); + assertEquals(Duration.ofSeconds(321, 123456789).toMillis(), 321000 + 123); + assertEquals(Duration.ofMillis(Long.MAX_VALUE).toMillis(), 9223372036854775807L); + assertEquals(Duration.ofMillis(Long.MIN_VALUE).toMillis(), -9223372036854775808L); } @Test @@ -2533,6 +2547,18 @@ public class TCKDuration extends AbstractTCKTest { test.toMillis(); } + @Test + public void test_toMillis_min() { + Duration test = Duration.ofSeconds(Long.MIN_VALUE / 1000, (Long.MIN_VALUE % 1000) * 1000000); + assertEquals(test.toMillis(), Long.MIN_VALUE); + } + + @Test(expectedExceptions=ArithmeticException.class) + public void test_toMillis_tooSmall() { + Duration test = Duration.ofSeconds(Long.MIN_VALUE / 1000, ((Long.MIN_VALUE % 1000) - 1) * 1000000); + test.toMillis(); + } + //----------------------------------------------------------------------- // toSeconds() //----------------------------------------------------------------------- diff --git a/jdk/test/java/time/tck/java/time/TCKLocalDate.java b/jdk/test/java/time/tck/java/time/TCKLocalDate.java index 96290401c97..2b5832465c9 100644 --- a/jdk/test/java/time/tck/java/time/TCKLocalDate.java +++ b/jdk/test/java/time/tck/java/time/TCKLocalDate.java @@ -119,6 +119,8 @@ import java.time.temporal.UnsupportedTemporalTypeException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; @@ -2385,4 +2387,204 @@ public class TCKLocalDate extends AbstractDateTimeTest { assertSame(isoEra,IsoEra.CE); assertSame(LocalDate.MIN.getEra(),IsoEra.BCE); } + + //----------------------------------------------------------------- + // datesUntil() + // ---------------------------------------------------------------- + @Test + public void test_datesUntil() { + assertEquals( + date(2015, 9, 29).datesUntil(date(2015, 10, 3)).collect( + Collectors.toList()), Arrays.asList(date(2015, 9, 29), + date(2015, 9, 30), date(2015, 10, 1), date(2015, 10, 2))); + assertEquals(date(2015, 9, 29).datesUntil(date(2015, 10, 3), Period.ofDays(2)) + .collect(Collectors.toList()), Arrays.asList(date(2015, 9, 29), + date(2015, 10, 1))); + assertEquals(date(2015, 1, 31).datesUntil(date(2015, 6, 1), Period.ofMonths(1)) + .collect(Collectors.toList()), Arrays.asList(date(2015, 1, 31), + date(2015, 2, 28), date(2015, 3, 31), date(2015, 4, 30), + date(2015, 5, 31))); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_datesUntil_nullEnd() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(null); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_datesUntil_nullEndStep() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(null, Period.ofDays(1)); + } + + @Test(expectedExceptions=NullPointerException.class) + public void test_datesUntil_nullStep() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, null); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void test_datesUntil_endBeforeStart() { + date(2015, 1, 31).datesUntil(date(2015, 1, 30)); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void test_datesUntil_endBeforeStartPositiveStep() { + date(2015, 1, 31).datesUntil(date(2015, 1, 30), Period.of(1, 0, 0)); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void test_datesUntil_endAfterStartNegativeStep() { + date(2015, 1, 30).datesUntil(date(2015, 1, 31), Period.of(0, -1, -1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_datesUntil_zeroStep() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, Period.ZERO); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_datesUntil_oppositeSign() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, Period.of(1, 0, -1)); + } + + @Test(expectedExceptions=IllegalArgumentException.class) + public void test_datesUntil_oppositeSign2() { + LocalDate date = date(2015, 1, 31); + date.datesUntil(date, Period.of(0, -1, 1)); + } + + @DataProvider(name="datesUntil") + public Object[][] provider_datesUntil() { + return new Object[][] { + {MIN_DATE, MIN_DATE}, + {MIN_DATE, MAX_DATE}, + {MAX_DATE, MAX_DATE}, + {date(2015,10,1), date(2015,10,2)}, + {date(2015,10,1), date(2015,11,1)}, + {date(2015,10,31), date(2015,11,1)}, + {date(2015,10,1), MAX_DATE}, + {MIN_DATE, date(2015,10,1)} + }; + } + + @Test(dataProvider = "datesUntil") + public void test_datesUntil_count(LocalDate start, LocalDate end) { + assertEquals(start.datesUntil(end).count(), start.until(end, ChronoUnit.DAYS)); + assertEquals(start.datesUntil(end, Period.ofDays(1)).count(), + start.until(end, ChronoUnit.DAYS)); + } + + @DataProvider(name="datesUntilSteps") + public Object[][] provider_datesUntil_steps() { + List data = new ArrayList<>(Arrays.asList(new Object[][] { + {MIN_DATE, MAX_DATE, Period.ofYears(Year.MAX_VALUE)}, + {MIN_DATE, MAX_DATE, Period.ofDays(2)}, + {MIN_DATE, MAX_DATE, Period.of(1,2,3)}, + {MIN_DATE, MAX_DATE, Period.of(1,2,1000000)}, + {MIN_DATE, MAX_DATE, Period.of(1,1000000,3)}, + {MIN_DATE, MAX_DATE, Period.of(1000000,2,3)}, + {MIN_DATE, MIN_DATE.plusMonths(1), Period.ofMonths(1)}, + {MIN_DATE, date(Year.MIN_VALUE, 2, 2), Period.ofMonths(1)}, + {MIN_DATE, date(Year.MIN_VALUE, 8, 9), Period.of(0, 1, 1)}, + {MIN_DATE, MAX_DATE.minusYears(1), Period.ofYears(Year.MAX_VALUE)}, + {MAX_DATE.minusMonths(1), MAX_DATE, Period.ofMonths(1)}, + {date(Year.MAX_VALUE, 2, 20), MAX_DATE, Period.of(0, 1, 1)}, + {date(2015,1,1), date(2016,1,1), Period.ofYears(1)}, + {date(2015,1,1), date(2016,1,1), Period.ofDays(365)}, + {date(2015,1,1), date(2016,1,1), Period.ofDays(366)}, + {date(2015,1,1), date(2016,1,1), Period.ofDays(4)}, + {date(2015,1,1), date(2016,1,1), Period.of(0,1,2)}, + {date(2015,1,1), date(2016,1,1), Period.ofMonths(1)}, + {date(2015,1,1), date(2016,1,1), Period.ofMonths(12)}, + {date(2015,1,1), date(2016,1,2), Period.ofMonths(12)}, + {date(2015,1,1), date(2016,1,1), Period.of(0, 11, 30)}, + {date(2015,1,1), date(2015,12,31), Period.of(0, 11, 30)}, + {date(2015,1,31), date(2015,12,31), Period.ofMonths(2)}, + {date(2015,1,31), date(2015,12,1), Period.ofMonths(2)}, + {date(2015,1,31), date(2015,11,30), Period.ofMonths(2)}, + {date(2015,1,31), date(2030,11,30), Period.of(1,30,365)}, + {date(2015,1,31), date(2043,1,31), Period.of(4,0,0)}, + {date(2015,1,31), date(2043,2,1), Period.of(4,0,0)}, + {date(2015,1,31), date(2043,1,31), Period.of(3,11,30)}, + {date(2015,1,31), date(2043,2,1), Period.of(3,11,30)}, + {date(2015,1,31), date(2043,1,31), Period.of(0,0,1460)}, + {date(2015,1,31), date(2043,1,31), Period.of(0,0,1461)}, + {date(2015,1,31), date(2043,2,1), Period.of(0,0,1461)}, + {date(2015,1,31), MAX_DATE, Period.of(10,100,1000)}, + {date(2015,1,31), MAX_DATE, Period.of(1000000,10000,100000)}, + {date(2015,1,31), MAX_DATE, Period.ofDays(10000000)}, + {date(2015,1,31), MAX_DATE, Period.ofDays(Integer.MAX_VALUE)}, + {date(2015,1,31), MAX_DATE, Period.ofMonths(Integer.MAX_VALUE)}, + {date(2015,1,31), MAX_DATE, Period.ofYears(Integer.MAX_VALUE)} + })); + LocalDate start = date(2014, 1, 15); + LocalDate end = date(2015, 3, 4); + for (int months : new int[] { 0, 1, 2, 3, 5, 7, 12, 13 }) { + for (int days : new int[] { 0, 1, 2, 3, 5, 10, 17, 27, 28, 29, 30, 31, 32, 57, 58, 59, + 60, 61, 62, 70, 80, 90 }) { + if (months > 0 || days > 0) + data.add(new Object[] { start, end, Period.of(0, months, days) }); + } + } + for (int days = 27; days < 100; days++) { + data.add(new Object[] { start, start.plusDays(days), Period.ofMonths(1) }); + } + return data.toArray(new Object[data.size()][]); + } + + @Test(dataProvider="datesUntilSteps") + public void test_datesUntil_step(LocalDate start, LocalDate end, Period step) { + assertEquals(start.datesUntil(start, step).count(), 0); + long count = start.datesUntil(end, step).count(); + assertTrue(count > 0); + // the last value must be before the end date + assertTrue(start.plusMonths(step.toTotalMonths()*(count-1)).plusDays(step.getDays()*(count-1)).isBefore(end)); + try { + // the next after the last value must be either invalid or not before the end date + assertFalse(start.plusMonths(step.toTotalMonths()*count).plusDays(step.getDays()*count).isBefore(end)); + } catch (ArithmeticException | DateTimeException e) { + // ignore: possible overflow for the next value is ok + } + if(count < 1000) { + assertTrue(start.datesUntil(end, step).allMatch(date -> !date.isBefore(start) && date.isBefore(end))); + List list = new ArrayList<>(); + for(long i=0; i 0); + // the last value must be after the start date + assertTrue(end.minusMonths(step.toTotalMonths()*(count-1)).minusDays(step.getDays()*(count-1)).isAfter(start)); + try { + // the next after the last value must be either invalid or not after the start date + assertFalse(end.minusMonths(step.toTotalMonths()*count).minusDays(step.getDays()*count).isAfter(start)); + } catch (ArithmeticException | DateTimeException e) { + // ignore: possible overflow for the next value is ok + } + if(count < 1000) { + assertTrue(end.datesUntil(start, step.negated()).allMatch(date -> date.isAfter(start) && !date.isAfter(end))); + List list = new ArrayList<>(); + for(long i=0; i stream = date.datesUntil(date.plusDays(5)); + long sum = stream.mapToInt(LocalDate::getDayOfMonth).sum(); + assertEquals(sum, 60, "sum of 10, 11, 12, 13, 14 is wrong"); + } } diff --git a/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java b/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java index 11f103dd317..ec60f0f586d 100644 --- a/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java +++ b/jdk/test/java/time/tck/java/time/format/TCKDTFParsedInstant.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.util.Locale; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; @@ -194,7 +195,7 @@ public class TCKDTFParsedInstant { @Test(dataProvider="parseWithZoneWithoutOffset") public void testWithZoneWithoutOffset(String withZoneWithoutOffset, ZonedDateTime expectedZDT) { - dtFormatter = DateTimeFormatter.ofPattern("d MMM HH:mm:ss uuuu VV"); + dtFormatter = DateTimeFormatter.ofPattern("d MMM HH:mm:ss uuuu VV").withLocale(Locale.ENGLISH); zdt1 = ZonedDateTime.parse(withZoneWithoutOffset, dtFormatter); assertEquals(expectedZDT, zdt1); } diff --git a/jdk/test/java/time/test/java/time/TestClock_System.java b/jdk/test/java/time/test/java/time/TestClock_System.java index b311dad6e6c..55ef1cd851e 100644 --- a/jdk/test/java/time/test/java/time/TestClock_System.java +++ b/jdk/test/java/time/test/java/time/TestClock_System.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -179,11 +179,17 @@ public class TestClock_System { int count=0; // let's preheat the system a bit: + int lastNanos = 0; for (int i = 0; i < 1000 ; i++) { system1 = Instant.ofEpochMilli(System.currentTimeMillis()); - highest1 = highestUTC.instant(); final int sysnan = system1.getNano(); - final int nanos = highest1.getNano(); + int nanos; + do { + highest1 = highestUTC.instant(); + nanos = highest1.getNano(); + } while (nanos == lastNanos); // Repeat to get a different value + lastNanos = nanos; + if ((nanos % 1000000) > 0) { count++; // we have micro seconds } diff --git a/jdk/test/java/util/Collections/EmptyNavigableMap.java b/jdk/test/java/util/Collections/EmptyNavigableMap.java index 306f05657b9..5daf055786a 100644 --- a/jdk/test/java/util/Collections/EmptyNavigableMap.java +++ b/jdk/test/java/util/Collections/EmptyNavigableMap.java @@ -265,7 +265,7 @@ public class EmptyNavigableMap { navigableMap.subMap(last, true, first, false); }, IllegalArgumentException.class, description - + ": Must throw IllegalArgumentException when fromElement is not less then then toElement."); + + ": Must throw IllegalArgumentException when fromElement is not less than toElement."); navigableMap.subMap(first, true, last, false); } diff --git a/jdk/test/java/util/Collections/EmptyNavigableSet.java b/jdk/test/java/util/Collections/EmptyNavigableSet.java index fa28e097006..7541f3d363b 100644 --- a/jdk/test/java/util/Collections/EmptyNavigableSet.java +++ b/jdk/test/java/util/Collections/EmptyNavigableSet.java @@ -284,7 +284,7 @@ public class EmptyNavigableSet { navigableSet.subSet(last, true, first, false); }, IllegalArgumentException.class, description - + ": Must throw IllegalArgumentException when fromElement is not less then then toElement."); + + ": Must throw IllegalArgumentException when fromElement is not less than toElement."); navigableSet.subSet(first, true, last, false); } diff --git a/jdk/test/java/util/UUID/UUIDTest.java b/jdk/test/java/util/UUID/UUIDTest.java index 06b240fa9fa..46e91e6df06 100644 --- a/jdk/test/java/util/UUID/UUIDTest.java +++ b/jdk/test/java/util/UUID/UUIDTest.java @@ -22,9 +22,11 @@ */ /* @test - * @bug 4173528 5068772 + * @bug 4173528 5068772 8148936 * @summary Unit tests for java.util.UUID * @key randomness + * @run main/othervm -XX:+CompactStrings UUIDTest + * @run main/othervm -XX:-CompactStrings UUIDTest */ import java.util.*; diff --git a/jdk/test/java/util/concurrent/tck/TimeUnitTest.java b/jdk/test/java/util/concurrent/tck/TimeUnitTest.java index 3b33c9a4971..30f955978d8 100644 --- a/jdk/test/java/util/concurrent/tck/TimeUnitTest.java +++ b/jdk/test/java/util/concurrent/tck/TimeUnitTest.java @@ -41,6 +41,7 @@ import static java.util.concurrent.TimeUnit.MINUTES; import static java.util.concurrent.TimeUnit.NANOSECONDS; import static java.util.concurrent.TimeUnit.SECONDS; +import java.time.temporal.ChronoUnit; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -456,8 +457,53 @@ public class TimeUnitTest extends JSR166TestCase { * a deserialized serialized unit is the same instance */ public void testSerialization() throws Exception { - TimeUnit x = MILLISECONDS; - assertSame(x, serialClone(x)); + for (TimeUnit x : TimeUnit.values()) + assertSame(x, serialClone(x)); + } + + /** + * tests for toChronoUnit. + */ + public void testToChronoUnit() throws Exception { + assertSame(ChronoUnit.NANOS, NANOSECONDS.toChronoUnit()); + assertSame(ChronoUnit.MICROS, MICROSECONDS.toChronoUnit()); + assertSame(ChronoUnit.MILLIS, MILLISECONDS.toChronoUnit()); + assertSame(ChronoUnit.SECONDS, SECONDS.toChronoUnit()); + assertSame(ChronoUnit.MINUTES, MINUTES.toChronoUnit()); + assertSame(ChronoUnit.HOURS, HOURS.toChronoUnit()); + assertSame(ChronoUnit.DAYS, DAYS.toChronoUnit()); + + // Every TimeUnit has a defined ChronoUnit equivalent + for (TimeUnit x : TimeUnit.values()) + assertSame(x, TimeUnit.of(x.toChronoUnit())); + } + + /** + * tests for TimeUnit.of(ChronoUnit). + */ + public void testTimeUnitOf() throws Exception { + assertSame(NANOSECONDS, TimeUnit.of(ChronoUnit.NANOS)); + assertSame(MICROSECONDS, TimeUnit.of(ChronoUnit.MICROS)); + assertSame(MILLISECONDS, TimeUnit.of(ChronoUnit.MILLIS)); + assertSame(SECONDS, TimeUnit.of(ChronoUnit.SECONDS)); + assertSame(MINUTES, TimeUnit.of(ChronoUnit.MINUTES)); + assertSame(HOURS, TimeUnit.of(ChronoUnit.HOURS)); + assertSame(DAYS, TimeUnit.of(ChronoUnit.DAYS)); + + assertThrows(NullPointerException.class, + () -> TimeUnit.of((ChronoUnit)null)); + + // ChronoUnits either round trip to their TimeUnit + // equivalents, or throw IllegalArgumentException. + for (ChronoUnit cu : ChronoUnit.values()) { + final TimeUnit tu; + try { + tu = TimeUnit.of(cu); + } catch (IllegalArgumentException acceptable) { + continue; + } + assertSame(cu, tu.toChronoUnit()); + } } } diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java index 76a4d72ad2a..dbeada29c55 100644 --- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java +++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/LambdaTestHelpers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,6 +47,7 @@ import java.util.function.ToLongFunction; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertFalse; /** * LambdaTestHelpers -- assertion methods and useful objects for lambda test cases @@ -400,6 +401,16 @@ public class LambdaTestHelpers { assertEquals(toBoxedMultiset(actual), toBoxedMultiset(expected)); } + public static void assertContains(Optional actual, Iterator it) { + actual.ifPresentOrElse(r -> { + boolean contained = false; + while (!contained && it.hasNext()) { + contained = Objects.equals(r, it.next()); + } + assertTrue(contained, "Not found: "+r); + }, () -> assertFalse(it.hasNext())); + } + public static void launderAssertion(Runnable r, Supplier additionalInfo) { try { r.run(); diff --git a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java index 8a849015260..b3aa58ac842 100644 --- a/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java +++ b/jdk/test/java/util/stream/bootlib/java.base/java/util/stream/StreamTestDataProvider.java @@ -47,6 +47,7 @@ public class StreamTestDataProvider { private static final Object[][] testData; private static final Object[][] testSmallData; + private static final Object[][] testMiniData; private static final Object[][] withNullTestData; private static final Object[][] spliteratorTestData; @@ -85,6 +86,7 @@ public class StreamTestDataProvider { static { { + List listMini = new ArrayList<>(); List listSmall = new ArrayList<>(); List list1000 = new ArrayList<>(); List list = null; @@ -93,7 +95,7 @@ public class StreamTestDataProvider { final Integer[] ints = (Integer[])data[1]; final List intsAsList = Arrays.asList(ints); - list = ints.length >= 1000 ? list1000 : listSmall; + list = ints.length >= 1000 ? list1000 : (ints.length >= 100 ? listSmall : listMini); list.add(arrayDataDescr("array:" + name, ints)); list.add(collectionDataDescr("ArrayList.asList:" + name, intsAsList)); @@ -119,6 +121,8 @@ public class StreamTestDataProvider { // @@@ Add more } + testMiniData = listMini.toArray(new Object[0][]); + listSmall.addAll(listMini); testSmallData = listSmall.toArray(new Object[0][]); list1000.addAll(listSmall); testData = list1000.toArray(new Object[0][]); @@ -204,6 +208,11 @@ public class StreamTestDataProvider { return testSmallData; } + @DataProvider(name = "StreamTestData.mini") + public static Object[][] makeMiniStreamTestData() { + return testMiniData; + } + @DataProvider(name = "withNull:StreamTestData") public static Object[][] makeStreamWithNullTestData() { return withNullTestData; diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java index 64a9240fecd..6dd44206f17 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindAnyOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @bug 8148115 + */ + package org.openjdk.tests.java.util.stream; import java.util.*; @@ -61,18 +67,7 @@ public class FindAnyOpTest extends OpTestCase { void exerciseStream(TestData.OfRef data, Function, Stream> fs) { Optional or = withData(data).terminal(fs, s -> s.findAny()).equalator(VALID_ANSWER).exercise(); - if (or.isPresent()) { - Integer r = or.get(); - Iterator it = fs.apply(data.stream()).iterator(); - boolean contained = false; - while (!contained && it.hasNext()) { - contained = Objects.equals(r, it.next()); - } - assertTrue(contained); - } - else { - assertFalse(fs.apply(data.stream()).iterator().hasNext()); - } + assertContains(or, fs.apply(data.stream()).iterator()); } @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java index 02e3d0727b8..40ec1cca108 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/FindFirstOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @bug 8148115 + */ + package org.openjdk.tests.java.util.stream; import java.util.*; @@ -59,15 +65,19 @@ public class FindFirstOpTest extends OpTestCase { } void exerciseStream(TestData.OfRef data, Function, Stream> fs) { - Optional r = exerciseTerminalOps(data, fs, s -> s.findFirst()); - if (r.isPresent()) { - Iterator i = fs.apply(data.stream()).iterator(); - assertTrue(i.hasNext()); - assertEquals(i.next(), r.get()); - } - else { - assertFalse(fs.apply(data.stream()).iterator().hasNext()); - } + Iterator i = fs.apply(data.stream()).iterator(); + Optional expected = i.hasNext() ? Optional.of(i.next()) : Optional.empty(); + withData(data).terminal(fs, s -> s.findFirst()) + .expectedResult(expected) + .resultAsserter((act, exp, ord, par) -> { + if (par & !ord) { + assertContains(act, fs.apply(data.stream()).iterator()); + } + else { + assertEquals(act, exp); + } + }) + .exercise(); } @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java index efa5c62e640..6951bc2ded7 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SequentialOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,7 @@ public class SequentialOpTest extends OpTestCase { } @SuppressWarnings({"rawtypes", "unchecked"}) - @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData.mini", dataProviderClass = StreamTestDataProvider.class) public void testMixedSeqPar(String name, TestData.OfRef data) { Function id = LambdaTestHelpers.identity(); UnaryOperator>[] changers diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java index 7fe0006dc1b..c43b3deed68 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/SliceOpTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/* + * @test + * @bug 8148250 + */ + package org.openjdk.tests.java.util.stream; import org.testng.annotations.Test; @@ -341,4 +347,13 @@ public class SliceOpTest extends OpTestCase { return Arrays.asList(0, 1, size / 2, size - 1, size, size + 1, 2 * size); } } + + public void testLimitParallelHugeInput() { + for (int n : new int[] {10, 100, 1000, 10000}) { + long[] actual = LongStream.range(0, Long.MAX_VALUE) + .parallel().filter(x -> true) // remove SIZED + .limit(n).toArray(); + assertEquals(LongStream.range(0, n).toArray(), actual); + } + } } diff --git a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java index f3739784b34..0d07e7cb67a 100644 --- a/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java +++ b/jdk/test/java/util/stream/test/org/openjdk/tests/java/util/stream/StreamSpliteratorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @bug 8148838 + */ + package org.openjdk.tests.java.util.stream; import java.util.Arrays; @@ -282,7 +288,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "StreamTestData", + @Test(dataProvider = "StreamTestData.small", dataProviderClass = StreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testStreamSpliterators(String name, TestData.OfRef data) { @@ -303,14 +309,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData.small", dataProviderClass = StreamTestDataProvider.class) public void testSpliterators(String name, TestData.OfRef data) { for (Function, Stream> f : streamFunctions()) { SpliteratorTestHelper.testSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "StreamTestData", dataProviderClass = StreamTestDataProvider.class) + @Test(dataProvider = "StreamTestData.small", dataProviderClass = StreamTestDataProvider.class) public void testParSpliterators(String name, TestData.OfRef data) { for (Function, Stream> f : streamFunctions()) { SpliteratorTestHelper.testSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -323,7 +329,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (streamFunctions == null) { List, Stream>> opFunctions = Arrays.asList( s -> s.filter(pEven), - s -> s.map(mDoubler), + s -> s.flatMap(x -> Stream.of(x, x)), // @@@ Add distinct once asserting results with or without order // is correctly supported // s -> s.distinct(), @@ -378,7 +384,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "IntStreamTestData", + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testIntStreamSpliterators(String name, TestData.OfInt data) { @@ -399,14 +405,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class) public void testIntSpliterators(String name, TestData.OfInt data) { for (Function f : intStreamFunctions()) { SpliteratorTestHelper.testIntSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "IntStreamTestData", dataProviderClass = IntStreamTestDataProvider.class) + @Test(dataProvider = "IntStreamTestData.small", dataProviderClass = IntStreamTestDataProvider.class) public void testIntParSpliterators(String name, TestData.OfInt data) { for (Function f : intStreamFunctions()) { SpliteratorTestHelper.testIntSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -419,7 +425,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (intStreamFunctions == null) { List> opFunctions = Arrays.asList( s -> s.filter(ipEven), - s -> s.map(irDoubler), + s -> s.flatMap(x -> IntStream.of(x, x)), s -> s.sorted()); intStreamFunctions = permuteStreamFunctions(opFunctions); @@ -471,7 +477,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "LongStreamTestData", + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testLongStreamSpliterators(String name, TestData.OfLong data) { @@ -492,14 +498,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class) public void testLongSpliterators(String name, TestData.OfLong data) { for (Function f : longStreamFunctions()) { SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "LongStreamTestData", dataProviderClass = LongStreamTestDataProvider.class) + @Test(dataProvider = "LongStreamTestData.small", dataProviderClass = LongStreamTestDataProvider.class) public void testLongParSpliterators(String name, TestData.OfLong data) { for (Function f : longStreamFunctions()) { SpliteratorTestHelper.testLongSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -512,7 +518,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (longStreamFunctions == null) { List> opFunctions = Arrays.asList( s -> s.filter(lpEven), - s -> s.map(x -> x * 2L), + s -> s.flatMap(x -> LongStream.of(x, x)), s -> s.sorted()); longStreamFunctions = permuteStreamFunctions(opFunctions); @@ -564,7 +570,7 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "DoubleStreamTestData", + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class, groups = { "serialization-hostile" }) public void testDoubleStreamSpliterators(String name, TestData.OfDouble data) { @@ -585,14 +591,14 @@ public class StreamSpliteratorTest extends OpTestCase { } } - @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class) public void testDoubleSpliterators(String name, TestData.OfDouble data) { for (Function f : doubleStreamFunctions()) { SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.stream()).spliterator()); } } - @Test(dataProvider = "DoubleStreamTestData", dataProviderClass = DoubleStreamTestDataProvider.class) + @Test(dataProvider = "DoubleStreamTestData.small", dataProviderClass = DoubleStreamTestDataProvider.class) public void testDoubleParSpliterators(String name, TestData.OfDouble data) { for (Function f : doubleStreamFunctions()) { SpliteratorTestHelper.testDoubleSpliterator(() -> f.apply(data.parallelStream()).spliterator()); @@ -605,7 +611,7 @@ public class StreamSpliteratorTest extends OpTestCase { if (doubleStreamFunctions == null) { List> opFunctions = Arrays.asList( s -> s.filter(dpEven), - s -> s.map(x -> x * 2.0), + s -> s.flatMap(x -> DoubleStream.of(x, x)), s -> s.sorted()); doubleStreamFunctions = permuteStreamFunctions(opFunctions); diff --git a/jdk/test/javax/imageio/MultiReadTest.java b/jdk/test/javax/imageio/MultiReadTest.java index daea61610be..2e19d0b360c 100644 --- a/jdk/test/javax/imageio/MultiReadTest.java +++ b/jdk/test/javax/imageio/MultiReadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ public class MultiReadTest { private static final int max = 5; public static void main(String[] args) throws IOException { - final String[] formats = { "bmp", "png", "gif", "jpg" }; + final String[] formats = { "bmp", "png", "gif", "jpg", "tif" }; for (String f : formats) { test(f); diff --git a/jdk/test/javax/imageio/plugins/jpeg/JpegRawImageTypeTest.java b/jdk/test/javax/imageio/plugins/jpeg/JpegRawImageTypeTest.java new file mode 100644 index 00000000000..8749ca0daa6 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/jpeg/JpegRawImageTypeTest.java @@ -0,0 +1,67 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8143562 + * @summary Test verifies whether getRawImageType API returns proper raw + * image type when color space is of type YCbCr. + * @run main JpegRawImageTypeTest + */ + +import java.io.File; +import java.util.Iterator; +import javax.imageio.ImageIO; +import javax.imageio.ImageReader; +import javax.imageio.ImageTypeSpecifier; +import javax.imageio.stream.ImageInputStream; + +public class JpegRawImageTypeTest { + + public static void main(String[] args) throws Exception { + + //nomarkers.jpg has YCbCr color space + String fileName = "nomarkers.jpg"; + String sep = System.getProperty("file.separator"); + String dir = System.getProperty("test.src", "."); + String filePath = dir+sep+fileName; + System.out.println("Test file: " + filePath); + File imageFile = new File(filePath); + + ImageInputStream inputStream = ImageIO. + createImageInputStream(imageFile); + Iterator readers = ImageIO.getImageReaders(inputStream); + + if(readers.hasNext()) { + ImageReader reader = readers.next(); + reader.setInput(inputStream); + + ImageTypeSpecifier typeSpecifier = reader.getRawImageType(0); + //check if ImageTypeSpecifier is null for YCbCr JPEG Image + if (typeSpecifier == null) { + throw new RuntimeException("ImageReader returns null raw image" + + " type"); + } + } + } +} diff --git a/jdk/test/javax/imageio/plugins/shared/BitDepth.java b/jdk/test/javax/imageio/plugins/shared/BitDepth.java index 9f1e2ee6da9..4e051738590 100644 --- a/jdk/test/javax/imageio/plugins/shared/BitDepth.java +++ b/jdk/test/javax/imageio/plugins/shared/BitDepth.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * 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,11 +23,11 @@ /** * @test - * @bug 4413109 4418221 6607198 + * @bug 4413109 4418221 6607198 8147448 * @run main BitDepth - * @summary Checks that the PNG and JPEG writers can handle various - * BufferedImage types. An optional list of arguments may be used to - * test a different format writer or writers. + * @summary Checks that ImageIO writers for standard formats can handle + * various BufferedImage RGB types. An optional list of arguments + * may be used to test the writers for a different list of formats. */ import java.awt.Color; @@ -81,21 +81,19 @@ public class BitDepth { BufferedImage.TYPE_INT_BGR, BufferedImage.TYPE_3BYTE_BGR, BufferedImage.TYPE_USHORT_565_RGB, - BufferedImage.TYPE_USHORT_555_RGB - }; - - private static final int[] biRGBATypes = { + BufferedImage.TYPE_USHORT_555_RGB, BufferedImage.TYPE_INT_ARGB, BufferedImage.TYPE_INT_ARGB_PRE, BufferedImage.TYPE_4BYTE_ABGR, BufferedImage.TYPE_4BYTE_ABGR_PRE }; - private static final int[] biGrayTypes = { - BufferedImage.TYPE_BYTE_GRAY, - BufferedImage.TYPE_USHORT_GRAY, - BufferedImage.TYPE_BYTE_BINARY - }; + //private static final int[] biGrayTypes = { + // BufferedImage.TYPE_BYTE_GRAY, + // BufferedImage.TYPE_USHORT_GRAY, + // BufferedImage.TYPE_BYTE_BINARY + //}; + private static final String[] biTypeNames = { "CUSTOM", @@ -116,7 +114,7 @@ public class BitDepth { private int width = 80; private int height = 80; - private String[] format = { "png", "jpeg" }; + private String[] format = { "png", "jpeg", "tif", "bmp", "gif" }; public BitDepth(String[] args) throws IOException { if (args.length > 0) { @@ -129,10 +127,28 @@ public class BitDepth { } private void testFormat(String format) throws IOException { + boolean allOK = true; for (int i = 0; i < biRGBTypes.length; i++) { + int type = biRGBTypes[i]; + + + // TODO: remove the following 'if' block after the 8147448 fix + if ( format.toLowerCase().equals("bmp") && ( + (type == BufferedImage.TYPE_INT_ARGB ) || + (type == BufferedImage.TYPE_INT_ARGB_PRE ) || + (type == BufferedImage.TYPE_4BYTE_ABGR ) || + (type == BufferedImage.TYPE_4BYTE_ABGR_PRE ))) { + + System.err.println("cannot use " + biTypeNames[type] + + " for bmp because of JDK-8147448.\t" + + " please update the test after fix of this bug!"); + continue; + } + + System.out.println("Testing " + format + " writer for type " + biTypeNames[type]); File f = testWriteRGB(format, type); @@ -143,6 +159,8 @@ public class BitDepth { allOK = allOK && ok; } + + if (format.equals("png")) { System.out.println("Testing png writer for black stripe"); boolean ok = testPNGByteBinary(); @@ -154,8 +172,8 @@ public class BitDepth { } } - private File testWriteRGB(String format, int type) - throws IOException { + private File testWriteRGB(String format, int type) throws IOException { + BufferedImage bi = new BufferedImage(width, height, type); Graphics2D g = bi.createGraphics(); diff --git a/jdk/test/javax/imageio/plugins/shared/ImageWriterCompressionTest.java b/jdk/test/javax/imageio/plugins/shared/ImageWriterCompressionTest.java new file mode 100644 index 00000000000..9f633c0d300 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/shared/ImageWriterCompressionTest.java @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * 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.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Locale; +import java.util.Set; +import javax.imageio.IIOImage; +import javax.imageio.ImageIO; +import javax.imageio.ImageWriteParam; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageOutputStream; + +/** + * @test @bug 6488522 + * @summary Check the compression support in imageio ImageWriters + * @run main ImageWriterCompressionTest + */ +public class ImageWriterCompressionTest { + + // ignore jpg (fail): + // Caused by: javax.imageio.IIOException: Invalid argument to native writeImage + private static final Set IGNORE_FILE_SUFFIXES + = new HashSet(Arrays.asList(new String[] { + "bmp", "gif", + "jpg", "jpeg" + } )); + + public static void main(String[] args) { + Locale.setDefault(Locale.US); + + final BufferedImage image + = new BufferedImage(512, 512, BufferedImage.TYPE_INT_ARGB); + + final Graphics2D g2d = image.createGraphics(); + try { + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setRenderingHint(RenderingHints.KEY_RENDERING, + RenderingHints.VALUE_RENDER_QUALITY); + g2d.scale(2.0, 2.0); + + g2d.setColor(Color.red); + g2d.draw(new Rectangle2D.Float(10, 10, 100, 100)); + g2d.setColor(Color.blue); + g2d.fill(new Rectangle2D.Float(12, 12, 98, 98)); + g2d.setColor(Color.green); + g2d.setFont(new Font(Font.SERIF, Font.BOLD, 14)); + + for (int i = 0; i < 15; i++) { + g2d.drawString("Testing Compression ...", 20, 20 + i * 16); + } + + final String[] fileSuffixes = ImageIO.getWriterFileSuffixes(); + + final Set testedWriterClasses = new HashSet(); + + for (String suffix : fileSuffixes) { + + if (!IGNORE_FILE_SUFFIXES.contains(suffix)) { + final Iterator itWriters + = ImageIO.getImageWritersBySuffix(suffix); + + final ImageWriter writer; + final ImageWriteParam writerParams; + + if (itWriters.hasNext()) { + writer = itWriters.next(); + + if (testedWriterClasses.add(writer.getClass().getName())) { + writerParams = writer.getDefaultWriteParam(); + + if (writerParams.canWriteCompressed()) { + testCompression(image, writer, writerParams, suffix); + } + } + } else { + throw new RuntimeException("Unable to get writer !"); + } + } + } + } catch (IOException ioe) { + throw new RuntimeException("IO failure", ioe); + } + finally { + g2d.dispose(); + } + } + + private static void testCompression(final BufferedImage image, + final ImageWriter writer, + final ImageWriteParam writerParams, + final String suffix) + throws IOException + { + System.out.println("Compression types: " + + Arrays.toString(writerParams.getCompressionTypes())); + + // Test Compression modes: + try { + writerParams.setCompressionMode(ImageWriteParam.MODE_DISABLED); + saveImage(image, writer, writerParams, "disabled", suffix); + } catch (Exception e) { + System.out.println("CompressionMode Disabled not supported: "+ e.getMessage()); + } + + try { + writerParams.setCompressionMode(ImageWriteParam.MODE_DEFAULT); + saveImage(image, writer, writerParams, "default", suffix); + } catch (Exception e) { + System.out.println("CompressionMode Default not supported: "+ e.getMessage()); + } + + writerParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); + writerParams.setCompressionType(selectCompressionType(suffix, + writerParams.getCompressionTypes())); + + System.out.println("Selected Compression type: " + + writerParams.getCompressionType()); + + long prev = Long.MAX_VALUE; + for (int i = 10; i >= 0; i--) { + float quality = 0.1f * i; + writerParams.setCompressionQuality(quality); + + long len = saveImage(image, writer, writerParams, + String.format("explicit-%.1f", quality), suffix); + + if (len <= 0) { + throw new RuntimeException("zero file length !"); + } else if (len > prev) { + throw new RuntimeException("Incorrect file length: " + len + + " larger than previous: " + prev + " !"); + } + prev = len; + } + } + + private static String selectCompressionType(final String suffix, + final String[] types) + { + switch (suffix) { + case "tif": + case "tiff": + return "LZW"; + default: + return types[0]; + } + } + + private static long saveImage(final BufferedImage image, + final ImageWriter writer, + final ImageWriteParam writerParams, + final String mode, + final String suffix) throws IOException + { + final File imgFile = new File("WriterCompressionTest-" + + mode + '.' + suffix); + System.out.println("Writing file: " + imgFile.getAbsolutePath()); + + final ImageOutputStream imgOutStream + = ImageIO.createImageOutputStream(new FileOutputStream(imgFile)); + try { + writer.setOutput(imgOutStream); + writer.write(null, new IIOImage(image, null, null), writerParams); + } finally { + imgOutStream.close(); + } + return imgFile.length(); + } +} diff --git a/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java new file mode 100644 index 00000000000..2edb9a1f1c5 --- /dev/null +++ b/jdk/test/javax/imageio/plugins/tiff/MultiPageTest/MultiPageTest.java @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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 + * @library /lib/testlibrary/ + * @build jdk.testlibrary.* + * + * @bug 8145776 + * @author a.stepanov + * @summary A simple write-read test for the multi-page tiff. + * Create the file programmaticaly, then do some simple checks + * (number of pages, sizes, colors). Use -Dseed=X to set + * the random generator seed. + * + * @run main MultiPageTest + * @key randomness + */ + + +import java.awt.*; +import java.awt.image.*; +import java.io.*; + +import java.util.*; + +import javax.imageio.*; +import javax.imageio.stream.*; + +import jdk.testlibrary.RandomFactory; + + +public class MultiPageTest { + + private final String fileName; + + private final int NUM_IMAGES = 51; + + private final static Random rnd = RandomFactory.getRandom(); + + private final int w[], h[]; + private final Color colors[]; + private final int BLACK_SIZE = 100; + + private final int imageType; + + + public MultiPageTest(int type, String tName) { + + imageType = type; + fileName = "test__" + tName + ".tif"; + + w = new int[NUM_IMAGES + 4]; + h = new int[NUM_IMAGES + 4]; + + for (int i = 2; i < NUM_IMAGES + 2; i++) { + w[i] = 10 + rnd.nextInt(21); + h[i] = 10 + rnd.nextInt(21); + } + + w[0] = BLACK_SIZE; h[0] = BLACK_SIZE; + w[1] = BLACK_SIZE; h[1] = BLACK_SIZE; + w[NUM_IMAGES + 2] = BLACK_SIZE; h[NUM_IMAGES + 2] = BLACK_SIZE; + w[NUM_IMAGES + 3] = BLACK_SIZE; h[NUM_IMAGES + 3] = BLACK_SIZE; + + + colors = new Color[NUM_IMAGES + 4]; + for (int i = 2; i < NUM_IMAGES + 2; ++i) { + colors[i] = new Color( + rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256)); + } + + colors[0] = Color.black; + colors[1] = Color.black; + colors[NUM_IMAGES + 2] = Color.black; + colors[NUM_IMAGES + 3] = Color.black; + } + + + private ImageWriter getTIFFWriter() throws Exception { + + Iterator writers = ImageIO.getImageWritersByFormatName("TIFF"); + if (!writers.hasNext()) { + throw new RuntimeException("No writers available for " + fileName); + } + return writers.next(); + } + + private ImageReader getTIFFReader() throws Exception { + + Iterator readers = ImageIO.getImageReadersByFormatName("TIFF"); + if (!readers.hasNext()) { + throw new RuntimeException("No readers available for " + fileName); + } + return readers.next(); + } + + + private void createImage() throws Exception { + + OutputStream s = new BufferedOutputStream(new FileOutputStream(fileName)); + try (ImageOutputStream ios = ImageIO.createImageOutputStream(s)) { + + ImageWriter writer = getTIFFWriter(); + writer.setOutput(ios); + + Graphics g; + + BufferedImage blackImg = + new BufferedImage(BLACK_SIZE, BLACK_SIZE, imageType); + g = blackImg.getGraphics(); + g.setColor(Color.black); + g.fillRect(0, 0, BLACK_SIZE, BLACK_SIZE); + + writer.prepareWriteSequence(null); + + for (int i = 2; i < NUM_IMAGES + 2; i++) { + BufferedImage img = new BufferedImage(w[i], h[i], imageType); + + g = img.getGraphics(); + g.setColor(colors[i]); + g.fillRect(0, 0, w[i], h[i]); + + writer.writeToSequence(new IIOImage(img, null, null), null); + } + + writer.endWriteSequence(); + + // check: insert to the beginning + writer.writeInsert(0, new IIOImage(blackImg, null, null), null); + + // check: insert to non-zero position + writer.writeInsert(1, new IIOImage(blackImg, null, null), null); + + // check: append to the end by index + writer.writeInsert(NUM_IMAGES + 2, + new IIOImage(blackImg, null, null), null); + + // check: append to the end using index "-1" + writer.writeInsert(-1, new IIOImage(blackImg, null, null), null); + + ios.flush(); + writer.dispose(); + } + s.close(); + } + + + + private void readAndCheckImage() throws Exception { + + ImageReader reader = getTIFFReader(); + + ImageInputStream s = ImageIO.createImageInputStream(new File(fileName)); + reader.setInput(s); + + + // check number of pages + if ((NUM_IMAGES + 4) != reader.getNumImages(true)) { + throw new RuntimeException("invalid number of images!"); + } + + // check colors / sizes + for (int i = 0; i < NUM_IMAGES + 4; i++) { + + BufferedImage img = reader.read(i); + + int imw = w[i], imh = h[i]; + + if ( (img.getWidth() != imw) || (img.getHeight() != imh) ) { + throw new RuntimeException("NOK: size(" + i + ")"); + } + + Color + c1 = new Color(img.getRGB(0, 0)), + c2 = new Color(img.getRGB(imw / 2, imh / 2)), + c3 = new Color(img.getRGB(imw - 1, imh - 1)); + if (! (c1.equals(colors[i]) && c1.equals(c2) && c1.equals(c3) ) ) { + throw new RuntimeException("NOK: color(" + i + ")"); + } + } + + reader.dispose(); + s.close(); + } + + public void doTest() throws Exception { + createImage(); + readAndCheckImage(); + } + + public static void main(String[] args) throws Exception { + + int types[] = new int[]{ + BufferedImage.TYPE_INT_RGB, + BufferedImage.TYPE_INT_ARGB, + BufferedImage.TYPE_INT_ARGB_PRE, + BufferedImage.TYPE_INT_BGR, + BufferedImage.TYPE_3BYTE_BGR, + BufferedImage.TYPE_4BYTE_ABGR, + BufferedImage.TYPE_4BYTE_ABGR_PRE + }; + + String names[] = new String[]{ + "TYPE_INT_RGB", + "TYPE_INT_ARGB", + "TYPE_INT_ARGB_PRE", + "TYPE_INT_BGR", + "TYPE_3BYTE_BGR", + "TYPE_4BYTE_ABGR", + "TYPE_4BYTE_ABGR_PRE" + }; + + for (int i = 0; i < types.length; i++) { + System.out.println("image type: " + names[i]); + (new MultiPageTest(types[i], names[i])).doTest(); + } + } +} diff --git a/jdk/test/javax/sound/sampled/AudioInputStream/SkipOnConvertSampleSize.java b/jdk/test/javax/sound/sampled/AudioInputStream/SkipOnConvertSampleSize.java new file mode 100644 index 00000000000..9ed02136301 --- /dev/null +++ b/jdk/test/javax/sound/sampled/AudioInputStream/SkipOnConvertSampleSize.java @@ -0,0 +1,106 @@ +/* + * 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. + * + * 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.io.ByteArrayInputStream; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioFormat.Encoding; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +/** + * @test + * @bug 6459818 + * @summary Audio A-law and law decoder skip() method not implemented + * @author Klaus Jaensch + */ +public class SkipOnConvertSampleSize { + + private static final int TEST_FRAME_LENGTH = 20000; + + private static void testskipping(final Encoding encoding) throws Exception { + + // create temporary PCM_SIGNED audio file + int pcmBufSize = TEST_FRAME_LENGTH * 2; + byte[] tempAudioBuf = new byte[pcmBufSize]; + for (int i = 0; i < TEST_FRAME_LENGTH; i++) { + // fill with noise + tempAudioBuf[i * 2] = (byte) ((Math.random() - 1) * Byte.MAX_VALUE); + tempAudioBuf[i * 2 + 1] = (byte) ((Math.random() - 1) + * Byte.MAX_VALUE); + } + final ByteArrayInputStream bis = new ByteArrayInputStream(tempAudioBuf); + AudioFormat format = new AudioFormat(8000, 16, 1, true, false); + final AudioInputStream testAis = new AudioInputStream(bis, format, + TEST_FRAME_LENGTH); + final AudioFormat lawFormat; + final byte[] alawAudioBuf; + try (AudioInputStream lawStream = AudioSystem.getAudioInputStream( + encoding, testAis)) { + + lawFormat = lawStream.getFormat(); + int alawFrameSize = lawFormat.getFrameSize(); + + int lawBufSize = TEST_FRAME_LENGTH * alawFrameSize; + alawAudioBuf = new byte[lawBufSize]; + int r1 = 0; + int totalRead = 0; + while ((r1 = lawStream.read(alawAudioBuf, totalRead, + lawBufSize - totalRead)) != -1) { + totalRead += r1; + } + } + + // Convert back to PCM + + ByteArrayInputStream alawBis = new ByteArrayInputStream(alawAudioBuf); + AudioInputStream lawAis = new AudioInputStream(alawBis, lawFormat, + TEST_FRAME_LENGTH); + try (AudioInputStream convPcmStream = AudioSystem.getAudioInputStream( + Encoding.PCM_SIGNED, lawAis)) { + final AudioFormat convPcmAudioFormat = convPcmStream.getFormat(); + final int convPcmFrameSize = convPcmAudioFormat.getFrameSize(); + + // skip half of the stream + final long toSkip = (TEST_FRAME_LENGTH / 2) * convPcmFrameSize; + long skipped = 0; + do { + skipped += convPcmStream.skip(toSkip - skipped); + } while (skipped < toSkip); + int r2 = convPcmStream.read(new byte[convPcmFrameSize]); + // if skip is not correctly implemented we are at the end of the + // stream + if (r2 == -1) { + throw new RuntimeException( + "Skip method of decoder not correctly implemented!"); + } + // otherwise we could read the rest ... + // we don't do it here + } + } + + public static void main(final String[] args) throws Exception { + testskipping(Encoding.ALAW); + testskipping(Encoding.ULAW); + } +} diff --git a/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java b/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java index 8ddae19a0aa..770e774f609 100644 --- a/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java +++ b/jdk/test/javax/sound/sampled/DirectAudio/bug6400879.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. * 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,12 +21,13 @@ * questions. */ -/* @test - @bug 6400879 - @bug 7100140 - @summary Tests that Start/Stop sequence doesn't hang - @author Alexey Menkov - @run main bug6400879 +/* + * @test + * @bug 6400879 7100140 + * @summary Tests that Start/Stop sequence doesn't hang + * @author Alexey Menkov + * @run main bug6400879 + * @key intermittent */ import javax.sound.sampled.*; diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileReader/RecognizeWaveExtensible.java b/jdk/test/javax/sound/sampled/spi/AudioFileReader/RecognizeWaveExtensible.java new file mode 100644 index 00000000000..59f9d24ade1 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileReader/RecognizeWaveExtensible.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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.io.ByteArrayInputStream; +import java.io.InputStream; + +import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +/** + * @test + * @bug 8147407 + */ +public final class RecognizeWaveExtensible { + + private static byte[] data = { + 82, 73, 70, 70, 72, 0, 0, 0, 87, 65, 86, 69, 102, 109, 116, 32, 40, + 0, 0, 0, -2, -1, 1, 0, 64, 31, 0, 0, 0, 125, 0, 0, 4, 0, 32, 0, 22, + 0, 32, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 16, 0, -128, 0, 0, -86, 0, + 56, -101, 113, 102, 97, 99, 116, 4, 0, 0, 0, 0, 0, 0, 0, 100, 97, + 116, 97, 0, 0, 0, 0 + }; + + public static void main(final String[] args) throws Exception { + final InputStream is = new ByteArrayInputStream(data); + final AudioFileFormat aff = AudioSystem.getAudioFileFormat(is); + System.out.println("AudioFileFormat: " + aff); + try (AudioInputStream ais = AudioSystem.getAudioInputStream(is)) { + System.out.println("AudioFormat: " + ais.getFormat()); + } + System.out.println("new String(data) = " + new String(data)); + } +} diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java b/jdk/test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java new file mode 100644 index 00000000000..1f30587889b --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileReader/ShortHeader.java @@ -0,0 +1,179 @@ +/* + * 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. + * + * 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.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.nio.file.Files; +import java.util.Arrays; + +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.UnsupportedAudioFileException; +import javax.sound.sampled.spi.AudioFileReader; + +import static java.util.ServiceLoader.load; + +/** + * @test + * @bug 8131974 + * @summary Short files should be reported as unsupported + */ +public final class ShortHeader { + + private static byte[] W = {-12, 3, 45}; + + private static byte[] R = new byte[3]; + + public static void main(final String[] args) throws Exception { + final File file = Files.createTempFile("audio", "test").toFile(); + file.deleteOnExit(); + try (final OutputStream fos = new FileOutputStream(file)) { + fos.write(W); + } + + testAS(file); + for (final AudioFileReader afr : load(AudioFileReader.class)) { + testAFR(afr, file); + } + } + + /** + * Tests the part of AudioSystem API, which implemented via + * AudioFileReader. + * + * @see AudioSystem#getAudioFileFormat(InputStream) + * @see AudioSystem#getAudioFileFormat(File) + * @see AudioSystem#getAudioFileFormat(URL) + * @see AudioSystem#getAudioInputStream(InputStream) + * @see AudioSystem#getAudioInputStream(File) + * @see AudioSystem#getAudioInputStream(URL) + */ + private static void testAS(final File file) throws IOException { + try { + AudioSystem.getAudioFileFormat(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioFileFormat(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioInputStream(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioInputStream(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + + // AudioSystem.getAudioXXX(stream) should properly reset the stream + + try (FileInputStream fis = new FileInputStream(file); + InputStream stream = new BufferedInputStream(fis)) { + + try { + AudioSystem.getAudioFileFormat(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + AudioSystem.getAudioInputStream(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + stream.read(R, 0, R.length); + } + + if (!Arrays.equals(R, W)) { + System.err.println("Expected = " + Arrays.toString(W)); + System.err.println("Actual = " + Arrays.toString(R)); + throw new RuntimeException(); + } + } + /** + * Tests the AudioFileReader API directly. + * + * @see AudioFileReader#getAudioFileFormat(InputStream) + * @see AudioFileReader#getAudioFileFormat(File) + * @see AudioFileReader#getAudioFileFormat(URL) + * @see AudioFileReader#getAudioInputStream(InputStream) + * @see AudioFileReader#getAudioInputStream(File) + * @see AudioFileReader#getAudioInputStream(URL) + */ + private static void testAFR(final AudioFileReader fcp, final File file) + throws Exception { + try { + fcp.getAudioFileFormat(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioFileFormat(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioInputStream(file); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioInputStream(file.toURL()); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + + // AudioFileReader should properly reset the stream + + try (FileInputStream fis = new FileInputStream(file); + InputStream stream = new BufferedInputStream(fis)) { + + try { + fcp.getAudioFileFormat(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + try { + fcp.getAudioInputStream(stream); + throw new RuntimeException(); + } catch (final UnsupportedAudioFileException ignored) { + } + stream.read(R, 0, R.length); + } + + if (!Arrays.equals(R, W)) { + System.err.println("Expected = " + Arrays.toString(W)); + System.err.println("Actual = " + Arrays.toString(R)); + throw new RuntimeException(); + } + } +} diff --git a/jdk/test/javax/sound/sampled/spi/AudioFileWriter/WriteUnsupportedAudioFormat.java b/jdk/test/javax/sound/sampled/spi/AudioFileWriter/WriteUnsupportedAudioFormat.java new file mode 100644 index 00000000000..893205944c3 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/AudioFileWriter/WriteUnsupportedAudioFormat.java @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.sound.sampled.AudioFileFormat; +import javax.sound.sampled.AudioFileFormat.Type; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.AudioFileWriter; + +import static java.util.ServiceLoader.load; +import static javax.sound.sampled.AudioFileFormat.Type.AIFC; +import static javax.sound.sampled.AudioFileFormat.Type.AIFF; +import static javax.sound.sampled.AudioFileFormat.Type.AU; +import static javax.sound.sampled.AudioFileFormat.Type.SND; +import static javax.sound.sampled.AudioFileFormat.Type.WAVE; + +/** + * @test + * @bug 8064800 + */ +public final class WriteUnsupportedAudioFormat { + + /** + * We will try to use all formats, in this case all our providers will be + * covered by supported/unsupported formats. + */ + private static final List formats = new ArrayList<>(23000); + + private static final AudioFormat.Encoding[] encodings = { + AudioFormat.Encoding.ALAW, AudioFormat.Encoding.ULAW, + AudioFormat.Encoding.PCM_SIGNED, AudioFormat.Encoding.PCM_UNSIGNED, + AudioFormat.Encoding.PCM_FLOAT, new AudioFormat.Encoding("Test") + }; + + private static final int[] sampleRates = { + /*AudioSystem.NOT_SPECIFIED,*/ 8000, 11025, 16000, 22050, 32000, + 37800, 44056, 44100, 47250, 48000, 50000, 50400, 88200, 96000, + 176400, 192000, 352800, 2822400, 5644800 + }; + + private static final int[] sampleBits = { + /*AudioSystem.NOT_SPECIFIED, 4,*/ 8,/* 11,*/ 16/*, 20*/, 24, + 32/*, 48, 64, 128*/ + }; + + public static final int BUFFER_LEN = 127; + + private static final int[] channels = { + /*AudioSystem.NOT_SPECIFIED,*/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + }; + + static final Type[] types = { + WAVE, AU, AIFF, AIFC, SND, new Type("TestName", "TestExt") + }; + + private static final File FILE; + + static { + try { + FILE = File.createTempFile("sound", null); + } catch (final IOException e) { + throw new RuntimeException(e); + } + FILE.deleteOnExit(); + + for (final Boolean end : new boolean[]{false, true}) { + for (final int sampleSize : sampleBits) { + for (final int sampleRate : sampleRates) { + for (final int channel : channels) { + for (final AudioFormat.Encoding enc : encodings) { + + if (enc.equals(AudioFormat.Encoding.PCM_FLOAT) + && sampleSize != 32) { + continue; + } + if (enc.equals(AudioFormat.Encoding.ALAW) + && sampleSize != 8) { + continue; + } + if (enc.equals(AudioFormat.Encoding.ULAW) + && sampleSize != 8) { + continue; + } + + final int frameSize = ((sampleSize + 7) / 8) + * channel; + formats.add( + new AudioFormat(enc, sampleRate, sampleSize, + channel, frameSize, + sampleRate, end)); + } + } + } + } + } + } + + public static void main(final String[] args) throws Exception { + for (final AudioFileFormat.Type type : types) { + for (final AudioFormat format : formats) { + testAS(type, format); + for (final AudioFileWriter afw : load(AudioFileWriter.class)) { + testAFW(afw, type, format); + } + } + } + } + + /** + * Tests the part of AudioSystem API, which implemented via AudioFileWriter. + */ + private static void testAS(final AudioFileFormat.Type type, + final AudioFormat format) throws Exception { + final AudioInputStream ais = getStream(format); + final OutputStream buffer = new ByteArrayOutputStream(BUFFER_LEN); + + if (AudioSystem.isFileTypeSupported(type, ais)) { + if (!AudioSystem.isFileTypeSupported(type)) { + throw new RuntimeException(type + ", " + format); + } + try { + AudioSystem.write(ais, type, buffer); + AudioSystem.write(ais, type, FILE); + } catch (final IllegalArgumentException e) { + throw new RuntimeException(type + ", " + format, e); + } + } else { + try { + AudioSystem.write(ais, type, buffer); + throw new RuntimeException(type + ", " + format); + } catch (final IllegalArgumentException ignored) { + } + try { + AudioSystem.write(ais, type, FILE); + throw new RuntimeException(type + ", " + format); + } catch (final IllegalArgumentException ignored) { + } + } + } + + /** + * Tests the AudioFileWriter API directly. + */ + private static void testAFW(final AudioFileWriter afw, + final AudioFileFormat.Type type, + final AudioFormat format) throws Exception { + final AudioInputStream ais = getStream(format); + final OutputStream buffer = new ByteArrayOutputStream(BUFFER_LEN); + + if (afw.isFileTypeSupported(type, ais)) { + if (!afw.isFileTypeSupported(type)) { + throw new RuntimeException(type + "," + format + ',' + afw); + } + try { + afw.write(ais, type, buffer); + afw.write(ais, type, FILE); + } catch (final IllegalArgumentException e) { + throw new RuntimeException(type + "," + format + ',' + afw, e); + } + } else { + try { + afw.write(ais, type, buffer); + throw new RuntimeException(type + "," + format + ',' + afw); + } catch (final IllegalArgumentException ignored) { + } + try { + afw.write(ais, type, FILE); + throw new RuntimeException(type + "," + format + ',' + afw); + } catch (final IllegalArgumentException ignored) { + } + } + } + + private static AudioInputStream getStream(final AudioFormat format) { + final InputStream in = new ByteArrayInputStream(new byte[BUFFER_LEN]); + return new AudioInputStream(in, format, 10); + } +} diff --git a/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetAudioStreamConversionSupported.java b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetAudioStreamConversionSupported.java new file mode 100644 index 00000000000..c12e13f9b71 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetAudioStreamConversionSupported.java @@ -0,0 +1,132 @@ +/* + * 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. + * + * 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.io.ByteArrayInputStream; +import java.io.InputStream; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.FormatConversionProvider; + +import static java.util.ServiceLoader.load; + +/** + * @test + * @bug 8146144 + */ +public final class GetAudioStreamConversionSupported { + + static final AudioFormat.Encoding[] encodings = { + AudioFormat.Encoding.ALAW, AudioFormat.Encoding.ULAW, + AudioFormat.Encoding.PCM_SIGNED, AudioFormat.Encoding.PCM_UNSIGNED, + AudioFormat.Encoding.PCM_FLOAT, new AudioFormat.Encoding("Test") + }; + + public static void main(final String[] args) { + for (final int sampleSize : new int[]{4, 8, 16, 24, 32}) { + for (final AudioFormat.Encoding enc : encodings) { + for (final Boolean endian : new boolean[]{false, true}) { + testAS(enc, endian, sampleSize); + for (final FormatConversionProvider fcp : load + (FormatConversionProvider.class)) { + testFCP(fcp, enc, endian, sampleSize); + } + } + } + } + } + + /** + * Tests the part of AudioSystem API, which implemented via + * FormatConversionProvider. + *

          + * AudioSystem always support conversion to the same encoding/format. + */ + private static void testAS(final AudioFormat.Encoding enc, + final Boolean endian, final int sampleSize) { + final AudioInputStream ais = getStream(enc, endian, sampleSize); + final AudioFormat format = ais.getFormat(); + if (!AudioSystem.isConversionSupported(enc, format)) { + throw new RuntimeException("Format: " + format); + } + if (!AudioSystem.isConversionSupported(format, format)) { + throw new RuntimeException("Format: " + format); + } + AudioSystem.getAudioInputStream(enc, ais); + AudioSystem.getAudioInputStream(format, ais); + } + + /** + * Tests the FormatConversionProvider API directly. + */ + private static void testFCP(final FormatConversionProvider fcp, + final AudioFormat.Encoding enc, + final Boolean endian, final int sampleSize) { + System.out.println("fcp = " + fcp); + final AudioInputStream ais = getStream(enc, endian, sampleSize); + final AudioFormat frmt = ais.getFormat(); + if (fcp.isConversionSupported(enc, frmt)) { + try { + fcp.getAudioInputStream(enc, ais); + } catch (final IllegalArgumentException ex) { + throw new RuntimeException("Format: " + frmt, ex); + } + } else { + try { + fcp.getAudioInputStream(enc, ais); + throw new RuntimeException("Format: " + frmt); + } catch (final IllegalArgumentException ignored) { + } + try { + fcp.getAudioInputStream(frmt, ais); + throw new RuntimeException("Format: " + frmt); + } catch (final IllegalArgumentException ignored) { + } + } + if (fcp.isConversionSupported(frmt, frmt)) { + try { + fcp.getAudioInputStream(enc, ais); + fcp.getAudioInputStream(frmt, ais); + } catch (final IllegalArgumentException ex) { + throw new RuntimeException("Format: " + frmt, ex); + } + } else { + try { + fcp.getAudioInputStream(frmt, ais); + throw new RuntimeException("Format: " + frmt); + } catch (final IllegalArgumentException ignored) { + } + } + } + + private static AudioInputStream getStream(final AudioFormat.Encoding enc, + final Boolean end, + final int sampleSize) { + final AudioFormat ftmt + = new AudioFormat(enc, 8000, sampleSize, 1, 1, 8000, end); + final byte[] fakedata = new byte[100]; + final InputStream in = new ByteArrayInputStream(fakedata); + return new AudioInputStream(in, ftmt, fakedata.length); + } +} diff --git a/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetTargetIsSupported.java b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetTargetIsSupported.java new file mode 100644 index 00000000000..2a44b89ff19 --- /dev/null +++ b/jdk/test/javax/sound/sampled/spi/FormatConversionProvider/GetTargetIsSupported.java @@ -0,0 +1,294 @@ +/* + * 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. + * + * 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.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioFormat.Encoding; +import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.spi.FormatConversionProvider; + +import static java.util.ServiceLoader.load; + +/** + * @test + * @bug 8146144 + */ +public final class GetTargetIsSupported { + + /** + * We will try to use all formats, in this case all our providers will be + * covered by supported/unsupported formats. + */ + private static final List formats = new ArrayList<>(23000); + + private static final Encoding[] encodings = { + Encoding.ALAW, Encoding.ULAW, Encoding.PCM_SIGNED, + Encoding.PCM_UNSIGNED, Encoding.PCM_FLOAT, new Encoding("Test") + }; + + private static final int[] sampleRates = { + AudioSystem.NOT_SPECIFIED, 8000, 11025, 16000, 22050, 32000, 37800, + 44056, 44100, 47250, 48000, 50000, 50400, 88200, 96000, 176400, + 192000, 352800, 2822400, 5644800 + }; + + private static final int[] sampleBits = { + AudioSystem.NOT_SPECIFIED, 4, 8, 11, 16, 20, 24, 32, 48, 64, 128 + }; + + private static final int[] channels = { + AudioSystem.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + }; + + static { + for (final Boolean end : new boolean[]{false, true}) { + for (final int sampleSize : sampleBits) { + for (final int sampleRate : sampleRates) { + for (final int channel : channels) { + for (final Encoding enc : encodings) { + formats.add(new AudioFormat(enc, sampleRate, + sampleSize, channel, + 1, sampleRate, end)); + } + } + } + } + } + } + + public static void main(final String[] args) { + for (final AudioFormat format : formats) { + testAS(format); + for (final FormatConversionProvider fcp : load + (FormatConversionProvider.class)) { + testFCP(fcp, format); + } + } + } + + /** + * Tests the part of AudioSystem API, which implemented via + * FormatConversionProvider. + * + * @see AudioSystem#getTargetEncodings(Encoding) + * @see AudioSystem#getTargetEncodings(AudioFormat) + * @see AudioSystem#getTargetFormats(Encoding, AudioFormat) + * @see AudioSystem#isConversionSupported(AudioFormat, AudioFormat) + * @see AudioSystem#isConversionSupported(Encoding, AudioFormat) + */ + private static void testAS(final AudioFormat source) { + Encoding[] all = AudioSystem.getTargetEncodings(source.getEncoding()); + Encoding[] part = AudioSystem.getTargetEncodings(source); + + // Check encodings which are reported as supported + for (final Encoding enc : part) { + // If encoding is reported for the source format means that + // the list of target formats should not be empty + AudioFormat[] targets = AudioSystem.getTargetFormats(enc, source); + // all reported formats should be supported + for (final AudioFormat target : targets) { + if (!AudioSystem.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + // If encoding is reported for the source format means that + // conversion source -> encoding is supported + if (!AudioSystem.isConversionSupported(enc, source)) { + throw new RuntimeException("Error:" + enc); + } + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (source.getEncoding().equals(enc)) { + // this is unspecified but we works this way + if (!isContains(source, targets)) { + throw new RuntimeException("Error:" + enc); + } + } else { + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + } + } + + // Check all encodings + for (final Encoding enc : encodings) { + AudioFormat[] targets = AudioSystem.getTargetFormats(enc, source); + // If target format is reported for the source format means that + // conversion source -> target is supported + for (final AudioFormat target : targets) { + if (!AudioSystem.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + if (AudioSystem.isConversionSupported(enc, source)) { + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + if (!Arrays.asList(part).contains(enc)) { + System.out.println("enc = " + enc); + System.out.println("part = " + Arrays.toString(part)); + System.out.println("source = " + source); + throw new RuntimeException("Error:" + enc); + } + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (source.getEncoding().equals(enc)) { + // this is unspecified but we works this way + if (!isContains(source, targets)) { + throw new RuntimeException("Error:" + enc); + } + } else { + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + } + } else { + // If conversion source -> encoding is not supported then an + // array of target formats should be empty + if (targets.length != 0) { + throw new RuntimeException("Error:" + enc); + } + if (Arrays.asList(part).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + } + } + + /** + * Tests the FormatConversionProvider API directly. + * + * @see FormatConversionProvider#getTargetEncodings() + * @see FormatConversionProvider#getTargetEncodings(AudioFormat) + * @see FormatConversionProvider#getTargetFormats(Encoding, AudioFormat) + * @see FormatConversionProvider#isTargetEncodingSupported(Encoding) + * @see FormatConversionProvider#isConversionSupported(Encoding, + * AudioFormat) + * @see FormatConversionProvider#isConversionSupported(AudioFormat, + * AudioFormat) + */ + private static void testFCP(final FormatConversionProvider fcp, + final AudioFormat source) { + final Encoding[] all = fcp.getTargetEncodings(); + for (final Encoding enc : all) { + if (!fcp.isTargetEncodingSupported(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + + // Check encodings which are reported as supported + final Encoding[] part = fcp.getTargetEncodings(source); + for (final Encoding enc : part) { + // If encoding is reported for the source format means that + // the list of target formats should not be empty for this encoding + AudioFormat[] targets = fcp.getTargetFormats(enc, source); + // all reported formats should be supported + for (final AudioFormat target : targets) { + if (!fcp.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + // If encoding is reported for the source format means that + // conversion source -> encoding is supported + if (!fcp.isConversionSupported(enc, source)) { + throw new RuntimeException("Error:" + enc); + } + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + // Check all encodings + for (final Encoding enc : encodings) { + AudioFormat[] targets = fcp.getTargetFormats(enc, source); + // If target format is reported for the source format means that + // conversion source -> target is supported + for (final AudioFormat target : targets) { + if (!fcp.isConversionSupported(target, source)) { + throw new RuntimeException("Error:" + enc); + } + if (!enc.equals(target.getEncoding())) { + throw new RuntimeException("Error:" + enc); + } + } + if (fcp.isConversionSupported(enc, source)) { + // If conversion source -> encoding is supported then an + // array of target formats should not be empty + if (targets.length == 0) { + throw new RuntimeException("Error:" + enc); + } + // encoding for a particular source should be included in the + // list of all encodings for the source's encoding + if (!Arrays.asList(all).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + if (!Arrays.asList(part).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } else { + // If conversion source -> encoding is not supported then an + // array of target formats should be empty + if (targets.length != 0) { + throw new RuntimeException("Error:" + enc); + } + if (Arrays.asList(part).contains(enc)) { + throw new RuntimeException("Error:" + enc); + } + } + } + } + + private static boolean isContains(AudioFormat obj, AudioFormat[] array) { + for (final AudioFormat format : array) { + if (obj.matches(format)) { + return true; + } + } + return false; + } +} diff --git a/jdk/test/javax/swing/Action/8133039/bug8133039.java b/jdk/test/javax/swing/Action/8133039/bug8133039.java new file mode 100644 index 00000000000..94ad929707b --- /dev/null +++ b/jdk/test/javax/swing/Action/8133039/bug8133039.java @@ -0,0 +1,180 @@ +/* + * 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. + * + * 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.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import sun.swing.UIAction; + +/** + * @test + * @bug 8133039 + * @summary Provide public API to sun.swing.UIAction#isEnabled(Object) + * @author Alexander Scherbatiy + */ +public class bug8133039 { + + private static volatile int ACTION_PERFORMED_CALLS = 0; + private static volatile int ACTION_ACCEPTED_CALLS = 0; + + public static void main(String[] args) throws Exception { + testActionNotification(); + testPopupAction(); + } + + private static void testActionNotification() { + + KeyEvent keyEvent = new KeyEvent(new JLabel("Test"), 0, 0, 0, 0, 'A'); + SenderObject rejectedSenderObject = new SenderObject(); + SwingUtilities.notifyAction(new TestAction(false), null, keyEvent, + rejectedSenderObject, 0); + + if (rejectedSenderObject.accepted) { + throw new RuntimeException("The sender is incorrectly accepted!"); + } + + if (rejectedSenderObject.performed) { + throw new RuntimeException("The action is incorrectly performed!"); + } + + SenderObject acceptedSenderObject = new SenderObject(); + SwingUtilities.notifyAction(new TestAction(true), null, keyEvent, + acceptedSenderObject, 0); + + if (!acceptedSenderObject.accepted) { + throw new RuntimeException("The sender is not accepted!"); + } + + if (!acceptedSenderObject.performed) { + throw new RuntimeException("The action is not performed!"); + } + } + + private static void testPopupAction() throws Exception { + + SwingUtilities.invokeAndWait(bug8133039::createAndShowGUI); + + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.waitForIdle(); + + robot.keyPress(KeyEvent.VK_A); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + + if (ACTION_ACCEPTED_CALLS != 1) { + throw new RuntimeException("Method accept is not invoked!"); + } + + if (ACTION_PERFORMED_CALLS != 1) { + throw new RuntimeException("Method actionPerformed is not invoked!"); + } + + robot.keyPress(KeyEvent.VK_A); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + + if (ACTION_ACCEPTED_CALLS != 2) { + throw new RuntimeException("Method accept is not invoked!"); + } + + if (ACTION_PERFORMED_CALLS != 1) { + throw new RuntimeException("Method actionPerformed is invoked twice!"); + } + } + + private static void createAndShowGUI() { + + JFrame frame = new JFrame(); + frame.setSize(300, 300); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JComboBox comboBox = new JComboBox<>(new String[]{"1", "2", "3"}); + + Action showPopupAction = new ShowPopupAction(); + comboBox.getInputMap().put(KeyStroke.getKeyStroke("A"), "showPopup"); + comboBox.getActionMap().put("showPopup", showPopupAction); + + frame.getContentPane().add(comboBox); + frame.setVisible(true); + } + + private static class ShowPopupAction extends UIAction { + + public ShowPopupAction() { + super("showPopup"); + } + + @Override + public void actionPerformed(ActionEvent e) { + ACTION_PERFORMED_CALLS++; + Object src = e.getSource(); + if (src instanceof JComboBox) { + ((JComboBox) src).showPopup(); + } + } + + @Override + public boolean accept(Object sender) { + ACTION_ACCEPTED_CALLS++; + if (sender instanceof JComboBox) { + JComboBox c = (JComboBox) sender; + return !c.isPopupVisible(); + } + return false; + } + } + + private static class SenderObject { + + private boolean accepted; + private boolean performed; + } + + private static class TestAction extends AbstractAction { + + private final boolean acceptSender; + + public TestAction(boolean acceptSender) { + this.acceptSender = acceptSender; + } + + @Override + public boolean accept(Object sender) { + ((SenderObject) sender).accepted = acceptSender; + return acceptSender; + } + + @Override + public void actionPerformed(ActionEvent e) { + ((SenderObject) e.getSource()).performed = true; + } + } +} diff --git a/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java b/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java new file mode 100644 index 00000000000..4296d48fd2d --- /dev/null +++ b/jdk/test/javax/swing/JFileChooser/8016665/JFileChooserOrientation.java @@ -0,0 +1,253 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8016665 + * @summary verifies different behaviour of JFileChooser changing orientation + * @run main JFileChooserOrientation + */ +import java.awt.Color; +import java.awt.ComponentOrientation; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +public class JFileChooserOrientation { + + private static JFrame frame; + private static GridBagLayout layout; + private static JPanel panel; + private static JPanel lookAndFeelPanel; + private static JPanel orientationPanel; + private static JPanel passFailPanel; + private static JTextArea instructionsTextArea; + private static JLabel lookAndFeelLabel; + private static JLabel orientationLabel; + private static JComboBox lookAndFeelComboBox; + private static JComboBox orientationComboBox; + + private static JButton fileChooserButton; + private static JButton passButton; + private static JButton failButton; + private static JFileChooser openChooser; + private static UIManager.LookAndFeelInfo[] lookAndFeelArray; + + private static final String orientationLTR = " Left to Right"; + private static final String orientationRTL = " Right to Left"; + private static final String fileChooserString = "Show File Chooser"; + + public static void main(String[] args) throws Exception { + createManualTestUI(); + } + + private static void createManualTestUI() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + layout = new GridBagLayout(); + GridBagConstraints gbc = new GridBagConstraints(); + panel = new JPanel(layout); + gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.gridx = 0; + gbc.gridy = 0; + instructionsTextArea = new JTextArea(); + String instructions + = "1) Select Look and feel from combobox" + + "\n2) Select component orientation" + + "\n3) Click on \"Show File Chooser\"" + + "\n4) Check if orientation is as selected" + + "\n5) Press \"Cancel\" on the File Chooser Dialog" + + "\n\n Perform steps 1- 4 for all LAFs & orientations" + + "\n If all are correct press Pass or else press Fail"; + instructionsTextArea.setText(instructions); + instructionsTextArea.setBorder( + BorderFactory.createLineBorder(Color.black)); + panel.add(instructionsTextArea, gbc); + + lookAndFeelPanel = new JPanel(); + lookAndFeelPanel.setBorder( + BorderFactory.createLineBorder(Color.black)); + lookAndFeelLabel = new JLabel("Look And Feel: "); + gbc.gridx = 0; + gbc.gridy = 0; + lookAndFeelPanel.add(lookAndFeelLabel, gbc); + + lookAndFeelComboBox = new JComboBox(); + lookAndFeelArray = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem + : lookAndFeelArray) { + lookAndFeelComboBox.addItem(lookAndFeelItem.getClassName()); + } + gbc.gridx = 1; + gbc.gridy = 0; + lookAndFeelPanel.add(lookAndFeelComboBox, gbc); + gbc.gridx = 0; + gbc.gridy = 1; + panel.add(lookAndFeelPanel, gbc); + + orientationPanel = new JPanel(); + orientationPanel.setBorder( + BorderFactory.createLineBorder(Color.black)); + orientationLabel = new JLabel("Orientation: "); + gbc.gridx = 0; + gbc.gridy = 0; + orientationPanel.add(orientationLabel, gbc); + + orientationComboBox = new JComboBox(); + orientationComboBox.addItem(orientationLTR); + orientationComboBox.addItem(orientationRTL); + gbc.gridx = 1; + gbc.gridy = 0; + orientationPanel.add(orientationComboBox, gbc); + gbc.gridx = 0; + gbc.gridy = 2; + panel.add(orientationPanel, gbc); + + fileChooserButton = new JButton(fileChooserString); + fileChooserButton.setActionCommand(fileChooserString); + + fileChooserButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + + try { + showFileChooser(); + } catch (Exception ex) { + Logger.getLogger(JFileChooserOrientation.class + .getName()).log(Level.SEVERE, null, ex); + } + + } + }); + gbc.gridx = 0; + gbc.gridy = 3; + panel.add(fileChooserButton, gbc); + + passFailPanel = new JPanel(); + passFailPanel.setBorder(BorderFactory.createLineBorder(Color.black)); + passButton = new JButton(" Pass "); + passButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + pass(); + } catch (Exception ex) { + Logger.getLogger(JFileChooserOrientation.class + .getName()).log(Level.SEVERE, null, ex); + } + } + }); + gbc.gridx = 0; + gbc.gridy = 0; + passFailPanel.add(passButton, gbc); + failButton = new JButton(" Fail "); + failButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + fail(); + } catch (Exception ex) { + Logger.getLogger(JFileChooserOrientation.class + .getName()).log(Level.SEVERE, null, ex); + } + } + }); + gbc.gridx = 1; + gbc.gridy = 0; + passFailPanel.add(failButton, gbc); + gbc.gridx = 0; + gbc.gridy = 4; + panel.add(passFailPanel, gbc); + frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setContentPane(panel); + frame.pack(); + frame.setVisible(true); + } + }); + } + + private static void pass() throws Exception + { + + frame.dispose(); + + } + + private static void fail() throws Exception + { + + frame.dispose(); + System.err.println(lookAndFeelComboBox.getSelectedItem().toString() + + " : Incorrect Orientation"); + } + + private static void showFileChooser() throws Exception { + if (tryLookAndFeel(lookAndFeelComboBox.getSelectedItem().toString())) { + + openChooser = new JFileChooser(); + + ComponentOrientation orientation + = ComponentOrientation.UNKNOWN; + + switch (orientationComboBox.getSelectedItem().toString()) { + case orientationLTR: + orientation = ComponentOrientation.LEFT_TO_RIGHT; + break; + case orientationRTL: + orientation = ComponentOrientation.RIGHT_TO_LEFT; + break; + } + openChooser.setComponentOrientation(orientation); + openChooser.showOpenDialog(frame); + + } + } + private static boolean tryLookAndFeel(String lookAndFeelString) + throws Exception { + try { + UIManager.setLookAndFeel( + lookAndFeelString); + } catch (UnsupportedLookAndFeelException + | ClassNotFoundException + | InstantiationException + | IllegalAccessException e) { + return false; + } + return true; + } +} diff --git a/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java b/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java new file mode 100644 index 00000000000..12bd49d1b49 --- /dev/null +++ b/jdk/test/javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java @@ -0,0 +1,123 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4769772 + * @summary JInternalFrame.setIcon(true) before JDesktopPane.add(JIF) causes wrong state + * @run main TestJInternalFrameIconify + */ +import java.beans.PropertyVetoException; +import javax.swing.JFrame; +import javax.swing.JDesktopPane; +import javax.swing.JInternalFrame; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import java.awt.Robot; +import javax.swing.SwingUtilities; + +public class TestJInternalFrameIconify { + + private static JDesktopPane desktopPane; + private static JFrame frame; + private static Robot robot; + private static volatile String errorMessage = ""; + + public static void main(String[] args) throws Exception { + robot = new java.awt.Robot(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + String lookAndFeelString = lookAndFeelItem.getClassName(); + if (tryLookAndFeel(lookAndFeelString)) { + createUI(lookAndFeelString); + robot.waitForIdle(); + executeTest(lookAndFeelString); + } + } + if (!"".equals(errorMessage)) { + throw new RuntimeException(errorMessage); + } + } + + private static boolean tryLookAndFeel(String lookAndFeelString) { + try { + UIManager.setLookAndFeel(lookAndFeelString); + return true; + } catch (UnsupportedLookAndFeelException | ClassNotFoundException | + InstantiationException | IllegalAccessException e) { + errorMessage += e.getMessage() + "\n"; + System.err.println("Caught Exception: " + e.getMessage()); + return false; + } + } + + private static void createUI(String lookAndFeelString) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame = new JFrame(lookAndFeelString); + desktopPane = new JDesktopPane(); + frame.getContentPane().add(desktopPane); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JInternalFrame f = new JInternalFrame("Child ", true, true, + true, true); + f.setSize(200, 300); + f.setLocation(20, 20); + try { + f.setIcon(true); + } catch (PropertyVetoException ex) { + errorMessage += ex.getMessage() + "\n"; + } + desktopPane.add(f); + f.setVisible(true); + + frame.setSize(500, 500); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + }); + + } + + private static void executeTest(String lookAndFeelString) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + try { + JInternalFrame internalFrames[] + = desktopPane.getAllFrames(); + if (internalFrames[0].isShowing()) { + errorMessage += "Test Failed for " + + lookAndFeelString + " look and feel\n"; + System.err.println(errorMessage); + } + } finally { + frame.dispose(); + } + } + }); + } +} diff --git a/jdk/test/javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java b/jdk/test/javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java new file mode 100644 index 00000000000..a8e4001e704 --- /dev/null +++ b/jdk/test/javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java @@ -0,0 +1,180 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8145060 + * @summary Minimizing a JInternalFrame not shifting focus to frame below it + * @library ../../regtesthelpers + * @build Util + * @run main TestJInternalFrameMinimize + */ +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.InputEvent; +import java.beans.PropertyVetoException; +import javax.swing.JFrame; +import javax.swing.JDesktopPane; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; +import javax.swing.Timer; + +public class TestJInternalFrameMinimize { + + private static JDesktopPane desktopPane; + private static JFrame frame = new JFrame("Test Frame"); + private static int count = 0; + private static JMenu menu; + private static JMenuBar menuBar; + private static JMenuItem menuItem; + private static Robot robot; + private static ActionListener listener; + private static Timer timer; + private static int counter; + private static boolean testFailed; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + createUI(); + } + }); + robot.waitForIdle(); + executeTest(); + if (testFailed) { + throw new RuntimeException("Test Failed"); + } + dispose(); + } + + private static void createUI() { + + desktopPane = new JDesktopPane(); + frame.getContentPane().add(desktopPane); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + menuBar = new JMenuBar(); + frame.setJMenuBar(menuBar); + + menu = new JMenu("File"); + menuBar.add(menu); + + menuItem = new JMenuItem("New Child"); + menuItem.addActionListener( + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + JInternalFrame f = new JInternalFrame("Child " + + (++count), true, true, true, true); + f.setSize(200, 300); + f.setLocation(count * 20, count * 20); + desktopPane.add(f); + f.setVisible(true); + } + }); + menu.add(menuItem); + frame.setSize(500, 500); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + private static void executeTest() throws Exception { + + Point point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + point = Util.getCenterPoint(menu); + performMouseOperations(point); + point = Util.getCenterPoint(menuItem); + performMouseOperations(point); + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + listener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent ae) { + JInternalFrame internalFrame + = desktopPane.getSelectedFrame(); + if (internalFrame != null) { + try { + internalFrame.setIcon(true); + ++counter; + } catch (PropertyVetoException ex) { + } + } + if (counter == 4) { + try { + timer.stop(); + JInternalFrame currentSelectedFrame + = desktopPane.getSelectedFrame(); + if (internalFrame.equals(currentSelectedFrame)) { + frame.dispose(); + testFailed = true; + } + } catch (Exception ex) { + } + } + } + }; + } + }); + timer = new Timer(100, listener); + timer.start(); + robot.delay(1000); + } + + private static void dispose() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + + @Override + public void run() { + frame.dispose(); + } + }); + } + + private static void performMouseOperations(Point point) { + robot.mouseMove(point.x, point.y); + robot.mousePress(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.delay(1000); + robot.waitForIdle(); + } +} diff --git a/jdk/test/javax/swing/JMenu/8067346/bug8067346.java b/jdk/test/javax/swing/JMenu/8067346/bug8067346.java index ffa2fe4a034..561bf466127 100644 --- a/jdk/test/javax/swing/JMenu/8067346/bug8067346.java +++ b/jdk/test/javax/swing/JMenu/8067346/bug8067346.java @@ -27,7 +27,6 @@ @requires (os.family == "windows") @run main bug8067346 */ -import com.sun.java.swing.plaf.windows.WindowsLookAndFeel; import java.awt.Insets; import javax.swing.JFrame; import javax.swing.JMenu; @@ -56,9 +55,17 @@ public class bug8067346 { bug8067346 test = new bug8067346(); try { // set windows look and feel - UIManager.setLookAndFeel(new WindowsLookAndFeel()); + String lnf = + "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; + UIManager.setLookAndFeel(lnf); } catch (UnsupportedLookAndFeelException e) { runTest = false; + } catch (ClassNotFoundException e) { + runTest = false; + } catch (InstantiationException e) { + runTest = false; + } catch (IllegalAccessException e) { + runTest = false; } if(runTest) { test.createUI(); diff --git a/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java b/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java new file mode 100644 index 00000000000..0230ce1b022 --- /dev/null +++ b/jdk/test/javax/swing/JOptionPane/8139213/OptionPaneTest.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8139213 + * @summary Mac OS Aqua X LAF: JOptionPane truncates the first button + * @run main OptionPaneTest + */ +import java.awt.Component; +import java.awt.Insets; +import java.awt.Robot; +import javax.swing.JButton; +import javax.swing.JDialog; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +public class OptionPaneTest { + + private volatile static boolean testFailed; + private static JDialog dialog; + private static Robot robot; + + public static void main(final String[] args) throws Exception { + robot = new Robot(); + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + JOptionPane optionPane = new JOptionPane("JOptionPane", + JOptionPane.INFORMATION_MESSAGE, + JOptionPane.DEFAULT_OPTION, + null, + new String[]{"3", "2", "1"}, + null); + dialog = optionPane.createDialog("JOptionPane"); + int width = 0; + Component[] comps = optionPane.getComponents(); + for (Component comp : comps) { + if (comp instanceof JPanel) { + Component[] child = ((JPanel) comp).getComponents(); + for (Component c : child) { + if (c instanceof JButton) { + width += c.getWidth(); + } + } + } + } + Insets in = optionPane.getInsets(); + width += in.left + in.right; + if (width > optionPane.getWidth()) { + testFailed = true; + } + } finally { + dialog.dispose(); + } + } + }); + robot.waitForIdle(); + if (testFailed) { + throw new RuntimeException("Test Failed"); + } + } +} diff --git a/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java b/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java new file mode 100644 index 00000000000..bc2a6855f87 --- /dev/null +++ b/jdk/test/javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java @@ -0,0 +1,216 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8015748 + * @summary verifies ProgressBar RightToLeft orientations for all Look and Feels + * @library ../../regtesthelpers + * @build Util + * @run main JProgressBarOrientationRobotTest + */ +import java.awt.Color; +import java.awt.ComponentOrientation; +import java.awt.Point; +import java.awt.Robot; +import javax.swing.JFrame; +import javax.swing.JProgressBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +public class JProgressBarOrientationRobotTest { + + private static JFrame frame; + private static JProgressBar progressBar; + private static Robot robot; + private static Color colorCenter; + private static Color colorLeft; + private static Color colorRight; + private static final int widthBuffer = 20; + private static volatile String errorString = ""; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + robot.waitForIdle(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + executeCase(lookAndFeelItem.getClassName(), + lookAndFeelItem.getName()); + + } + if (!"".equals(errorString)) { + System.err.println(errorString); + } + } + + private static void executeCase(String lookAndFeelString, + String shortenedLandFeelString) throws Exception { + if (tryLookAndFeel(lookAndFeelString)) { + createUI(shortenedLandFeelString); + robot.waitForIdle(); + + createLTR(); + robot.delay(1000); + runTestCase(); + robot.delay(1000); + testCaseLTR(shortenedLandFeelString); + robot.delay(1000); + + createRTL(); + robot.delay(1000); + runTestCase(); + robot.delay(1000); + testCaseRTL(shortenedLandFeelString); + robot.delay(1000); + + cleanUp(); + } + + } + + private static void createUI(final String shortenedLookAndFeelString) + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + progressBar = new JProgressBar(); + progressBar.setValue(30); + frame = new JFrame(shortenedLookAndFeelString); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.getContentPane().add(progressBar); + frame.pack(); + frame.setSize(500, frame.getSize().height); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + frame.toFront(); + } + }); + } + + private static void createLTR() + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + progressBar.applyComponentOrientation( + ComponentOrientation.LEFT_TO_RIGHT); + progressBar.repaint(); + } + }); + } + + private static void createRTL() + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + progressBar.applyComponentOrientation( + ComponentOrientation.RIGHT_TO_LEFT); + progressBar.repaint(); + } + }); + } + + private static void runTestCase() throws Exception { + Point centerPoint = Util.getCenterPoint(progressBar); + colorCenter = robot.getPixelColor(centerPoint.x, centerPoint.y); + colorRight = robot.getPixelColor( + (centerPoint.x + progressBar.getWidth() / 2 - widthBuffer), + centerPoint.y); + colorLeft = robot.getPixelColor( + (centerPoint.x - progressBar.getWidth() / 2 + widthBuffer), + centerPoint.y); + robot.waitForIdle(); + } + + private static void testCaseLTR(String shortenedLookAndFeelString) + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + + if (colorCenter.equals(colorRight)) { + if (!colorCenter.equals(colorLeft)) { + System.out.println("[" + shortenedLookAndFeelString + + "]: LTR orientation test passed"); + } + } else { + frame.dispose(); + String error = "[" + shortenedLookAndFeelString + + "]: [Error]: LTR orientation test failed"; + errorString += error; + System.err.println(error); + } + } + }); + + } + + private static void testCaseRTL(String shortenedLookAndFeelString) + throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + if (colorCenter.equals(colorLeft)) { + if (!colorCenter.equals(colorRight)) { + System.out.println("[" + shortenedLookAndFeelString + + "]: RTL orientation test passed"); + } + } else { + frame.dispose(); + String error = "[" + shortenedLookAndFeelString + + "]: [Error]: LTR orientation test failed"; + errorString += error; + System.err.println(error); + } + } + }); + } + + private static void cleanUp() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame.dispose(); + } + }); + } + + private static boolean tryLookAndFeel(String lookAndFeelString) + throws Exception { + try { + UIManager.setLookAndFeel( + lookAndFeelString); + + } catch (UnsupportedLookAndFeelException + | ClassNotFoundException + | InstantiationException + | IllegalAccessException e) { + errorString += e.getMessage() + "\n"; + System.err.println("[Exception]: " + e.getMessage()); + return false; + } + return true; + } +} diff --git a/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java b/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java index 3cbe7a61d03..1acb45da597 100644 --- a/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java +++ b/jdk/test/javax/swing/JSpinner/8008657/bug8008657.java @@ -32,6 +32,8 @@ import javax.swing.SpinnerDateModel; import javax.swing.SpinnerModel; import javax.swing.SpinnerNumberModel; import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; /** * @test @@ -44,18 +46,28 @@ public class bug8008657 { private static Robot robot; private static JSpinner spinner; + private static JFrame frame; public static void main(String[] args) throws Exception { robot = new Robot(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + executeCase(lookAndFeelItem.getClassName()); + } - SwingUtilities.invokeAndWait(() -> { + } + static void executeCase(String lookAndFeelString) throws Exception { + if (tryLookAndFeel(lookAndFeelString)) { + SwingUtilities.invokeAndWait(() -> { createDateSpinner(); createAndShowUI(); }); robot.waitForIdle(); testSpinner(false); + cleanUp(); SwingUtilities.invokeAndWait(() -> { createNumberSpinner(); @@ -64,14 +76,16 @@ public class bug8008657 { robot.waitForIdle(); testSpinner(true); + cleanUp(); + } } - static void testSpinner(boolean checkHorizontalAligment) throws Exception { SwingUtilities.invokeAndWait(() -> { spinner.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); - }); + + }); robot.waitForIdle(); SwingUtilities.invokeAndWait(() -> { @@ -145,10 +159,34 @@ public class bug8008657 { } static void createAndShowUI() { - JFrame frame = new JFrame("Test"); + frame = new JFrame("Test"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 100); frame.getContentPane().add(spinner); frame.setVisible(true); } + + private static void cleanUp() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + frame.dispose(); + } + }); + } + + private static boolean tryLookAndFeel(String lookAndFeelString) + throws Exception { + try { + UIManager.setLookAndFeel( + lookAndFeelString); + + } catch (UnsupportedLookAndFeelException + | ClassNotFoundException + | InstantiationException + | IllegalAccessException e) { + return false; + } + return true; + } } diff --git a/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java b/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java index 15aa9f43260..ed408d969d9 100644 --- a/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java +++ b/jdk/test/javax/swing/JTabbedPane/8134116/Bug8134116.java @@ -4,7 +4,6 @@ import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.List; import javax.accessibility.Accessible; -import javax.accessibility.AccessibleComponent; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleState; import javax.accessibility.AccessibleStateSet; @@ -19,6 +18,8 @@ import javax.swing.plaf.nimbus.NimbusLookAndFeel; */ public class Bug8134116 { + private static volatile Exception exception = null; + public static void main(String args[]) throws Exception { try { @@ -29,75 +30,138 @@ public class Bug8134116 { SwingUtilities.invokeAndWait(() -> { JPanel panel0 = new JPanel(); + JPanel panel2 = new JPanel(); BadPane badPane = new BadPane(); badPane.add("zero", panel0); - badPane.add("one", null); + badPane.add("one", null); // no component + badPane.add("", panel2); // no title + badPane.add("", null); // no component, no title + // but give it that via a tabComponent + JPanel tabComponent = new JPanel(); + JLabel tabComponentLabel = new JLabel("three"); + tabComponent.add(tabComponentLabel); + badPane.setTabComponentAt(3, tabComponent); JFrame frame = new JFrame(); frame.add(badPane); frame.setSize(300, 300); frame.setVisible(true); - AccessibleContext ac = badPane.getAccessibleContext(); - Accessible page0 = ac.getAccessibleChild(0); - if (page0 == null) { - // Not something being tested, but checking anyway - throw new RuntimeException("getAccessibleChild(0) is null"); - } - Accessible page1 = ac.getAccessibleChild(1); - if (page1 == null) { - // Not something being tested, but checking anyway - throw new RuntimeException("getAccessibleChild(1) is null"); - } - // page0 and page1 are a JTabbedPane.Page, a private inner class - // and is an AccessibleContext - // and implements Accessible and AccessibleComponent - AccessibleContext pac0 = page0.getAccessibleContext(); - AccessibleContext pac1 = page1.getAccessibleContext(); + try { + AccessibleContext ac = badPane.getAccessibleContext(); + Accessible page0 = ac.getAccessibleChild(0); + if (page0 == null) { + // Not something being tested, but checking anyway + throw new RuntimeException("getAccessibleChild(0) is null"); + } + Accessible page1 = ac.getAccessibleChild(1); + if (page1 == null) { + // Not something being tested, but checking anyway + throw new RuntimeException("getAccessibleChild(1) is null"); + } + Accessible page2 = ac.getAccessibleChild(2); + Accessible page3 = ac.getAccessibleChild(3); + // page0 - page3 are JTabbedPane.Page, a private inner class + // and is an AccessibleContext + // and implements Accessible and AccessibleComponent + AccessibleContext pac0 = page0.getAccessibleContext(); + AccessibleContext pac1 = page1.getAccessibleContext(); + AccessibleContext pac2 = page2.getAccessibleContext(); + AccessibleContext pac3 = page3.getAccessibleContext(); - // the following would fail if JDK-8134116 fix not present + // test Page.getBounds + // ensure no IndexOutOfBoundsException + Rectangle r0 = pac0.getAccessibleComponent().getBounds(); + // make sure second Bounds is different than first + Rectangle r1 = pac1.getAccessibleComponent().getBounds(); + if (r1.equals(r0)) { + String msg = "Second tab should not have same bounds as first tab"; + throw new RuntimeException(msg); + } - // test Page.getBounds - // ensure no IndexOutOfBoundsException - pac0.getAccessibleComponent().getBounds(); + // test Page.getAccessibleStateSet + // At this point page 0 is selected + AccessibleStateSet accSS0 = pac0.getAccessibleStateSet(); + if (!accSS0.contains(AccessibleState.SELECTED)) { + String msg = "Empty title -> AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } + // select second tab + badPane.setSelectedIndex(1); + AccessibleStateSet accSS1 = pac1.getAccessibleStateSet(); + if (!accSS1.contains(AccessibleState.SELECTED)) { + String msg = "Second tab selected but AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } + // select third tab + badPane.setSelectedIndex(2); + AccessibleStateSet accSS2 = pac2.getAccessibleStateSet(); + if (!accSS1.contains(AccessibleState.SELECTED)) { + String msg = "Third tab selected but AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } + // select fourth tab + badPane.setSelectedIndex(3); + AccessibleStateSet accSS3 = pac3.getAccessibleStateSet(); + if (!accSS1.contains(AccessibleState.SELECTED)) { + String msg = "Fourth tab selected but AccessibleState.SELECTED not set"; + throw new RuntimeException(msg); + } - // test Page.getAccessibleStateSet - // At this point page 0 is selected - AccessibleStateSet accSS0 = pac0.getAccessibleStateSet(); - if (!accSS0.contains(AccessibleState.SELECTED)) { - String msg = "Empty title -> AccessibleState.SELECTED not set"; - throw new RuntimeException(msg); - } + // test Page.getAccessibleIndexInParent + if (pac0.getAccessibleIndexInParent() == -1) { + String msg = "Empty title -> negative AccessibleIndexInParent"; + throw new RuntimeException(msg); + } + if (pac0.getAccessibleIndexInParent() != 0) { + String msg = "first tab is not at index 0 in parent"; + throw new RuntimeException(msg); + } + if (pac1.getAccessibleIndexInParent() != 1) { + String msg = "second tab (null component) is not at index 1 in parent"; + throw new RuntimeException(msg); + } + if (pac2.getAccessibleIndexInParent() != 2) { + String msg = "third tab (empty title) string is not at index 2 in parent"; + throw new RuntimeException(msg); + } + if (pac3.getAccessibleIndexInParent() != 3) { + String msg = "fourth tab (empty title, null component, has tabComponent) string is not at index 3 in parent"; + throw new RuntimeException(msg); + } - // test Page.getAccessibleIndexInParent - if (pac0.getAccessibleIndexInParent() == -1) { - String msg = "Empty title -> negative AccessibleIndexInParent"; - throw new RuntimeException(msg); - } + // test Page.getAccessibleName + String accName = pac0.getAccessibleName(); + if (!accName.equals("zero")) { + String msg = "Empty title -> empty AccessibleName"; + throw new RuntimeException(msg); + } + // test Page.getAccessibleName when component is null + accName = pac1.getAccessibleName(); + if (!accName.equals("one")) { + String msg = "AccessibleName of null panel not 'one'"; + throw new RuntimeException(msg); + } - // test Page.getAccessibleName - String accName = pac0.getAccessibleName(); - if (!accName.equals("zero")) { - String msg = "Empty title -> empty AccessibleName"; - throw new RuntimeException(msg); - } - // test Page.getAccessibleName when component is null - accName = pac1.getAccessibleName(); - if (!accName.equals("one")) { - String msg = "AccessibleName of null panel not 'one'"; - throw new RuntimeException(msg); - } + // test Page.setDisplayedMnemonicIndex + // Empty title -> IllegalArgumnetException + badPane.setDisplayedMnemonicIndexAt(0, 1); - // test Page.setDisplayedMnemonicIndex - // Empty title -> IllegalArgumnetException - badPane.setDisplayedMnemonicIndexAt(0, 1); - - // test Page.updateDisplayedMnemonicIndex - badPane.setMnemonicAt(0, KeyEvent.VK_Z); - if (badPane.getDisplayedMnemonicIndexAt(0) == -1) { - String msg="Empty title -> getDisplayedMnemonicIndexAt failure"; - throw new RuntimeException(msg); + // test Page.updateDisplayedMnemonicIndex + badPane.setMnemonicAt(0, KeyEvent.VK_Z); + if (badPane.getDisplayedMnemonicIndexAt(0) == -1) { + String msg="Empty title -> getDisplayedMnemonicIndexAt failure"; + throw new RuntimeException(msg); + } + } catch (Exception e) { + exception = e; } }); + if (exception != null) { + System.out.println("Test failed: " + exception.getMessage()); + throw exception; + } else { + System.out.println("Test passed."); + } } // The following is likely what is being done in Burp Suite diff --git a/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java b/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java new file mode 100644 index 00000000000..cd64ee723ab --- /dev/null +++ b/jdk/test/javax/swing/LookAndFeel/8146276/NimbusGlueTest.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8146276 + * @summary Right aligned toolbar component does not appear + * @run main NimbusGlueTest + */ +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JToolBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import java.awt.Robot; +import javax.swing.UnsupportedLookAndFeelException; + +public class NimbusGlueTest { + + private static JFrame frame; + private static Robot robot; + private static volatile String errorMessage = ""; + private static JToolBar bar; + + public static void main(String[] args) throws Exception { + robot = new Robot(); + UIManager.LookAndFeelInfo[] lookAndFeelArray + = UIManager.getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) { + String lookAndFeelString = lookAndFeelItem.getClassName(); + if (tryLookAndFeel(lookAndFeelString)) { + createUI(); + performTest(); + robot.waitForIdle(); + } + } + if (!"".equals(errorMessage)) { + throw new RuntimeException(errorMessage); + } + } + + private static boolean tryLookAndFeel(String lookAndFeelString) { + try { + UIManager.setLookAndFeel(lookAndFeelString); + return true; + } catch (UnsupportedLookAndFeelException | ClassNotFoundException | + InstantiationException | IllegalAccessException e) { + errorMessage += e.getMessage() + "\n"; + System.err.println("Caught Exception: " + e.getMessage()); + return false; + } + } + + private static void performTest() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + try { + int width = 0; + for (Component comp : bar.getComponents()) { + width += comp.getWidth(); + } + if (width > 600) { + errorMessage = "Test Failed"; + } + } finally { + frame.dispose(); + } + + } + }); + } + + private static void createUI() throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + frame = new JFrame(); + bar = new JToolBar(); + bar.add(createButton(1)); + bar.add(createButton(2)); + bar.add(Box.createHorizontalGlue()); + bar.add(createButton(3)); + frame.add(bar, BorderLayout.NORTH); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setSize(600, 400); + frame.setVisible(true); + } + }); + } + + private static JButton createButton(int id) { + JButton b = new JButton("B: " + id); + b.setPreferredSize(new Dimension(60, b.getPreferredSize().height)); + return b; + } +} diff --git a/jdk/test/javax/swing/text/html/HTMLEditorKit/7104635/HTMLEditorKitWriterBug.java b/jdk/test/javax/swing/text/html/HTMLEditorKit/7104635/HTMLEditorKitWriterBug.java new file mode 100644 index 00000000000..d37f9fd69d6 --- /dev/null +++ b/jdk/test/javax/swing/text/html/HTMLEditorKit/7104635/HTMLEditorKitWriterBug.java @@ -0,0 +1,56 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7104635 + * @summary HTMLEditorKit fails to write down some html files + * @run main HTMLEditorKitWriterBug + */ +import java.io.CharArrayReader; +import java.io.CharArrayWriter; +import javax.swing.text.html.HTMLDocument; +import javax.swing.text.html.HTMLEditorKit; + +public class HTMLEditorKitWriterBug { + + public static void main(String[] args) { + String htmlDoc = "

          "; + try { + HTMLEditorKit kit = new HTMLEditorKit(); + Class c = Class.forName( + "javax.swing.text.html.parser.ParserDelegator"); + HTMLEditorKit.Parser parser = (HTMLEditorKit.Parser) c.newInstance(); + HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument(); + HTMLEditorKit.ParserCallback htmlReader = doc.getReader(0); + parser.parse(new CharArrayReader(htmlDoc.toCharArray()), + htmlReader, true); + htmlReader.flush(); + CharArrayWriter writer = new CharArrayWriter(1000); + kit.write(writer, doc, 0, doc.getLength()); + writer.flush(); + } catch (Exception ex) { + throw new RuntimeException("Test Failed " + ex); + } + } +} diff --git a/jdk/test/jdk/Version/Basic.java b/jdk/test/jdk/Version/Basic.java new file mode 100644 index 00000000000..b94180c8daf --- /dev/null +++ b/jdk/test/jdk/Version/Basic.java @@ -0,0 +1,400 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 Unit test for jdk.Version. + * @bug 8072379 + */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.math.BigInteger; +import java.util.stream.Collectors; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import jdk.Version; +import static java.lang.System.out; + +public class Basic { + private static final Class IAE + = IllegalArgumentException.class; + private static final Class NPE + = NullPointerException.class; + private static final Class NFE + = NumberFormatException.class; + private static final Class VERSION = Version.class; + + private static final BigInteger TOO_BIG + = (BigInteger.valueOf(Integer.MAX_VALUE)).add(BigInteger.ONE); + private static final String TOO_BIG_STR = TOO_BIG.toString(); + + public static void main(String ... args) { + + //// Tests for parse(), major(), minor(), security(), pre(), + //// build(), opt(), version(), toString() + // v M m sec pre bld opt + + // $VNUM + test("9", 9, 0, 0, "", 0, ""); + test("9.1", 9, 1, 0, "", 0, ""); + test("9.0.1", 9, 0, 1, "", 0, ""); + test("404.1.2", 404, 1, 2, "", 0, ""); + test("9.1.2.3", 9, 1, 2, "", 0, ""); + test("1000.0.0.0.0.0.99999999", 1000, 0, 0, "", 0, ""); + + tryCatch(null, NPE); + tryCatch("", IAE); + tryCatch("foo", IAE); + tryCatch("7a", IAE); + tryCatch("0", IAE); + tryCatch("09", IAE); + tryCatch("9.0", IAE); + tryCatch("9.0.", IAE); + tryCatch("1.9,1", IAE); + tryCatch(TOO_BIG_STR, NFE); + + // $PRE + test("9-ea", 9, 0, 0, "ea", 0, ""); + test("9-internal", 9, 0, 0, "internal", 0, ""); + test("9-0", 9, 0, 0, "0", 0, ""); + test("9.2.7-8", 9, 2, 7, "8", 0, ""); + test("1-ALL", 1, 0, 0, "ALL", 0, ""); + test("2.3.4.5-1a", 2, 3, 4, "1a", 0, ""); + test("1-" + TOO_BIG_STR, 1, 0, 0, TOO_BIG_STR, 0, ""); + + tryCatch("9:-ea", IAE); + tryCatch("3.14159-", IAE); + tryCatch("3.14159-%", IAE); + + // $BUILD + test("9+0", 9, 0, 0, "", 0, ""); + test("3.14+9999900", 3, 14, 0, "", 9999900, ""); + test("9-pre+105", 9, 0, 0, "pre", 105, ""); + test("6.0.42-8beta+4", 6, 0, 42, "8beta", 4, ""); + + tryCatch("9+", IAE); + tryCatch("7+a", IAE); + tryCatch("9+00", IAE); + tryCatch("4.2+01", IAE); + tryCatch("4.2+1a", IAE); + tryCatch("1+" + TOO_BIG_STR, NFE); + + // $OPT + test("9+-foo", 9, 0, 0, "", 0, "foo"); + test("9-pre-opt", 9, 0, 0, "pre", 0, "opt"); + test("42+---bar", 42, 0, 0, "", 0, "--bar"); + test("2.91+-8061493-", 2, 91, 0, "", 0, "8061493-"); + test("24+-foo.bar", 24, 0, 0, "", 0, "foo.bar"); + test("9-ribbit+17-...", 9, 0, 0, "ribbit", 17, "..."); + test("7+1-" + TOO_BIG_STR, 7,0, 0, "", 1, TOO_BIG_STR); + + tryCatch("9-pre+-opt", IAE); + tryCatch("1.4142+-", IAE); + tryCatch("2.9979+-%", IAE); + + //// Test for current() + testCurrent(); + + //// Test for equals{IgnoreOpt}?(), hashCode(), compareTo{IgnoreOpt}?() + // compare: after "<" == -1, equal == 0, before ">" == 1 + // v0 v1 eq eqNO cmp cmpNO + testEHC("9", "9", true, true, 0, 0); + + testEHC("8", "9", false, false, -1, -1); + testEHC("9", "10", false, false, -1, -1); + testEHC("9", "8", false, false, 1, 1); + + // $OPT comparison + testEHC("9", "9+-oink", false, true, -1, 0); + testEHC("9+-ribbit", "9+-moo", false, true, 1, 0); + testEHC("9-quack+3-ribbit", + "9-quack+3-moo", false, true, 1, 0); + testEHC("9.1+7", "9.1+7-moo-baa-la", false, true, -1, 0); + + // numeric vs. non-numeric $PRE + testEHC("9.1.1.2-2a", "9.1.1.2-12", false, false, 1, 1); + testEHC("9.1.1.2-12", "9.1.1.2-4", false, false, 1, 1); + + testEHC("27.16", "27.16+120", false, false, 1, 1); + testEHC("10", "10-ea", false, false, 1, 1); + testEHC("10.1+1", "10.1-ea+1", false, false, 1, 1); + testEHC("10.0.1+22", "10.0.1+21", false, false, 1, 1); + + // numeric vs. non-numeric $PRE + testEHC("9.1.1.2-12", "9.1.1.2-a2", false, false, -1, -1); + testEHC("9.1.1.2-1", "9.1.1.2-4", false, false, -1, -1); + + testEHC("9-internal", "9", false, false, -1, -1); + testEHC("9-ea+120", "9+120", false, false, -1, -1); + testEHC("9-ea+120", "9+120", false, false, -1, -1); + testEHC("9+101", "9", false, false, -1, -1); + testEHC("9+101", "9+102", false, false, -1, -1); + testEHC("1.9-ea", "9-ea", false, false, -1, -1); + + if (fail != 0) + throw new RuntimeException((fail + pass) + " tests: " + + fail + " failure(s), first", first); + else + out.println("all " + (fail + pass) + " tests passed"); + + } + + private static void test(String s, Integer major, Integer minor, + Integer sec, String pre, Integer build, + String opt) + { + Version v = testParse(s); + + testStr(v.toString(), s); + + testInt(v.major(), major); + testInt(v.minor(), minor); + testInt(v.security(), sec); + testStr((v.pre().isPresent() ? v.pre().get() : ""), pre); + testInt((v.build().isPresent() ? v.build().get() : 0), build); + testStr((v.optional().isPresent() ? v.optional().get() : ""), opt); + + testVersion(v.version(), s); + } + + private static Version testParse(String s) { + Version v = Version.parse(s); + pass(); + return v; + } + + private static void testInt(int got, int exp) { + if (got != exp) { + fail("testInt()", Integer.toString(exp), Integer.toString(got)); + } else { + pass(); + } + } + + private static void testStr(String got, String exp) { + if (!got.equals(exp)) { + fail("testStr()", exp, got); + } else { + pass(); + } + } + + private static void tryCatch(String s, Class ex) { + Throwable t = null; + try { + Version.parse(s); + } catch (Throwable x) { + if (ex.isAssignableFrom(x.getClass())) { + t = x; + } else + x.printStackTrace(); + } + if ((t == null) && (ex != null)) + fail(s, ex); + else + pass(); + } + + private static void testCurrent() { + Version current = Version.current(); + String javaVer = System.getProperty("java.version"); + + // java.version == $VNUM(\-$PRE) + String [] ver = javaVer.split("-"); + List javaVerVNum + = Arrays.stream(ver[0].split("\\.")) + .map(v -> Integer.parseInt(v)) + .collect(Collectors.toList()); + if (!javaVerVNum.equals(current.version())) { + fail("testCurrent() version()", javaVerVNum.toString(), + current.version().toString()); + } else { + pass(); + } + + Optional javaVerPre + = (ver.length == 2) + ? Optional.ofNullable(ver[1]) + : Optional.empty(); + if (!javaVerPre.equals(current.pre())) { + fail("testCurrent() pre()", javaVerPre.toString(), + current.pre().toString()); + } else { + pass(); + } + + testEHC(current.toString(), javaVer, true, true, 0, 0); + } + + private static void testVersion(List vnum, String s) { + List svnum = new ArrayList(); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + Character c = s.charAt(i); + if (Character.isDigit(c)) { + sb.append(c); + } else { + svnum.add(Integer.parseInt(sb.toString())); + sb = new StringBuilder(); + if (c == '+' || c == '-') { + break; + } + } + } + if (sb.length() > 0) { + svnum.add(Integer.parseInt(sb.toString())); + } + + if (!svnum.equals(vnum)) { + fail("testVersion() equals()", svnum.toString(), vnum.toString()); + } else { + pass(); + } + } + + private static void testEHC(String s0, String s1, boolean eq, boolean eqNO, + int cmp, int cmpNO) + { + Version v0 = Version.parse(s0); + Version v1 = Version.parse(s1); + + testEquals(v0, v1, eq); + testEqualsNO(v0, v1, eqNO); + + testHashCode(v0, v1, eq); + + testCompare(v0, v1, cmp); + testCompareNO(v0, v1, cmpNO); + } + + private static void testEqualsNO(Version v0, Version v1, boolean eq) { + if ((eq && !v0.equalsIgnoreOpt(v1)) + || (!eq && v0.equalsIgnoreOpt(v1))) { + fail("equalsIgnoreOpt() " + Boolean.toString(eq), + v0.toString(), v1.toString()); + } else { + pass(); + } + } + + private static void testEquals(Version v0, Version v1, boolean eq) { + if ((eq && !v0.equals(v1)) || (!eq && v0.equals(v1))) { + fail("equals() " + Boolean.toString(eq), + v0.toString(), v1.toString()); + } else { + pass(); + } + } + + private static void testHashCode(Version v0, Version v1, boolean eq) { + int h0 = v0.hashCode(); + int h1 = v1.hashCode(); + if (eq) { + testInt(h0, h1); + } else if (h0 == h1) { + fail(String.format("hashCode() %s", h0), + Integer.toString(h0), + Integer.toString(h1)); + } else { // !eq && (h0 != h1) + pass(); + } + } + + private static void testCompareNO(Version v0, Version v1, int compare) + { + try { + Method m = VERSION.getMethod("compareToIgnoreOpt", VERSION); + int cmp = (int) m.invoke(v0, v1); + checkCompare(v0, v1, compare, cmp); + } catch (IllegalAccessException | InvocationTargetException | + NoSuchMethodException ex) { + fail(String.format("compareToIgnoreOpt() invocation: %s", + ex.getClass()), + null); + } + } + + private static void testCompare(Version v0, Version v1, int compare) { + try { + Method m = VERSION.getMethod("compareTo", VERSION); + int cmp = (int) m.invoke(v0, v1); + checkCompare(v0, v1, compare, cmp); + } catch (IllegalAccessException | InvocationTargetException | + NoSuchMethodException ex) { + fail(String.format("compareTo() invocation: %s", ex.getClass()), + null); + } + } + + private static void checkCompare(Version v0, Version v1, + int compare, int cmp) + { + if (((cmp == 0) && (compare == 0)) + || (compare == (cmp / Math.abs(cmp == 0 ? 1 : cmp)))) { + pass(); + } else { + fail(String.format("compare() (cmp = %s) (compare = %s)", + cmp, compare), + v0.toString(), v1.toString()); + } + } + + private static int fail = 0; + private static int pass = 0; + + private static Throwable first; + + static void pass() { + pass++; + } + + static void fail(String fs, Class ex) { + String s = "'" + fs + "'"; + if (ex != null) + s += ": " + ex.getName() + " not thrown"; + if (first == null) + setFirst(s); + System.err.println("FAILED: " + s); + fail++; + } + + static void fail(String t, String exp, String got) { + String s = t + ": Expected '" + exp + "', got '" + got + "'"; + if (first == null) + setFirst(s); + System.err.println("FAILED: " + s); + fail++; + } + + private static void setFirst(String s) { + try { + throw new RuntimeException(s); + } catch (RuntimeException x) { + first = x; + } + } +} diff --git a/jdk/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java b/jdk/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java deleted file mode 100644 index e1e4b4288e1..00000000000 --- a/jdk/test/jdk/internal/misc/JavaLangAccess/FormatUnsigned.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. - * 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 jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.SharedSecrets; - -/* - * @test - * @bug 8050114 - * @summary Test JavaLangAccess.formatUnsignedInt/-Long - * @modules java.base/jdk.internal.misc - */ -public class FormatUnsigned { - - static final JavaLangAccess jla = SharedSecrets.getJavaLangAccess(); - - public static void testFormatUnsignedInt() { - testFormatUnsignedInt("7fffffff", Integer.MAX_VALUE, 8, 4, 0, 8); - testFormatUnsignedInt("80000000", Integer.MIN_VALUE, 8, 4, 0, 8); - testFormatUnsignedInt("4711", 04711, 4, 3, 0, 4); - testFormatUnsignedInt("4711", 0x4711, 4, 4, 0, 4); - testFormatUnsignedInt("1010", 0b1010, 4, 1, 0, 4); - testFormatUnsignedInt("00001010", 0b1010, 8, 1, 0, 8); - testFormatUnsignedInt("\u0000\u000000001010", 0b1010, 10, 1, 2, 8); - } - - public static void testFormatUnsignedLong() { - testFormatUnsignedLong("7fffffffffffffff", Long.MAX_VALUE, 16, 4, 0, 16); - testFormatUnsignedLong("8000000000000000", Long.MIN_VALUE, 16, 4, 0, 16); - testFormatUnsignedLong("4711", 04711L, 4, 3, 0, 4); - testFormatUnsignedLong("4711", 0x4711L, 4, 4, 0, 4); - testFormatUnsignedLong("1010", 0b1010L, 4, 1, 0, 4); - testFormatUnsignedLong("00001010", 0b1010L, 8, 1, 0, 8); - testFormatUnsignedLong("\u0000\u000000001010", 0b1010L, 10, 1, 2, 8); - } - - public static void testFormatUnsignedInt(String expected, int value, int arraySize, int shift, int offset, int length) { - char[] chars = new char[arraySize]; - jla.formatUnsignedInt(value, shift, chars, offset, length); - String s = new String(chars); - if (!expected.equals(s)) { - throw new Error(s + " should be equal to expected " + expected); - } - } - - public static void testFormatUnsignedLong(String expected, long value, int arraySize, int shift, int offset, int length) { - char[] chars = new char[arraySize]; - jla.formatUnsignedLong(value, shift, chars, offset, length); - String s = new String(chars); - if (!expected.equals(s)) { - throw new Error(s + " should be equal to expected " + expected); - } - } - - public static void main(String[] args) { - testFormatUnsignedInt(); - testFormatUnsignedLong(); - } -} diff --git a/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java new file mode 100644 index 00000000000..994cee3f896 --- /dev/null +++ b/jdk/test/jdk/internal/ref/Cleaner/ExitOnThrow.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4954921 8009259 + * @library /test/lib/share/classes + * @build jdk.test.lib.* + * @build jdk.test.lib.process.* + * @run main ExitOnThrow + * @summary Ensure that if a cleaner throws an exception then the VM exits + */ +import java.util.Arrays; + +import jdk.internal.ref.Cleaner; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class ExitOnThrow { + + static final String cp = System.getProperty("test.classes", "."); + + public static void main(String[] args) throws Exception { + if (args.length == 0) { + String[] cmd = JDKToolLauncher.createUsingTestJDK("java") + .addToolArg("-cp") + .addToolArg(cp) + .addToolArg("ExitOnThrow") + .addToolArg("-executeCleaner") + .getCommand(); + ProcessBuilder pb = new ProcessBuilder(cmd); + OutputAnalyzer out = ProcessTools.executeProcess(pb); + System.out.println("======================"); + System.out.println(Arrays.toString(cmd)); + String msg = " stdout: [" + out.getStdout() + "]\n" + + " stderr: [" + out.getStderr() + "]\n" + + " exitValue = " + out.getExitValue() + "\n"; + System.out.println(msg); + + if (out.getExitValue() != 1) + throw new RuntimeException("Unexpected exit code: " + + out.getExitValue()); + + } else { + Cleaner.create(new Object(), + () -> { throw new RuntimeException("Foo!"); } ); + while (true) { + System.gc(); + Thread.sleep(100); + } + } + } + +} diff --git a/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java b/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java index 7efedc9aa96..61598bd035d 100644 --- a/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java +++ b/jdk/test/jdk/lambda/separate/ClassToInterfaceConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,6 +62,25 @@ public class ClassToInterfaceConverter implements ClassFilePreprocessor { } } cf.methods = new_methods; + // Convert method tag. Find Methodref, which is not "" and only invoked by other methods + // in the interface, convert it to InterfaceMethodref + ArrayList cpool = new ArrayList<>(); + for (int i = 0; i < cf.constant_pool.size(); i++) { + ClassFile.CpEntry ce = cf.constant_pool.get(i); + if (ce instanceof ClassFile.CpMethodRef) { + ClassFile.CpMethodRef me = (ClassFile.CpMethodRef)ce; + ClassFile.CpNameAndType nameType = (ClassFile.CpNameAndType)cf.constant_pool.get(me.name_and_type_index); + ClassFile.CpEntry name = cf.constant_pool.get(nameType.name_index); + if (!utf8Matches(name, "") && cf.this_class == me.class_index) { + ClassFile.CpInterfaceMethodRef newEntry = new ClassFile.CpInterfaceMethodRef(); + newEntry.class_index = me.class_index; + newEntry.name_and_type_index = me.name_and_type_index; + ce = newEntry; + } + } + cpool.add(ce); + } + cf.constant_pool = cpool; } public byte[] preprocess(String classname, byte[] bytes) { diff --git a/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java b/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java new file mode 100644 index 00000000000..f3b43f83eee --- /dev/null +++ b/jdk/test/sun/applet/DeprecatedAppletViewer/DeprecatedAppletViewer.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * 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.io.ByteArrayOutputStream; +import java.io.PrintStream; + +/** + * @test + * @bug 8074165 + * @modules java.desktop/sun.applet + * @run main/othervm -Duser.language=en DeprecatedAppletViewer + */ +public final class DeprecatedAppletViewer { + + private static final String TEXT = "AppletViewer is deprecated."; + + public static void main(final String[] args) { + final PrintStream old = System.out; + final ByteArrayOutputStream baos = new ByteArrayOutputStream(1000); + final PrintStream ps = new PrintStream(baos); + try { + System.setOut(ps); + sun.applet.Main.main(new String[]{}); + } finally { + System.setOut(old); + } + + final String text = new String(baos.toByteArray()); + if (!text.contains(TEXT)) { + System.err.println("The text should contain: \"" + TEXT + "\""); + System.err.println("But the current text is: "); + System.err.println(text); + throw new RuntimeException("Error"); + } + } +} diff --git a/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java b/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java index 8c40fe4cfae..79fc9ac0ff4 100644 --- a/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java +++ b/jdk/test/sun/java2d/marlin/ArrayCacheSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * 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,11 +23,12 @@ import sun.java2d.marlin.ArrayCache; -/** +/* * @test * @bug 8144445 * @summary Check the ArrayCache getNewLargeSize() method * @run main ArrayCacheSizeTest + * @modules java.desktop/sun.java2d.marlin */ public class ArrayCacheSizeTest { diff --git a/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java b/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java index 5f7fcc153c2..81d9faea97f 100644 --- a/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java +++ b/jdk/test/sun/java2d/marlin/CeilAndFloorTests.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ import sun.java2d.marlin.FloatMath; * @test * @summary Check for correct implementation of FloatMath.ceil/floor * @run main CeilAndFloorTests + * @modules java.desktop/sun.java2d.marlin */ public class CeilAndFloorTests { diff --git a/jdk/test/sun/java2d/marlin/TextClipErrorTest.java b/jdk/test/sun/java2d/marlin/TextClipErrorTest.java new file mode 100644 index 00000000000..efce137256c --- /dev/null +++ b/jdk/test/sun/java2d/marlin/TextClipErrorTest.java @@ -0,0 +1,322 @@ +/* + * 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. + * + * 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.awt.BasicStroke; +import java.awt.Color; +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.geom.AffineTransform; +import java.awt.geom.Line2D; +import java.awt.geom.Path2D; +import java.awt.geom.PathIterator; +import static java.awt.geom.PathIterator.SEG_CLOSE; +import static java.awt.geom.PathIterator.SEG_CUBICTO; +import static java.awt.geom.PathIterator.SEG_LINETO; +import static java.awt.geom.PathIterator.SEG_MOVETO; +import static java.awt.geom.PathIterator.SEG_QUADTO; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Locale; +import java.util.logging.Handler; +import java.util.logging.LogRecord; +import java.util.logging.Logger; +import javax.imageio.ImageIO; + +/** + * @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 + */ +public class TextClipErrorTest { + + static final boolean SAVE_IMAGE = false; + static final boolean SERIALIZE = false; + + public static void main(String[] args) { + Locale.setDefault(Locale.US); + + // initialize j.u.l Looger: + final Logger log = Logger.getLogger("sun.java2d.marlin"); + log.addHandler(new Handler() { + @Override + public void publish(LogRecord record) { + Throwable th = record.getThrown(); + // detect potential Throwable thrown by XxxArrayCache.check(): + if (th != null && th.getClass() == Throwable.class) { + StackTraceElement[] stackElements = th.getStackTrace(); + + for (int i = 0; i < stackElements.length; i++) { + StackTraceElement e = stackElements[i]; + + if (e.getClassName().startsWith("sun.java2d.marlin") + && e.getClassName().contains("ArrayCache") + && "check".equals(e.getMethodName())) + { + System.out.println("Test failed:\n" + + record.getMessage()); + th.printStackTrace(System.out); + + throw new RuntimeException("Test failed: ", th); + } + } + } + } + + @Override + public void flush() { + } + + @Override + public void close() throws SecurityException { + } + }); + + log.info("TextClipErrorTest: start"); + + // enable Marlin logging & internal checks: + System.setProperty("sun.java2d.renderer.log", "true"); + System.setProperty("sun.java2d.renderer.useLogger", "true"); + System.setProperty("sun.java2d.renderer.doChecks", "true"); + + BufferedImage image = new BufferedImage(256, 256, + BufferedImage.TYPE_INT_ARGB); + + Graphics2D g2d = image.createGraphics(); + g2d.setColor(Color.red); + try { + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + + Font font = g2d.getFont(); + FontRenderContext frc = new FontRenderContext( + new AffineTransform(), true, true); + + g2d.setStroke(new BasicStroke(4.0f, + BasicStroke.CAP_ROUND, + BasicStroke.JOIN_ROUND)); + + final Shape badShape; + if (SERIALIZE) { + final GlyphVector gv1 = font.createGlyphVector(frc, "\u00d6"); + final Shape textShape = gv1.getOutline(); + + final AffineTransform at1 = AffineTransform.getTranslateInstance( + -2091202.554154681, 5548.601436981691); + badShape = at1.createTransformedShape(textShape); + serializeShape(badShape); + } else { + badShape = deserializeShape(); + } + + g2d.draw(badShape); + + // Draw anything within bounds and it fails: + g2d.draw(new Line2D.Double(10, 20, 30, 40)); + + if (SAVE_IMAGE) { + final File file = new File("TextClipErrorTest.png"); + System.out.println("Writing file: " + file.getAbsolutePath()); + ImageIO.write(image, "PNG", file); + } + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + g2d.dispose(); + log.info("TextClipErrorTest: end"); + } + } + + private static void serializeShape(Shape shape) { + final double[] coords = new double[6]; + + final int len = 32; + final ArrayList typeList = new ArrayList(len); + final ArrayList coordsList = new ArrayList(len); + + for (PathIterator pi = shape.getPathIterator(null); + !pi.isDone(); pi.next()) + { + switch (pi.currentSegment(coords)) { + case SEG_MOVETO: + typeList.add(SEG_MOVETO); + coordsList.add(Arrays.copyOf(coords, 2)); + break; + case SEG_LINETO: + typeList.add(SEG_LINETO); + coordsList.add(Arrays.copyOf(coords, 2)); + break; + case SEG_QUADTO: + typeList.add(SEG_QUADTO); + coordsList.add(Arrays.copyOf(coords, 4)); + break; + case SEG_CUBICTO: + typeList.add(SEG_CUBICTO); + coordsList.add(Arrays.copyOf(coords, 6)); + break; + case SEG_CLOSE: + typeList.add(SEG_CLOSE); + coordsList.add(null); + break; + default: + } + } + + final StringBuilder sb = new StringBuilder(1024); + // types: + sb.append("private static final int[] SHAPE_TYPES = new int[]{\n"); + for (Integer i : typeList) { + sb.append(i).append(",\n"); + } + sb.append("};\n"); + + // coords: + sb.append("private static final double[][] SHAPE_COORDS = new double[][]{\n"); + for (double[] c : coordsList) { + if (c == null) { + sb.append("null,\n"); + } else { + sb.append("new double[]{"); + for (int i = 0; i < c.length; i++) { + sb.append(c[i]).append(","); + } + sb.append("},\n"); + } + } + sb.append("};\n"); + + System.out.println("Shape size: " + typeList.size()); + System.out.println("Serialized shape:\n" + sb.toString()); + } + + private static Shape deserializeShape() { + final Path2D.Double path = new Path2D.Double(); + + for (int i = 0; i < SHAPE_TYPES.length; i++) { + double[] coords = SHAPE_COORDS[i]; + + switch (SHAPE_TYPES[i]) { + case SEG_MOVETO: + path.moveTo(coords[0], coords[1]); + break; + case SEG_LINETO: + path.lineTo(coords[0], coords[1]); + break; + case SEG_QUADTO: + path.quadTo(coords[0], coords[1], + coords[2], coords[3]); + break; + case SEG_CUBICTO: + path.curveTo(coords[0], coords[1], + coords[2], coords[3], + coords[4], coords[5]); + break; + case SEG_CLOSE: + path.closePath(); + break; + default: + } + } + + return path; + } + + // generated code: + private static final int[] SHAPE_TYPES = new int[]{ + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 4, + 0, + 1, + 1, + 1, + 1, + 4, + 0, + 1, + 1, + 1, + 1, + 4, + }; + + private static final double[][] SHAPE_COORDS = new double[][]{ + new double[]{-2091197.819779681, 5540.648311981691,}, + new double[]{-2091199.116654681, 5540.648311981691, -2091199.874467181, 5541.609249481691,}, + new double[]{-2091200.632279681, 5542.570186981691, -2091200.632279681, 5544.242061981691,}, + new double[]{-2091200.632279681, 5545.882686981691, -2091199.874467181, 5546.843624481691,}, + new double[]{-2091199.116654681, 5547.804561981691, -2091197.819779681, 5547.804561981691,}, + new double[]{-2091196.538529681, 5547.804561981691, -2091195.780717181, 5546.843624481691,}, + new double[]{-2091195.022904681, 5545.882686981691, -2091195.022904681, 5544.242061981691,}, + new double[]{-2091195.022904681, 5542.570186981691, -2091195.780717181, 5541.609249481691,}, + new double[]{-2091196.538529681, 5540.648311981691, -2091197.819779681, 5540.648311981691,}, + null, + new double[]{-2091197.819779681, 5539.695186981691,}, + new double[]{-2091195.991654681, 5539.695186981691, -2091194.890092181, 5540.929561981691,}, + new double[]{-2091193.788529681, 5542.163936981691, -2091193.788529681, 5544.242061981691,}, + new double[]{-2091193.788529681, 5546.304561981691, -2091194.890092181, 5547.538936981691,}, + new double[]{-2091195.991654681, 5548.773311981691, -2091197.819779681, 5548.773311981691,}, + new double[]{-2091199.663529681, 5548.773311981691, -2091200.772904681, 5547.538936981691,}, + new double[]{-2091201.882279681, 5546.304561981691, -2091201.882279681, 5544.242061981691,}, + new double[]{-2091201.882279681, 5542.163936981691, -2091200.772904681, 5540.929561981691,}, + new double[]{-2091199.663529681, 5539.695186981691, -2091197.819779681, 5539.695186981691,}, + null, + new double[]{-2091197.210404681, 5537.835811981691,}, + new double[]{-2091196.022904681, 5537.835811981691,}, + new double[]{-2091196.022904681, 5539.023311981691,}, + new double[]{-2091197.210404681, 5539.023311981691,}, + new double[]{-2091197.210404681, 5537.835811981691,}, + null, + new double[]{-2091199.632279681, 5537.835811981691,}, + new double[]{-2091198.444779681, 5537.835811981691,}, + new double[]{-2091198.444779681, 5539.023311981691,}, + new double[]{-2091199.632279681, 5539.023311981691,}, + new double[]{-2091199.632279681, 5537.835811981691,}, + null, + }; + +} diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java index 8b46a4c3169..4647f280fef 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXAgentInterfaceBinding.java @@ -130,7 +130,7 @@ public class JMXAgentInterfaceBinding { private static class JMXConnectorThread extends Thread { - private final InetAddress addr; + private final String addr; private final int jmxPort; private final int rmiPort; private final boolean useSSL; @@ -139,7 +139,7 @@ public class JMXAgentInterfaceBinding { private boolean jmxConnectWorked; private boolean rmiConnectWorked; - private JMXConnectorThread(InetAddress addr, + private JMXConnectorThread(String addr, int jmxPort, int rmiPort, boolean useSSL, @@ -163,11 +163,11 @@ public class JMXAgentInterfaceBinding { private void connect() throws IOException { System.out.println( "JMXConnectorThread: Attempting JMX connection on: " - + addr.getHostAddress() + " on port " + jmxPort); + + addr + " on port " + jmxPort); JMXServiceURL url; try { url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" - + addr.getHostAddress() + ":" + jmxPort + "/jmxrmi"); + + addr + ":" + jmxPort + "/jmxrmi"); } catch (MalformedURLException e) { throw new RuntimeException("Test failed.", e); } @@ -200,7 +200,7 @@ public class JMXAgentInterfaceBinding { } System.out.println( "JMXConnectorThread: connection to rmi socket worked host/port = " - + addr.getHostAddress() + "/" + rmiPort); + + addr + "/" + rmiPort); rmiConnectWorked = true; // Closing the channel without sending any data will cause an // java.io.EOFException on the server endpoint. We don't care about this @@ -224,7 +224,7 @@ public class JMXAgentInterfaceBinding { private static class MainThread extends Thread { private static final int WAIT_FOR_JMX_AGENT_TIMEOUT_MS = 500; - private final InetAddress bindAddress; + private final String addr; private final int jmxPort; private final int rmiPort; private final boolean useSSL; @@ -233,7 +233,7 @@ public class JMXAgentInterfaceBinding { private Exception excptn; private MainThread(InetAddress bindAddress, int jmxPort, int rmiPort, boolean useSSL) { - this.bindAddress = bindAddress; + this.addr = wrapAddress(bindAddress.getHostAddress()); this.jmxPort = jmxPort; this.rmiPort = rmiPort; this.useSSL = useSSL; @@ -259,7 +259,7 @@ public class JMXAgentInterfaceBinding { private void waitUntilReadyForConnections() { CountDownLatch latch = new CountDownLatch(1); JMXConnectorThread connectionTester = new JMXConnectorThread( - bindAddress, jmxPort, rmiPort, useSSL, latch); + addr, jmxPort, rmiPort, useSSL, latch); connectionTester.start(); boolean expired = false; try { @@ -294,4 +294,13 @@ public class JMXAgentInterfaceBinding { } } + /** + * Will wrap IPv6 address in '[]' + */ + static String wrapAddress(String address) { + if (address.contains(":")) { + return "[" + address + "]"; + } + return address; + } } diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java index 45370151d22..d3b5f13d3a6 100644 --- a/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java +++ b/jdk/test/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java @@ -23,9 +23,11 @@ import java.io.File; import java.net.InetAddress; -import java.net.UnknownHostException; +import java.net.NetworkInterface; +import java.net.SocketException; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import jdk.testlibrary.ProcessThread; import jdk.testlibrary.ProcessTools; @@ -72,25 +74,28 @@ public class JMXInterfaceBindingTest { "truststore"; public static final String TEST_CLASSPATH = System.getProperty("test.classes", "."); - public void run(InetAddress[] addrs) { + public void run(List addrs) { System.out.println("DEBUG: Running tests with plain sockets."); runTests(addrs, false); System.out.println("DEBUG: Running tests with SSL sockets."); runTests(addrs, true); } - private void runTests(InetAddress[] addrs, boolean useSSL) { - ProcessThread[] jvms = new ProcessThread[addrs.length]; - for (int i = 0; i < addrs.length; i++) { + private void runTests(List addrs, boolean useSSL) { + List jvms = new ArrayList<>(addrs.size()); + int i = 1; + for (InetAddress addr : addrs) { + String address = JMXAgentInterfaceBinding.wrapAddress(addr.getHostAddress()); System.out.println(); String msg = String.format("DEBUG: Launching java tester for triplet (HOSTNAME,JMX_PORT,RMI_PORT) == (%s,%d,%d)", - addrs[i].getHostAddress(), + address, JMX_PORT, RMI_PORT); System.out.println(msg); - jvms[i] = runJMXBindingTest(addrs[i], useSSL); - jvms[i].start(); - System.out.println("DEBUG: Started " + (i + 1) + " Process(es)."); + ProcessThread jvm = runJMXBindingTest(address, useSSL); + jvms.add(jvm); + jvm.start(); + System.out.println("DEBUG: Started " + (i++) + " Process(es)."); } int failedProcesses = 0; for (ProcessThread pt: jvms) { @@ -117,15 +122,15 @@ public class JMXInterfaceBindingTest { } } if (failedProcesses > 0) { - throw new RuntimeException("Test FAILED. " + failedProcesses + " out of " + addrs.length + " process(es) failed to start the JMX agent."); + throw new RuntimeException("Test FAILED. " + failedProcesses + " out of " + addrs.size() + " process(es) failed to start the JMX agent."); } } - private ProcessThread runJMXBindingTest(InetAddress a, boolean useSSL) { + private ProcessThread runJMXBindingTest(String address, boolean useSSL) { List args = new ArrayList<>(); args.add("-classpath"); args.add(TEST_CLASSPATH); - args.add("-Dcom.sun.management.jmxremote.host=" + a.getHostAddress()); + args.add("-Dcom.sun.management.jmxremote.host=" + address); args.add("-Dcom.sun.management.jmxremote.port=" + JMX_PORT); args.add("-Dcom.sun.management.jmxremote.rmi.port=" + RMI_PORT); args.add("-Dcom.sun.management.jmxremote.authenticate=false"); @@ -138,14 +143,14 @@ public class JMXInterfaceBindingTest { args.add("-Djavax.net.ssl.trustStorePassword=trustword"); } args.add(TEST_CLASS); - args.add(a.getHostAddress()); + args.add(address); args.add(Integer.toString(JMX_PORT)); args.add(Integer.toString(RMI_PORT)); args.add(Boolean.toString(useSSL)); try { ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(args.toArray(new String[] {})); System.out.println(ProcessTools.getCommandLine(builder)); - ProcessThread jvm = new ProcessThread("JMX-Tester-" + a.getHostAddress(), JMXInterfaceBindingTest::isJMXAgentResponseAvailable, builder); + ProcessThread jvm = new ProcessThread("JMX-Tester-" + address, JMXInterfaceBindingTest::isJMXAgentResponseAvailable, builder); return jvm; } catch (Exception e) { throw new RuntimeException("Test failed", e); @@ -171,8 +176,8 @@ public class JMXInterfaceBindingTest { } public static void main(String[] args) { - InetAddress[] addrs = getAddressesForLocalHost(); - if (addrs.length < 2) { + List addrs = getAddressesForLocalHost(); + if (addrs.size() < 2) { System.out.println("Ignoring manual test since no more than one IPs are configured for 'localhost'"); return; } @@ -181,13 +186,24 @@ public class JMXInterfaceBindingTest { System.out.println("All tests PASSED."); } - private static InetAddress[] getAddressesForLocalHost() { - InetAddress[] addrs; + private static List getAddressesForLocalHost() { + try { - addrs = InetAddress.getAllByName("localhost"); - } catch (UnknownHostException e) { + return NetworkInterface.networkInterfaces() + .flatMap(NetworkInterface::inetAddresses) + .filter(JMXInterfaceBindingTest::isNonloopbackLocalhost) + .collect(Collectors.toList()); + } catch (SocketException e) { throw new RuntimeException("Test failed", e); } - return addrs; + } + + // we need 'real' localhost addresses only (eg. not loopback ones) + // so we can bind the remote JMX connector to them + private static boolean isNonloopbackLocalhost(InetAddress i) { + if (!i.isLoopbackAddress()) { + return i.getHostName().toLowerCase().equals("localhost"); + } + return false; } } diff --git a/jdk/test/sun/misc/Cleaner/exitOnThrow.sh b/jdk/test/sun/misc/Cleaner/exitOnThrow.sh deleted file mode 100644 index 4a22114ab18..00000000000 --- a/jdk/test/sun/misc/Cleaner/exitOnThrow.sh +++ /dev/null @@ -1,48 +0,0 @@ -#! /bin/sh - -# -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# @test -# @bug 4954921 8009259 -# @summary Ensure that if a cleaner throws an exception then the VM exits -# -# @build ExitOnThrow -# @run shell exitOnThrow.sh - -# Command-line usage: sh exitOnThrow.sh /path/to/build - -if [ -z "$TESTJAVA" ]; then - if [ $# -lt 1 ]; then exit 1; fi - TESTJAVA=$1; shift - TESTCLASSES=`pwd` -fi - -if $TESTJAVA/bin/java ${TESTVMOPTS} -cp $TESTCLASSES ExitOnThrow; then - echo Failed: VM exited normally - exit 1 -else - echo Passed: VM exited with code $? - exit 0 -fi diff --git a/jdk/test/sun/reflect/constantPool/ConstantPoolTest.java b/jdk/test/sun/reflect/constantPool/ConstantPoolTest.java new file mode 100644 index 00000000000..3ede807577d --- /dev/null +++ b/jdk/test/sun/reflect/constantPool/ConstantPoolTest.java @@ -0,0 +1,170 @@ +/* + * 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. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8141615 + * @summary Tests new public methods at sun.reflect.ConstantPool + * @modules java.base/sun.reflect + * @library /lib/testlibrary + * @compile ConstantPoolTestDummy.jasm + * @run main sun.reflect.constantPool.ConstantPoolTest + */ + +package sun.reflect.constantPool; + +import java.util.HashMap; +import java.util.Map; +import jdk.internal.misc.SharedSecrets; +import jdk.testlibrary.Asserts; +import sun.reflect.ConstantPool; + +public class ConstantPoolTest { + + private static final Class TEST_CLASS = ConstantPoolTestDummy.class; + private static final ConstantPool CP = SharedSecrets.getJavaLangAccess() + .getConstantPool(TEST_CLASS); + + public static void main(String[] s) { + for (TestCase testCase : TestCase.values()) { + testCase.test(); + } + } + + public static enum TestCase { + GET_TAG_AT { + { + referenceMap.put(1, ConstantPool.Tag.METHODREF); + referenceMap.put(2, ConstantPool.Tag.CLASS); + referenceMap.put(4, ConstantPool.Tag.UTF8); + referenceMap.put(10, ConstantPool.Tag.NAMEANDTYPE); + referenceMap.put(13, ConstantPool.Tag.LONG); + referenceMap.put(15, ConstantPool.Tag.INTEGER); + referenceMap.put(16, ConstantPool.Tag.INTERFACEMETHODREF); + referenceMap.put(21, ConstantPool.Tag.DOUBLE); + referenceMap.put(23, ConstantPool.Tag.STRING); + referenceMap.put(25, ConstantPool.Tag.INVOKEDYNAMIC); + referenceMap.put(29, ConstantPool.Tag.METHODHANDLE); + referenceMap.put(30, ConstantPool.Tag.METHODTYPE); + referenceMap.put(48, ConstantPool.Tag.FIELDREF); + referenceMap.put(52, ConstantPool.Tag.FLOAT); + } + @Override + void testIndex(int cpi, Object reference) { + ConstantPool.Tag tagToVerify = CP.getTagAt(cpi); + ConstantPool.Tag tagToRefer = (ConstantPool.Tag) reference; + String msg = String.format("Method getTagAt works not as expected" + + "at CP entry #%d: got CP tag %s, but should be %s", + cpi, tagToVerify.name(), tagToRefer.name()); + Asserts.assertEquals(tagToVerify, tagToRefer, msg); + } + }, + GET_CLASS_REF_INDEX_AT { + { + referenceMap.put(1, 3); + referenceMap.put(16, 17); + referenceMap.put(32, 35); + referenceMap.put(34, 3); + referenceMap.put(48, 2); + } + @Override + void testIndex(int cpi, Object reference) { + int indexToVerify = CP.getClassRefIndexAt(cpi); + int indexToRefer = (int) reference; + String msg = String.format("Method getClassRefIndexAt works not" + + " as expected at CP entry #%d:" + + " got index %d, but should be %d", + cpi, indexToVerify, indexToRefer); + Asserts.assertEquals(indexToVerify, indexToRefer, msg); + } + }, + GET_NAME_AND_TYPE_REF_INDEX_AT { + { + referenceMap.put(1, 10); + referenceMap.put(16, 18); + referenceMap.put(25, 26); + referenceMap.put(32, 36); + referenceMap.put(34, 37); + referenceMap.put(48, 49); + } + @Override + void testIndex(int cpi, Object reference) { + int indexToRefer = (int) reference; + int indexToVerify = CP.getNameAndTypeRefIndexAt(cpi); + String msg = String.format("Method getNameAndTypeRefIndexAt works" + + " not as expected at CP entry #%d:" + + " got index %d, but should be %d", + cpi, indexToVerify, indexToRefer); + Asserts.assertEquals(indexToVerify, indexToRefer, msg); + } + }, + GET_NAME_AND_TYPE_REF_INFO_AT { + { + referenceMap.put(10, new String[]{"", "()V"}); + referenceMap.put(18, new String[]{"run", "()V"}); + referenceMap.put(26, new String[]{"accept", "()Ljava/util/function/Consumer;"}); + referenceMap.put(36, new String[]{"metafactory", + "(Ljava/lang/invoke/MethodHandles$Lookup;" + + "Ljava/lang/String;Ljava/lang/invoke/MethodType;" + + "Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;" + + "Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"}); + referenceMap.put(37, new String[]{"toString", "()Ljava/lang/String;"}); + referenceMap.put(49, new String[]{"myField", "I"}); + } + @Override + void testIndex(int cpi, Object reference) { + String[] natInfo = CP.getNameAndTypeRefInfoAt(cpi); + String msg = String.format("Method getNameAndTypeRefInfoAt" + + " works not as expected at CP entry #%d:" + + " returned value should not be null", cpi); + Asserts.assertNotNull(natInfo, msg); + String[] castedReference = (String[]) reference; + int natInfoLength = natInfo.length; + msg = String.format("Method getNameAndTypeRefInfoAt" + + " works not as expected at CP entry #%d:" + + " length of the returned string array is %d, but should be 2", + cpi, natInfoLength); + Asserts.assertEquals(natInfoLength, 2, msg); + String[] nameOrType = new String[]{"name", "type"}; + for (int i = 0; i < 2; i++) { + String infoToVerify = natInfo[i]; + String infoToRefer = castedReference[i]; + msg = String.format("Method getNameAndTypeRefInfoAt" + + " works not as expected at CP entry #%d:" + + " got %s info %s, but should be %s", + cpi, nameOrType[i], infoToVerify, infoToRefer); + Asserts.assertEquals(infoToVerify, infoToRefer, msg); + } + } + }; + + protected final Map referenceMap; + TestCase() { + this.referenceMap = new HashMap<>(); + } + abstract void testIndex(int cpi, Object reference); + public void test() { + referenceMap.forEach(this::testIndex); + } + } +} diff --git a/jdk/test/sun/reflect/constantPool/ConstantPoolTestDummy.jasm b/jdk/test/sun/reflect/constantPool/ConstantPoolTestDummy.jasm new file mode 100644 index 00000000000..cb3daaff8c9 --- /dev/null +++ b/jdk/test/sun/reflect/constantPool/ConstantPoolTestDummy.jasm @@ -0,0 +1,98 @@ +/* + * 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. + * + * 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/reflect/constantPool; + +super public #2; //class ConstantPoolTestDummy + version 52:0 +{ + +// Actually, only first 13 constant pool entries are actually used by the class +// and its methods. All the rest are added just for the testing of getTagAt method +// and getNameAndTypeRefIndexAt method. + +const #1 = Method #3.#10; // java/lang/Object."":"()V" +const #2 = class #11; // ConstantPoolTestDummy +const #3 = class #12; // java/lang/Object +const #4 = Asciz ""; +const #5 = Asciz "()V"; +const #6 = Asciz "Code"; +const #7 = Asciz "LineNumberTable"; +const #8 = Asciz "SourceFile"; +const #9 = Asciz "ConstantPoolTestDummy.java"; +const #10 = NameAndType #4:#5; // "":"()V" +const #11 = Asciz "sun/reflect/constantPool/ConstantPoolTestDummy"; +const #12 = Asciz "java/lang/Object"; +const #13 = long 6l; +const #15 = int 1; +const #16 = InterfaceMethod #17.#18; // java/lang/Runnable.run:"()V" +const #17 = class #19; // java/lang/Runnable +const #18 = NameAndType #20:#5; // run:"()V" +const #19 = Asciz "java/lang/Runnable"; +const #20 = Asciz "run"; +const #21 = double 1.45d; +const #23 = String #24; // "Hello" +const #24 = Asciz "Hello"; +const #25 = InvokeDynamic 0:#26; // REF_invokeStatic:java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;":accept:"()Ljava/util/function/Consumer;" MethodType "(Ljava/lang/Object;)V", MethodHandle REF_invokeVirtual:java/lang/Object.toString:"()Ljava/lang/String;", MethodType "(Ljava/lang/Object;)V" +const #26 = NameAndType #27:#28; // accept:"()Ljava/util/function/Consumer;" +const #27 = Asciz "accept"; +const #28 = Asciz "()Ljava/util/function/Consumer;"; +const #29 = MethodHandle 6:#32; // REF_invokeStatic:java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" +const #30 = MethodType #33; // "(Ljava/lang/Object;)V" +const #31 = MethodHandle 5:#34; // REF_invokeVirtual:java/lang/Object.toString:"()Ljava/lang/String;" +const #32 = Method #35.#36; // java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" +const #33 = Asciz "(Ljava/lang/Object;)V"; +const #34 = Method #3.#37; // java/lang/Object.toString:"()Ljava/lang/String;" +const #35 = class #38; // java/lang/invoke/LambdaMetafactory +const #36 = NameAndType #39:#40; // metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;" +const #37 = NameAndType #41:#42; // toString:"()Ljava/lang/String;" +const #38 = Asciz "java/lang/invoke/LambdaMetafactory"; +const #39 = Asciz "metafactory"; +const #40 = Asciz "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;"; +const #41 = Asciz "toString"; +const #42 = Asciz "()Ljava/lang/String;"; +const #43 = class #46; // java/lang/invoke/MethodHandles$Lookup +const #44 = Asciz "Lookup"; +const #45 = class #47; // java/lang/invoke/MethodHandles +const #46 = Asciz "java/lang/invoke/MethodHandles$Lookup"; +const #47 = Asciz "java/lang/invoke/MethodHandles"; +const #48 = Field #2.#49; // sun/reflect/constantPool/ConstantPoolTestDummy.myField:"I" +const #49 = NameAndType #50:#51; // myField:"I" +const #50 = Asciz "myField"; +const #51 = Asciz "I"; +const #52 = float 1.34f; + +public Method #4:#5 // "":"()V" + + stack 1 locals 1 +{ +3 0: aload_0; + 1: invokespecial #1; // Method java/lang/Object."":"()V"; + 4: return; +} + +public static final InnerClass #44= #43 of #45; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles + +BootstrapMethod #29 #30 #31 #30; + +} // end Class ConstantPoolTestDummy diff --git a/jdk/test/sun/security/jca/PreferredProviderTest.java b/jdk/test/sun/security/jca/PreferredProviderTest.java index 7120817a1b5..b7eace2d90e 100644 --- a/jdk/test/sun/security/jca/PreferredProviderTest.java +++ b/jdk/test/sun/security/jca/PreferredProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /** * @test - * @bug 8076359 8133151 + * @bug 8076359 8133151 8145344 * @summary Test the value for new jdk.security.provider.preferred security property * @requires os.name == "SunOS" */ @@ -40,8 +40,9 @@ import javax.crypto.NoSuchPaddingException; public class PreferredProviderTest { private static final List SPARC_DATA = Arrays.asList( - new DataTuple("SHA-256", "SUN"), new DataTuple("SHA-384", "SUN"), - new DataTuple("SHA-512", "SUN")); + new DataTuple("SHA1", "SUN"), new DataTuple("SHA-1", "SUN"), + new DataTuple("SHA-224", "SUN"), new DataTuple("SHA-256", "SUN"), + new DataTuple("SHA-384", "SUN"), new DataTuple("SHA-512", "SUN")); private static final List X86_DATA = Arrays .asList(new DataTuple("RSA", "SunRsaSign")); @@ -52,7 +53,7 @@ public class PreferredProviderTest { String actualProvider = null; if (type.equals("sparcv9")) { if (!preferredProvider.equals( - "AES:SunJCE, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN")) { + "AES:SunJCE, SHA1:SUN, SHA-224:SUN, SHA-256:SUN, SHA-384:SUN, SHA-512:SUN")) { throw new RuntimeException( "Test Failed: wrong jdk.security.provider.preferred " + "value on solaris-sparcv9"); diff --git a/jdk/test/tools/launcher/TooSmallStackSize.java b/jdk/test/tools/launcher/TooSmallStackSize.java index 9635eaee5bd..dac1c7f0325 100644 --- a/jdk/test/tools/launcher/TooSmallStackSize.java +++ b/jdk/test/tools/launcher/TooSmallStackSize.java @@ -24,7 +24,6 @@ /* * @test * @bug 6762191 - * @ignore 8146751 * @summary Setting stack size to 16K causes segmentation fault * @compile TooSmallStackSize.java * @run main TooSmallStackSize diff --git a/langtools/.hgtags b/langtools/.hgtags index 90a13fb7426..67ff752d1c8 100644 --- a/langtools/.hgtags +++ b/langtools/.hgtags @@ -346,3 +346,4 @@ cb73b474703e2de266542b505cffd658bcc052da jdk-9+99 3b3bea483542bc08278af529fb25f2e5930da945 jdk-9+101 6149fc30cd710eb3484dc9863d8837ecaedb96b6 jdk-9+102 94cfc50c1b8a74fd7b0ed2e9e4f4a9dab4f2c6a1 jdk-9+103 +3f60a4808377a276f6398ff19e61c1b9086f4d97 jdk-9+104 diff --git a/langtools/make/netbeans/langtools/nbproject/project.xml b/langtools/make/netbeans/langtools/nbproject/project.xml index e6d79d9d3f4..2a1fe355a7c 100644 --- a/langtools/make/netbeans/langtools/nbproject/project.xml +++ b/langtools/make/netbeans/langtools/nbproject/project.xml @@ -520,7 +520,7 @@ ${root}/build/bootstrap/jdk.jshell/gensrc ${root}/../jdk/src/jdk.internal.le/share/classes ${root}/../jdk/src/jdk.jdi/share/classes - ${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/aux:${root}/build/jdk.jdi/aux:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes + ${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes ${root}/build/jdk.jshell/classes 1.8 diff --git a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java index 89e2463f4a8..b44a7015020 100644 --- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java +++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/OuterWrap.java @@ -31,6 +31,7 @@ import java.util.Locale; import javax.tools.Diagnostic; import javax.tools.JavaFileObject; import jdk.jshell.MemoryFileManager.SourceMemoryJavaFileObject; +import static jdk.internal.jshell.debug.InternalDebugControl.DBG_GEN; /** * @@ -182,6 +183,22 @@ final class OuterWrap implements GeneralWrap { return null; } + @Override + boolean isResolutionError() { + if (!super.isResolutionError()) { + return false; + } + for (String line : diag.getMessage(PARSED_LOCALE).split("\\r?\\n")) { + if (line.trim().startsWith("location:")) { + if (!line.contains(REPL_CLASS_PREFIX)) { + // Resolution error must occur within a REPL class or it is not resolvable + return false; + } + } + } + return true; + } + @Override public String toString() { return "WrappedDiagnostic(" + getMessage(null) + ":" + getPosition() + ")"; diff --git a/langtools/test/jdk/jshell/DropTest.java b/langtools/test/jdk/jshell/DropTest.java index a24304149ff..0e61ebad700 100644 --- a/langtools/test/jdk/jshell/DropTest.java +++ b/langtools/test/jdk/jshell/DropTest.java @@ -23,6 +23,7 @@ /* * @test + * @bug 8081431 * @summary Test of JShell#drop(). * @build KullaTesting TestingInputStream * @run testng DropTest @@ -79,7 +80,6 @@ public class DropTest extends KullaTesting { assertActiveKeys(); } - @Test(enabled = false) // TODO 8081431 public void testDropImport() { PersistentSnippet imp = importKey(assertEval("import java.util.*;")); PersistentSnippet decl = varKey( diff --git a/langtools/test/jdk/jshell/MethodsTest.java b/langtools/test/jdk/jshell/MethodsTest.java index 28eec7332ca..a5ffcd383ba 100644 --- a/langtools/test/jdk/jshell/MethodsTest.java +++ b/langtools/test/jdk/jshell/MethodsTest.java @@ -23,6 +23,7 @@ /* * @test + * @bug 8080357 * @summary Tests for EvaluationState.methods * @build KullaTesting TestingInputStream ExpectedDiagnostic * @run testng MethodsTest @@ -36,7 +37,6 @@ import jdk.jshell.Snippet.Status; import org.testng.annotations.Test; import static jdk.jshell.Snippet.Status.*; -import static jdk.jshell.Snippet.SubKind.*; @Test public class MethodsTest extends KullaTesting { @@ -74,6 +74,15 @@ public class MethodsTest extends KullaTesting { assertMethodDeclSnippet(m1, "f", "(Bar)void", DROPPED, 1, 0); } + // 8080357 + public void testNonReplUnresolved() { + // internal case + assertEval("class CCC {}", added(VALID)); + assertEval("void f1() { CCC.xxxx(); }", added(RECOVERABLE_DEFINED)); + // external case, not recoverable + assertDeclareFail("void f2() { System.xxxx(); }", "compiler.err.cant.resolve.location.args"); + } + public void methods() { assertEval("int x() { return 10; }"); assertEval("String y() { return null; }"); diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 8695cb9a393..8593b3c784f 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -467,18 +467,6 @@ jdk.jvmstat_COPY := aliasmap ################################################################################ -jdk.vm.ci_EXCLUDE_FILES += \ - jdk/vm/ci/options/processor/OptionProcessor.java \ - jdk/vm/ci/service/processor/ServiceProviderProcessor.java \ - # - -jdk.vm.ci_EXCLUDES += \ - META-INF/jvmci.options \ - META-INF/jvmci.providers \ - # - -################################################################################ - jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS jdk.xml.bind_CLEAN := .properties jdk.xml.bind_COPY := .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java diff --git a/make/Init.gmk b/make/Init.gmk index b0c2d881bf4..3c7a664e6e4 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -168,7 +168,7 @@ ifeq ($(HAS_SPEC),) MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \ USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \ - LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \ + LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) LOG_CMDLINES=$(LOG_CMDLINES) \ INIT_TARGETS="$(INIT_TARGETS)" \ SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \ PARALLEL_TARGETS="$(PARALLEL_TARGETS)" diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index 2bf05d1eb29..6632a5c888b 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -121,6 +121,23 @@ ifeq ($(HAS_SPEC),) endif endef + # Look for a given option in the LOG variable, and if found, set a variable + # and remove the option from the LOG variable + # $1: The option to look for + # $2: The option to set to "true" if the option is found + define ParseLogOption + ifneq ($$(findstring $1, $$(LOG)),) + $2 := true + # COMMA is defined in spec.gmk, but that is not included yet + COMMA := , + # First try to remove ",